cancel
Showing results for 
Search instead for 
Did you mean: 

SocketTimeoutException when calling a web service from a WD application

Former Member
0 Kudos

I'm trying to call a method of a web service from my WD application. The execution of the method longs more than 60 sec, so I'm always getting:

Service call exception; nested exception is: java.net.SocketTimeoutException: Read timed out

I've got this post, which tells to change the property "socketTimeout" of the client.

But I don't know what is the client in my WD application, does this refer to the logical port ?

I've tried inserting this into wdInit:

com.hesa.hesanet3.h3wsmodel.proxies.Hesanet3Impl service = com.hesa.hesanet3.h3wsmodel.H3WSModel.getServiceImpl();

logicalPort =(com.hesa.hesanet3.h3wsmodel.proxies.Hesanet3ViDocument) service.getLogicalPort("Config1Port_Document", com.hesa.hesanet3.h3wsmodel.proxies.Hesanet3ViDocument.class);

logicalPort._setProperty("socketTimeout", "30000");

But it doesn't work.

I've tried getting the logical port from the model object corresponding to the method of the webservice unsuccesfully.

I've tried with Visual Administrator -> instance -> Web Service Container -> Settings -> WS Clients Socket Timeout, increasing to 120 secs. No result, still stop at 60s.

I've tried with Visual Admin -> global configuration -> Http provider -> KeepAliveTimeout, increasing to 120 secs, and still stop at 60s.

I can't change model object code, but I've tried to debug it and setting the property in stubForLogicalPort and in _getGlobalFeatureConfig(), without change.

I'm using a HTTP Destination, does this have something to do?

I'm getting insane with this and I'm in urgent need of help.

How can I change the time the WD waits for the WebService to answer ?

Thanks in advance.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi All,

I face the same problem in a JSPDynpage while reading a large user base from Active directry. Any idea on how to set the sockettimeout property in JSPDynpage

Regrads

Srini

Former Member
0 Kudos

Hi Anibal,

We have a Tibco web service and using normal web service model. Our server version is 6.4 sp18. We are getting socketTimeOut Exception when we are doing performance testing.

Checked your thread where you have posted with your comments. But of no use . We implemented all the said methods but no use. As this is really stopping the go live. Please help us.

As you said, set the socket time out in the model generate classes. Did the same and tried to make read only but we are unable to deploy the project as it is failing during build itself.

Can you please provide us the help on the same

Thanks

Best Regards

Supriya BV

ronghai_huang
Employee
Employee
0 Kudos

If you are using ABAP as client, you can check the note 824554 in OSS system and configure the following ICM timeout parameter in ABAP:

-- icm/conn_timeout

-- icm/keep_alive_timeout

-- icm/server_port_<n>

In Java WS client case, I really didn't have any problems more after I used the setSocketTimeout() method.

Edited by: Ronghai Huang on Nov 4, 2008 9:44 AM

Former Member
0 Kudos

Hi Ronghai,

Thanks for your reply. Can you please more ellaborative. Please find below the steps we are following in my project.

We are using normal web service model and not the adaptive web service model. We are consuming tibco remote web services.

While doing preformance testing, we are socket time out with in one minute. But the requirement is set to 5 mins.

But while doing so, it is not getting updated. Please let us know valuable inputs on the same.

Thanks

Supriya.

Former Member
0 Kudos

I can't upgrade to sp17 by now. Thank you very much.

I found this workaround:

I modified directly the .java model classes of the WD project, in path "/gen_wdp/packages/<package model>/Request_*.java" :

I added to the execute method into the 'if' block the set of the property :

[...]

if ( (logicalPort != null ) && ( logicalPort instanceof javax.xml.rpc.Stub ) ) {

[...]

logicalPort._setProperty("socketTimeout", "300000");

}

Then I set these files read-only so the IDE won't regenerate them and clean my changes.

Sometimes I don't know why, the files are overwritten anyway and I have to restore them from a copy.

Former Member
0 Kudos

Find solution. Check this thread:

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/faq%2b-%2bmodels%2b-%2badaptive%2bweb%2bse...

The com.sap.tc.webdynpro.model.webservice.api.IWDWSInvocationModifier interface can be implemented by an application using the Adaptive Web Service model in order to modify the web service invocation object just before it's execution. Invocation modifiers need to be registered with the executable model class for which invocation is to be modified:

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() {}
  }
);

Best regards.

Former Member
0 Kudos

Useless answer.

There is no problem with the WS. In fact, the method ends correctly but WD application throws the exception anyway. And everything goes ok if the method take less than 60s.

There is no problem with Destination resolution.

ronghai_huang
Employee
Employee
0 Kudos

Hi,

I got the same error read timeout message. The Web Service developer from SAP Lab told me I should upgrade to the SP17 version for J2EE engine 640 and after that I should add the following code in my client (your IDE need also be updated):

HTTPControlInterface httpControl = HTTPControlFactory.getInterface(logicalport instance);

httpControl.setSocketTimeout(millisecond);

I have tested with the web browser's WSNavigator after I upgraded the server, it works now.

Hope it helps,

Roy

Former Member
0 Kudos

Hi

The problem can be in webservice also. Check the Webservice in local server.

See the Thread for HTTP Destination

Kind Regards

Mukesh