|
| webservice call over https, timevalue influences performance |
 |
Thu, 22 Nov 2007 04:13:53 -080 |
I am calling a webservice with a test program (below a stripped version). I have
generated a webserviceclient.jar with the clientgen task.
I have to use a https connection. Which works but seems to be very slow.
When I use the http link, I get answers very quickly (within 100ms).
When I use the https link, i didn't get an answer, untill I added the property
for timeout and UseWebLogicURLStreamHandler.
The strange thing is that when I put the timeout on 30 seconds, I get answers
after 30seconds+approx. 100ms.
When I change the timeoutvalue to 5 seconds, the answers appear after
5seconds_approx.100ms. This is not what I expected. (I do actually get some
timeouts when I set the timeout value to 1 sec...)
I don't understand what's happening, can anybody help?
I'm using jars from weblogic8.1sp6.
Eventually this has to be called from a stateless session bean.
package webservice.test;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.xml.rpc.Stub;
import org.test.webserviceclient.IDataSoap;
import org.test.IData_Impl;
import weblogic.webservice.client.WLSSLAdapter;
public class Test {
public static void main(String[] args) throws Exception {
// Setup the global JAXM message factory
System.setProperty("javax.xml.soap.MessageFactory",
"weblogic.webservice.core.soap.MessageFactoryImpl");
// Setup the global JAX-RPC service factory
System.setProperty( "javax.xml.rpc.ServiceFactory",
"weblogic.webservice.core.rpc.ServiceFactoryImpl");
// Setup for timeout of webservice call
System.setProperty("weblogic.webservice.UseWebLogicURLStreamHandler",
"true");
// Parse the argument list
Test client = new Test();
//Client:
WLSSLAdapter.setStrictCheckingDefault(false);
//Weblogic Server:
//using this one I get an answer within 100ms
client.example("http://just-a-link.com/DataReq.asmx?WSDL");
//using this one I get an answer withing timeoutsecs+100ms (in this case
2.1secs)
client.example("https://just-a-link.com/DataReq.asmx?WSDL");
}
public void example(String wsdlURI) throws Exception {
IDataSoap port;
if (wsdlURI == null) {
port = new IData_Impl().getIDataSoap();
}
else {
port = new IData_Impl(wsdlURI).getIDataSoap();
}
Stub stub = (Stub) port;
stub._setProperty("weblogic.webservice.rpc.timeoutsecs",
"2");
String arg1="<mymessage>" +
"</mymessage>";
String s1 = port.DataRequest(arg1);
System.out.println(s1);
}
|
| Post Reply
|
|
|
|
|
|
|
|
|
|