How do I timeout client side call to a SOAP webservice









up vote
0
down vote

favorite












I have a REST API which is being consumed by java script front end ( angular ).



When my REST API endpoint is invoked the API in turn needs to make a call to a SOAP webservice .



The client jar for the soap service is in classpath.



REST service is running in Jetty and Open JDK 1.8 .



SOAP web service is hosted separately details of which I do not possess other than end point and wsdl etc .



Everything is working fine .



One of the requirements is for the REST API to timeout in 5 seconds.



Sometimes the SOAP endpoint takes about 10 seconds to respond.

So ideally the REST endpoint should time out after 5 seconds but it never does.



It keeps waiting for the SOAP service to respond so whatever is the response time of the SOAP service determines REST API response.



Please do not suggest asynchronous calls - the aim is to make the SOAP client call to the SOAP web service timeout.



Have tried a number of options to set the timeout. See below options found over the internet.
Unfortunately none of them work :



Get QName
Create Service from QName
GetPort
Map<String,Object> context = ((BindingProvider)port).getRequestContext();
context.put("javax.xml.ws.service.endpoint.address",https wsdl location");

/** try and timeout after 5 seconds - NOT working **/
/** option 1 **/
context.put("com.sun.xml.internal.ws.request.timeout", "5000");
context.put("com.sun.xml.internal.ws.connect.timeout","5000");

/** option 2 **/
context.put("javax.xml.ws.client.receiveTimeout", "5000");
context.put("javax.xml.ws.client.connectionTimeout","5000");

/** option 3 **/
context.put("com.sun.xml.ws.request.timeout", "5000");
context.put("com.sun.xml.ws.connect.timeout","5000");


None of these work.
Somewhere on the internet someone had suggested the following which also did not work:



context.put("timeout","10");


NOTE: above options have been tried one at a time. Havent put all of them together in one go !



Does anyone have any pointers ?



If it helps I am using soap client jar - wsclient_extended.jar
To sum up : soap client running in Jetty with Open JDK 1.8 .
Thanks










share|improve this question

























    up vote
    0
    down vote

    favorite












    I have a REST API which is being consumed by java script front end ( angular ).



    When my REST API endpoint is invoked the API in turn needs to make a call to a SOAP webservice .



    The client jar for the soap service is in classpath.



    REST service is running in Jetty and Open JDK 1.8 .



    SOAP web service is hosted separately details of which I do not possess other than end point and wsdl etc .



    Everything is working fine .



    One of the requirements is for the REST API to timeout in 5 seconds.



    Sometimes the SOAP endpoint takes about 10 seconds to respond.

    So ideally the REST endpoint should time out after 5 seconds but it never does.



    It keeps waiting for the SOAP service to respond so whatever is the response time of the SOAP service determines REST API response.



    Please do not suggest asynchronous calls - the aim is to make the SOAP client call to the SOAP web service timeout.



    Have tried a number of options to set the timeout. See below options found over the internet.
    Unfortunately none of them work :



    Get QName
    Create Service from QName
    GetPort
    Map<String,Object> context = ((BindingProvider)port).getRequestContext();
    context.put("javax.xml.ws.service.endpoint.address",https wsdl location");

    /** try and timeout after 5 seconds - NOT working **/
    /** option 1 **/
    context.put("com.sun.xml.internal.ws.request.timeout", "5000");
    context.put("com.sun.xml.internal.ws.connect.timeout","5000");

    /** option 2 **/
    context.put("javax.xml.ws.client.receiveTimeout", "5000");
    context.put("javax.xml.ws.client.connectionTimeout","5000");

    /** option 3 **/
    context.put("com.sun.xml.ws.request.timeout", "5000");
    context.put("com.sun.xml.ws.connect.timeout","5000");


    None of these work.
    Somewhere on the internet someone had suggested the following which also did not work:



    context.put("timeout","10");


    NOTE: above options have been tried one at a time. Havent put all of them together in one go !



    Does anyone have any pointers ?



    If it helps I am using soap client jar - wsclient_extended.jar
    To sum up : soap client running in Jetty with Open JDK 1.8 .
    Thanks










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have a REST API which is being consumed by java script front end ( angular ).



      When my REST API endpoint is invoked the API in turn needs to make a call to a SOAP webservice .



      The client jar for the soap service is in classpath.



      REST service is running in Jetty and Open JDK 1.8 .



      SOAP web service is hosted separately details of which I do not possess other than end point and wsdl etc .



      Everything is working fine .



      One of the requirements is for the REST API to timeout in 5 seconds.



      Sometimes the SOAP endpoint takes about 10 seconds to respond.

      So ideally the REST endpoint should time out after 5 seconds but it never does.



      It keeps waiting for the SOAP service to respond so whatever is the response time of the SOAP service determines REST API response.



      Please do not suggest asynchronous calls - the aim is to make the SOAP client call to the SOAP web service timeout.



      Have tried a number of options to set the timeout. See below options found over the internet.
      Unfortunately none of them work :



      Get QName
      Create Service from QName
      GetPort
      Map<String,Object> context = ((BindingProvider)port).getRequestContext();
      context.put("javax.xml.ws.service.endpoint.address",https wsdl location");

      /** try and timeout after 5 seconds - NOT working **/
      /** option 1 **/
      context.put("com.sun.xml.internal.ws.request.timeout", "5000");
      context.put("com.sun.xml.internal.ws.connect.timeout","5000");

      /** option 2 **/
      context.put("javax.xml.ws.client.receiveTimeout", "5000");
      context.put("javax.xml.ws.client.connectionTimeout","5000");

      /** option 3 **/
      context.put("com.sun.xml.ws.request.timeout", "5000");
      context.put("com.sun.xml.ws.connect.timeout","5000");


      None of these work.
      Somewhere on the internet someone had suggested the following which also did not work:



      context.put("timeout","10");


      NOTE: above options have been tried one at a time. Havent put all of them together in one go !



      Does anyone have any pointers ?



      If it helps I am using soap client jar - wsclient_extended.jar
      To sum up : soap client running in Jetty with Open JDK 1.8 .
      Thanks










      share|improve this question













      I have a REST API which is being consumed by java script front end ( angular ).



      When my REST API endpoint is invoked the API in turn needs to make a call to a SOAP webservice .



      The client jar for the soap service is in classpath.



      REST service is running in Jetty and Open JDK 1.8 .



      SOAP web service is hosted separately details of which I do not possess other than end point and wsdl etc .



      Everything is working fine .



      One of the requirements is for the REST API to timeout in 5 seconds.



      Sometimes the SOAP endpoint takes about 10 seconds to respond.

      So ideally the REST endpoint should time out after 5 seconds but it never does.



      It keeps waiting for the SOAP service to respond so whatever is the response time of the SOAP service determines REST API response.



      Please do not suggest asynchronous calls - the aim is to make the SOAP client call to the SOAP web service timeout.



      Have tried a number of options to set the timeout. See below options found over the internet.
      Unfortunately none of them work :



      Get QName
      Create Service from QName
      GetPort
      Map<String,Object> context = ((BindingProvider)port).getRequestContext();
      context.put("javax.xml.ws.service.endpoint.address",https wsdl location");

      /** try and timeout after 5 seconds - NOT working **/
      /** option 1 **/
      context.put("com.sun.xml.internal.ws.request.timeout", "5000");
      context.put("com.sun.xml.internal.ws.connect.timeout","5000");

      /** option 2 **/
      context.put("javax.xml.ws.client.receiveTimeout", "5000");
      context.put("javax.xml.ws.client.connectionTimeout","5000");

      /** option 3 **/
      context.put("com.sun.xml.ws.request.timeout", "5000");
      context.put("com.sun.xml.ws.connect.timeout","5000");


      None of these work.
      Somewhere on the internet someone had suggested the following which also did not work:



      context.put("timeout","10");


      NOTE: above options have been tried one at a time. Havent put all of them together in one go !



      Does anyone have any pointers ?



      If it helps I am using soap client jar - wsclient_extended.jar
      To sum up : soap client running in Jetty with Open JDK 1.8 .
      Thanks







      java web-services soap soap-client






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 10 at 1:35









      akila

      1052212




      1052212



























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53235282%2fhow-do-i-timeout-client-side-call-to-a-soap-webservice%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53235282%2fhow-do-i-timeout-client-side-call-to-a-soap-webservice%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Use pre created SQLite database for Android project in kotlin

          Darth Vader #20

          Ondo