Set timeout in webservice client

Hi,
I have a java stand alone web service client using Weblogic webserviceclient+ssl.jar,
how can I setup the web service timeout?
when I get the service object, there is no a method like setTimeout I can call to set time out. even in ((javax.xml.rpc.Stub)Order, I cannot find a good method
thanks
john

John:
I am researching this same problem. Check out this forum answer and let me know if it works for you!
http://forums.bea.com/bea/message.jspa?messageID=202432714&tstart=0
I haven't been able to test it yet - though it works without timing out.
Mark

Similar Messages

  • Setting timeout for webservice

    hello all,
    I have made client program to connect to a webservice using dynamic url, my problem is i am unable to set the timeout of the webservice if anybody knows please let me know. my code is as follows.
    WebServiceClient ann = testpackage.TestClassService.class.getAnnotation(WebServiceClient.class);
    try {
    testpackage.TestClassService service = new testpackage.TestClassService(new URL("MY URL"), new QName(ann.targetNamespace(), ann.name()));
    testpackage.TestClass port = service.getTestClassPort();
    String result = port.getUserTask("HELLO");
    System.out.println(result);
    } catch (MalformedURLException ex) {
    using this code how can i set timeout at client side
    thanks in advance

    hi there thanks for your reply but your solution didn't worked for me. may be because of mistake in my question explanation i will explain it again
    WebServiceClient ann = testpackage.TestClassService.class.getAnnotation(WebServiceClient.class);
    try {
    testpackage.TestClassService service = new testpackage.TestClassService(new URL("MY URL"), new QName(ann.targetNamespace(), ann.name()));
    testpackage.TestClass port = service.getTestClassPort();
    String result = port.getUserTask("HELLO");
    System.out.println(result);
    } catch (MalformedURLException ex) {
    using this code i am calling my webservice and the function "getUserTask" which give me some output in return.
    now, what situation i am facing is whenever i make a call to the above function and if RTO occurs after the call of the function then my application comes in to a hang mode situation. and i am unable to do anything untill the reconnection of the network occurs.Either i have to wait for the reconnection or i have to terminate my applicartion.
    My desire is, i should be able to set my timeout period of a web service request. if no reply comes in the given time period then i should be able to raise any message to the user.
    I think ihave made myself a bit more clear.
    thanks for your reply once again.

  • Is there a way to set timeout from rich client?

    Alfreda

    Hi,
    Actually your question is little unclear to me, you can setup the
    Eng.Stop timeout from registry editor.
    Application Server/6.0/CCS0/ENG/3/Eng Stop Timeout= number of seconds.
    If this doesnot solve your doubt, please post with few more details.
    Thanks,
    Rakesh.
    Alfreda wrote:
    Alfreda

  • Need help about setting timeout webservice client.

    Hi,
    I trying to set timeout before make call to the webservices, my target webservice is deployed on WebLgic server 8.14 (service pack 4). Nothing just Thread.sleep for 1 min. then return some string. Here is my client code. I use the proxy generated by the workshop testing browser, "Java proxy" button.
    public static void main(String a[]) {
    try {
    EjbTimeout_Impl proxy = new EjbTimeout_Impl();
    EjbTimeoutSoap_Stub myStub = (EjbTimeoutSoap_Stub)proxy.getEjbTimeoutSoap();
    BindingInfo bInfo = (BindingInfo)myStub._getProperty("weblogic.webservice.bindinginfo");
    System.out.println(bInfo.getTimeout()); // print out '-1' no timeout I guess
    bInfo.setTimeout(5); //secs
    System.out.println(bInfo.getTimeout()); // print out '5', value change accepted
    myStub._setProperty("weblogic.webservice.rpc.timeoutsecs", "5");
    System.out.println(myStub._getProperty
    ("weblogic.webservice.rpc.timeoutsecs")); // also print '5'
    String ss = myStub.sayHello("WEBLOGIC");
    System.out.println(ss);
    } catch (Exception e) {
    System.out.println(e.toString());
    As you see the timeout value is changed but when I call webservice from this client everything is fine. The output string ruturn from webservice is printed out after Thread.sleep(60000).
    Are there any missing things about this client code, my webservice code is quite simple, or if there is some way else to achieve this ???
    Many thanks.

    Before you use the JMS, you need to deploy some drivers related to specific MQseries, Kindly ensure that proper driver are deployed....
    If you use MQSeries 53x.xxx, you must enter the following JAR files in aii_af_jmsproviderlib.sda.
    com.ibm.mq.jar, com.ibm.mqbind.jar, com.ibm.mqjms.jar, connector.jar (use the JAR file from the J2EE client directory)
    check this link it will give you more inofmration
    http://help.sap.com/saphelp_nw04/helpdata/en/cd/d85a9d6fab7d4dbb7ae421f710626c/content.htm
    check this to get the condifuration the JMS
    How to use conversion modules in JMS - https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f02d12a7-0201-0010-5780-8bfc7d12f891
    Ref How To Use the Content Conversion Module in JMS Adapter - https://websmp106.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000582377&

  • Setting timeout for SOAP requests in a webservice client

    I am trying to set the timeout for a synchronous SOAP request sent to a Web Service deployed on weblogic 8.1 SP2. I tried setting timeout thru bindinginfo setTimeout() and also javax.xml.rpc.Stub _setProperty(). Both of them seem to be not working. I set the value to as low as 1 sec but i still donot get a timeout. Other properties/method from these two classes work fine though (like endpointaddress property in javax.xml.rpc.Stub and setVerbose flag to true in BindingInfo).
    Can someone please help.
    Thanks in Advance
    srini

    Our application calls the webservice provided by another company over the internet using the ssl. We use the wsdl url of the webservice on the destination while creating the port. If the destination is not available statement which creates the port blocks for around 4 minutes.
    I think the first network call gets the wsdl from the remote server. Thus we encounter delays before getting the stub created. How can I timeout such a calls.
    try {
    port = (new ServiceName_Impl(remoteWsdlURL)).getServiceNameSoap();
    } catch (IOException e) {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Setting timeout of web service client

    I created a web service client using the java proxy for
    a web service by running my web service in weblogic workshop test browser and by using
    the jar file created by clicking on "Java Proxy" button.
    i am calling my web service my adding code similar to this and it works
    HelloWorld_Impl proxy = new HelloWorld_Impl();
    HelloWorldSoap soapProxy = proxy.getHelloWorldSoap();
    But, i am not sure how to set the timeout of my client programatically.
    Is there a way to do this ?
    Any help is greatly appreciated.

    Anyway,
    I figured it out myself, by looking at other posts and applying some reflection API
    HelloWorld_Impl proxy = new HelloWorld_Impl();
    HelloWorldSoap soapProxy = proxy.getHelloWorldSoap();
    // I learnt that this soapProxy is infact an object of HelloWorldSoap_Stub class
    HelloWorldSoap_Stub myStub = (HelloWorldSoap_Stub)proxy.getHelloWorldSoap();
    BindingInfo bInfo = (BindingInfo)myStub._getProperty("weblogic.webservice.bindinginfo");
    bInfo.setTimeout(5); //secs
    myStub._setProperty("weblogic.webservice.rpc.timeoutsecs", "5"); // secs
    // finally you can call the methods of the web service
    soapProxy.Hello();
    Please be aware that, upon time out, you would get an exception : <class = java.rmi.RemoteException
    cause = javax.xml.rpc.soap.SOAPFaultException: javax.xml.rpc.JAXRPCException:java.net.SocketTimeoutException: Read timed out.>
    Also, my env : Weblogic 8.1 SP4

  • CreateObject - webservice - setting Timeout

    I'm trying to set the timeout of a webservice using the
    createObject method.
    I am running Coldfusion 8,0,1,195765.
    The coldfusion documentation specifies that you can pass a
    arguments struct to createObject that will set variation properties
    of the webservice object including the timeout.
    CreateObject:
    web service object
    As documented, I'm creating the webservice using the attached
    code. Despite specifying specifying the timeout to be 15 seconds,
    the object's timeout gets set to 0 (default, no timeout). I need to
    specify the timeout because I do not want page to hang if the
    webservice provider goes out.
    Does coldfusion 8.0.1 actually support specifying the
    timeout? If so, am I creating the Webservice object correctly?

    Hi,
    In case of Adaptive Webservice model, we can set timeout using this code.
    Request_NumberToWords requestMO = new Request_NumberToWords(model);
    requestMO.wdSetInvocationModifier(
      new IWDWSInvocationModifier() {
        public void doModifyInvocation(Object port) {
          HTTPControlInterface httpItf = HTTPControlFactory.getInterface(port);
          //timeout for this WS invocation is 120 sec; don't use global config. setting of WS-Runtime
          httpItf.setSocketTimeout(120000);
        public void doModifyAfterInvocation() {}
    Regards
    LN

  • As a webservice client, how to set character encoding for JAX-WS?

    I couldn't find the right API to set character encoding for a webservice client. What I did is
    1, wsimport which gives me MyService, MyPortType...
    2. Create new MyService
    3. Get MyPort from MyService
    4. Call myPort.myOperation with objects
    Where is the right place to set character encoding and how to set it? Thanks.
    Regards
    -Jiaqi Guo

    The .js file and the html need to have the same encoding. If
    your html uses iso-8859-7, then the .js must also use that. But if
    the original text editor created the .js file using utf-8, then
    that is what the html needs to use.

  • Regarding setting timeout

    Hi all,
    I have a requirement to set timeout for executing weservice using
    WebDynpro (Webservice model ).. Iam able to do this for
    Adaptive Webservice model, but my need is for Webservice model only..
    Can anybody help me regarding this,
    Thanks in Advance
    LakshmiNarayana.N

    Hi Lakshmi,
    You can Refer to Piyush's reply in this [thread|SocketTimeout Exception while calling a Web Service from EJB;.
    This variable sets the default timeout for all the Web Service Clients on the Server.
    Hope it helps.
    Regards,
    Alka.

  • Setting up IC Web Client in CRM 5.0 SP06

    Hi Experts:
    I am trying to set up IC Web Client on our CRM server. The CRM consultants have already set this up in SE80. However, after calling the transaction CRM_IC, i enter the user name and password, but 60 seconds after that I get the time out error with the following message:
    Detail: Connection to partner timed out after 60s
    I beleive that this is happening because the following parameter hasn't been set up in the instance profile:
    icm/server_port_0 = PROT=HTTP, PORT 1080, TIMEOUT=30, PROCTIMEOUT=600
    However, I am not sure on the Port number, should it be 1080 or 80<Sys No.>
    Please let me know what I should do here
    Thanks
    Imran

    Arright:
    I had to add one parameter for the instance profile and modify another in the instance profile.  Please see OSS note 824554
    ADDED: Parameter Name: icm/host_name_full
    MODIFIED: icm/server_port_0 (SEE OSS Note for details)
    icm/server_port_0 = PROT=HTTP, PORT 1080, TIMEOUT=30, PROCTIMEOUT=600
    WE also noticed that the initial load of each item took a lot of time.  ~20 minutes.
    Please be advised that this is development environment.
    Once the initial objects were loaded..it works good.
    IK

  • How to set up XMLA webservice for Essbase 7.1.5?

    <p>Hi</p><p> </p><p>I would like to set up XMLA webservice for Essbase so that I canquery Essbase OLAP databases on the web using XMLA Discover andExecute methods from client application.</p><p> </p><p>Will anybody point to the right document / provide me with anyinfo?</p><p> </p><p>Thanks</p><p>Shailesh Valera</p>

    It is not a supported feature for home screen wallpaper.

  • Setting up a webservice url for consumption in browser

    Hi,
    I am new at webservices and all this fancy stuff...
    I managed to set up a webservice wrapper in NW Developer
    Studio for my stateless session bean endpoint creating an order in our 3rd party erp system.
    So far so good, I ceated a client proxy and a client jsp for testing purposes, and that works as well.
    But I cant manage to find out how to call it directly
    from a web browser, so that it posts the order and
    returns with the result string. I tried the following:
    http://host:50000/OrderRequestForEBasis/Config1?wsdl
    &endpoint=Config1Port_Document
    &operation=public abstract test.types.p2.OrderRequestResponse test.OrderRequestForEBasisViDocument
    .orderRequest(test.types.p2.OrderRequest)
    throws java.rmi.RemoteException,
    test.RemoveException,
    test.Exception
    &formStatus=SUBMIT
    &formAddElement=
    &formRemoveElement=
    &iparameters_orderRequest=
    <<parameter 1 holding an XML string>>
    &iparameters_system=
    <<parameter 2 holding additional info>>
    But that instructs the WAS to respond with the
    webservice test web page.
    Thanks for any hints
    Matthias

    Hi Matthias,
    What you did is correct. You need to create client proxy and some front end application to call your web service. You cannot directly call any web services without doing all these things.
    Url you have given is WSDL of your web service. Based on this description you need to create proxy for that. You cannot directly communicate with that.
    Regards,
    Bhavik

  • Change webservice client transport/binding

    I am migrating web service client generated by clientgen from 7.0 to 8.1. 7.0 client uses weblogic.webservice.binding.soap.HttpClientBinding which works directly with sockets and is fine for me. But 8.1 uses weblogic.webservice.binding.http11.Http11ClientBinding which works with java.net.HttpUrlConnection that requires proxy being set in java system property which is system wide and I cannot use that. HttpClientBinding uses system wide setting as well but it is webservice client specific at least.
    So I want use HttpClientBinding in 8.1 as well. I am able to change it by calling
    BindingFactory.getInstance().register("http11", weblogic.webservice.binding.soap.HttpClientBinding.class);
    but this is again system wide setting which I am afraid of because of influencing other WS clients not using proxy. Is it possible to do it somehow in per client basis?
    Injecting custom Binding info with getTransport returning "http" or in some other way.
    Alternatively any way allowing me to set proxy on per WS client is solution for me

    Hi Dahran,
    SCC7 is for post import.
    first you have to import the transports generated during the export into your client.
    STMS. Go to your import queue and choose in the menu
    Extras ->Other requests add
    Fill in the transport number of one of the generated transports during the export. (something like <SID>KX0000x)
    <b>After</b> the import you have to perform the SCC7

  • Dynamic WebService client within a WebService Handler

    We have a WebService running on WebLogic 10.3 that has a handler that contains a Webservice client that connects to a set of IIS WebServices.
    The client is called with code like this:
    QName qname = new QName("http://www.company.com/Webservices/", "UserService");
    UserService service = new UserService(url, qname);
    service.setHandlerResolver(resolver);
    UserServiceSoap uss = service.getUserServiceSoap();
    The URL is dynamic, we have different servers that contain different data other than that they are the same. When this is called the first time with URL http://abc it works just fine. If it is called again but this time pointing to URL http://xyz, the client still goes to http://abc. We have check through debugging to ensure that we are really passing the correct URL, and we are. I traced this through a tool called WireShark and can see our client making 2 GET requests to the proper WSDL but then does the POST to http://abc. URLS have been altered to protect the innocent :) This same webservice containing this handler works as expected within Tomcat, it is in WebLogic that things get weird. Any help would be appreciated.
    Thanks,

    Hi
    <b>Bojja Guruvulu</b>
    My Email Id is : <b>[email protected]</b>

  • WebService Client - how to enable HTTP Compression

    Hi
    I have written a simple WebService Client. The WebService expects that the WebService clients enable HTTP compression. This is the exact text from the docs:-
    ""1. Client should be HTTP Compression enabled
    HTTP Compression had been made mandatory for API�s. Thus API�s client should
    include �Accept-Encoding: zip� header as part of request and should be able to
    handle compressed data. Please note that system will send an error message if client
    are not http compression enabled saying client should be compression enabled."
    I do not know how to enable HTTP compression in the WebService Client. The method called is "GetInstantaneousFlowData". It accepts no arguments and returns xsd:datetime.
    The wsdl can be found at:-
    http://energywatch.natgrid.co.uk/EDP-PublicUI/PublicPI/InstantaneousFlowWebService.asmx?WSDL
    Can someone please help :-
    import javax.xml.rpc.ServiceFactory;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.Call;
    import javax.xml.rpc.ParameterMode;
    import javax.xml.namespace.QName;
    import java.util.Calendar;
    public class TestNGPubTime4 {
    public static void main(String[] args) throws Exception {
         // Setup the global JAX-RPC service factory
         System.setProperty( "javax.xml.rpc.ServiceFactory", "weblogic.webservice.core.rpc.ServiceFactoryImpl");
    // create service factory
    ServiceFactory factory = ServiceFactory.newInstance();
    // define qnames
    String targetNamespace = "http://www.NationalGrid.com/EDP/BusinessEntities/Public/";
    QName serviceName = new QName(targetNamespace, "InstantaneousFlowWebService");
    QName portName = new QName(targetNamespace, "InstantaneousFlowWebServiceSoap");
    QName operationName = new QName("http://www.NationalGrid.com/EDP/UI/GetInstantaneousFlowData",
         "GetLatestPublicationTime");
    // create service
    Service service = factory.createService(serviceName);
    // create call
    Call call = service.createCall();
    // set port and operation name
    call.setPortTypeName(portName);
    call.setOperationName(operationName); // add parameters
         call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
         call.setProperty(Call.SOAPACTION_URI_PROPERTY, "http://www.NationalGrid.com/EDP/UI/GetInstantaneousFlowData");
    //     call.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY, "http://schemas.xmlsoap.org/soap/encoding/");
    call.setReturnType(new QName( "http://www.w3.org/2001/XMLSchema","datetime") );
    // set end point address : soap address location
    call.setTargetEndpointAddress("http://energywatch.natgrid.co.uk/EDP-PublicUI/PublicPI/InstantaneousFlowWebService.asmx");
    // invoke the remote web service
    Calendar result = (Calendar) call.invoke(new Object[] {});
    System.out.println("result=" + result);
    }

    Rishika,
    Thanks for your reply.
    Could I get clariffication on some more thing?
    I am using Axis 1.4 version. And I am able to implement the gzip while doing the following steps.
    1) Change the pivote value to CommonsHTTpSender.
    <transport name="http" pivot="java:org.apache.axis.transport.http.CommonsHTTPSender"/>
    2) public class RetreiveReservationsSOAPBindingStubLocal extends RetreiveReservationsSOAPBindingStub.
    I Override the method to support GZIP.
    org.apache.axis.client.Call _call = super.createCall();
    call.setOperation(operations[0]);
    _call.setUseSOAPAction(true);
    _call.setSOAPActionURI("retreiveReservations");
    _call.setEncodingStyle(null);
    call.setProperty(org.apache.axis.client.Call.SENDTYPE_ATTR, Boolean.FALSE);
    call.setProperty(org.apache.axis.AxisEngine.PROPDOMULTIREFS, Boolean.FALSE);
    call.setProperty(HTTPConstants.MCACCEPT_GZIP, Boolean.TRUE);
    call.setProperty(HTTPConstants.MCGZIP_REQUEST, Boolean.TRUE);
    call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11CONSTANTS);
    _call.setOperationName(new javax.xml.namespace.QName("", "retreiveReservations"));
    super.setRequestHeaders(_call);
    super.setAttachments(_call);
    Object resp = call.invoke(new Object[] {retreiveReservationsRequest});
    I am able to send and receive the request and response in gzip encoded format.
    Now my clarrification is,
    Is it possible to set the piote value to CommonsHTTPSender for the transport http through my code?
    How could I set the values from code?
    Reason is, I don't want to manually edit the axis 1.4's client-config.wsdd
    Since this is very critical thing, please please help me.
    Thanks in advance.
    Regards,
    Nishad Ponery

Maybe you are looking for

  • "Conversation" View in SMS Text Messages

    I am unable to change the settings in SMS text options to 'conversation' view. I followed the instructions on this help page but I didn't even havesome of the buttons that were mentioned. My other BB's (9300, Bold 9000) defaulted to conversation view

  • My Macbook Pro Won't boot. Unable to find the driver for this platform

    Hi there, After doing some casual internet browsing earlier today (facebook + twitter etc) my laptop froze up. While I was able to click between windows, the ever faithful beach ball was there to ensure I couldn't really do anything, including making

  • Error when attempting to upload:org/apache/commons/fileupload/disk/DiskFile

    Hi there, I am attempting to use struts to upload an image to a folder within my application. The following error is given: java.lang.NoClassDefFoundError: org/apache/commons/fileupload/disk/DiskFileItem      org.apache.struts.upload.CommonsMultipart

  • Hi  problems in function module

    Hi friends I have the following problems......... When I am using this  following code  in a function module its not giving me output until i comment those two fields kwmeng and netwr..i have use VRKME and WAERS  for those two..........which are the

  • Conduit is messing me up.

    I just want it gone. " Open your Firefox browser and type "about:config" in address bar Now you can see a list of items "Preference Name" and its values. Now type "search" in the filter box on top of that window... Check all strings contents as "COND