9 Replies Latest reply on Dec 1, 2006 12:23 PM by ajay662

    setting timeouts in clients

    y_zl

      I have the same problem. each time I call an external web service I got the timeout error. could anybody give some advice ?

        • 1. Re: setting timeouts in clients
          thomas.diesler

          I create a SF issue
          http://sourceforge.net/tracker/index.php?func=detail&aid=1061386&group_id=22866&atid=376685

          A probable workaround is to use DII on the client side and case to the axis call impl.

           call = service.createCall(...);
           ((org.apache.axis.client.Call)call).setTimeout(...);
          
          


          • 2. Re: setting timeouts in clients
            y_zl

            Does that means we could not set timeout paramter if we don't use DII ? are there any configuration paramters which we could set the overall timeout for the WS client ?

            • 3. Re: setting timeouts in clients
              thomas.diesler

              Supported in jboss-4.0.1

               Context iniCtx = getInitialContext();
               Service service = (Service)iniCtx.lookup("java:comp/env/service/HelloWsService");
               HelloWs port = (HelloWs)service.getPort(HelloWs.class);
              
               Stub stub = (org.jboss.webservice.client.Stub)port;
              
               stub.setTimeout(new Integer(100));
               assertEquals(new Integer(100), stub.getTimeout());
              
               stub._setProperty(Stub.CLIENT_TIMEOUT_PROPERTY, new Integer(200));
               assertEquals(new Integer(200), stub._getProperty(Stub.CLIENT_TIMEOUT_PROPERTY));
              


              • 4. Re: setting timeouts in clients

                That's great . Thanks.

                When is 4.0.1 slated for release?

                • 5. Re: setting timeouts in clients
                  thomas.diesler

                  Hopefully, within the next few days

                  • 6. Re: setting timeouts in clients
                    nikolay123

                    I created the webservice client like shown in the tutorial

                    http://wiki.jboss.org/wiki/Wiki.jsp?page=WSRPCClientStepByStep

                    now i want to set the connection timeout:


                    Properties env = new Properties();
                    env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                    env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
                    env.setProperty(Context.PROVIDER_URL, "jnp://localhost:1199");
                    env.setProperty("j2ee.clientName", "ProcessEngineServiceWS");
                    InitialContext iniCtx = new InitialContext(env);

                    ProcessEngineServiceService service = (ProcessEngineServiceService)iniCtx.lookup("java:comp/env/service/ProcessEngineService");
                    ProcessEngineService endpoint = service.getProcessEngineService();

                    this 2 line do not have eny effect of the behavior of jboss 4.03SP1

                    ((Stub)endpoint).setTimeout(new Integer(20000));
                    ((Stub)endpoint)._setProperty(Stub.PROPERTY_CLIENT_TIMEOUT, new Integer(200000));


                    endpoint.processProductTaskList(tasklist,id,callback_url);

                    it is waiting for 5 min to raise a

                    2006-02-15 12:30:12,451 ERROR [org.jboss.webservice.client.PortProxy] Port
                    error
                    java.net.ConnectException: Connection timed out

                    • 7. Re: setting timeouts in clients
                      sb8888

                      ...
                      Stub stub = (org.jboss.webservice.client.Stub)port;

                      stub.setTimeout(new Integer(100));
                      assertEquals(new Integer(100), stub.getTimeout());

                      ...

                      Is the socket timeout value in milli-seconds or seconds?

                      -Thanks

                      • 8. Re: setting timeouts in clients
                        ajay662

                        Which jar do I need for class
                        "org.jboss.webservice.client.Stub"

                        I am using jbossws-1.0.4.GA and I don't see it in jbossws-client.jar for jdk1.5

                        • 9. Re: setting timeouts in clients
                          ajay662

                          Please ignore my last comment. The new class is StubExt documented in Chapter 5 of user guide.