String NS_XSD = "http://www.w3.org/2001/XMLSchema"; String targetNamespace = "http://www.bea.com/examples/Calculator"; System.setProperty("javax.xml.rpc.ServiceFactory", "weblogic.webservice.core.rpc.ServiceFactoryImpl"); System.setProperty("weblogic.webservice.verbose", "false"); System.setProperty("weblogic.webservice.UseWebLogicURLStreamHandler", "true"); ServiceFactory factory = ServiceFactory.newInstance(); QName serviceName = new QName(targetNamespace, "CalculatorService"); QName portName = new QName(targetNamespace, "CalculatorServicePort"); QName operationName = new QName(targetNamespace, "add"); Service service = factory.createService(serviceName); Call call = service.createCall(); call.setOperationName(operationName); call.setPortTypeName(portName); call.setProperty(Call.OPERATION_STYLE_PROPERTY, "rpc"); call.addParameter("intVal", new QName(NS_XSD, "int"), Integer.class, ParameterMode.IN); call.addParameter("intVal0", new QName(NS_XSD, "int"), Integer.class, ParameterMode.IN); call.setReturnType(new QName(NS_XSD, "int"), Integer.class); call.setTargetEndpointAddress("http://localhost:7001/CalculatorService/CalculatorService"); ((weblogic.webservice.core.rpc.CallImpl) call).setProperty("weblogic.webservice.rpc.timeoutsecs", "5"); System.out.println("Invoked DII :"); System.out.println("Result : " + call.invoke(new Object[] { new Integer(a), new Integer(b) }));Now comes the second problem, all the existing client code for a huge number of webservices are SII codes (generated by the ANT task in webservices.jar). Instead of converting all the client codes to DII, I had to find the solution using SII. Since the code is not provided by BEA, I decompiled the jar to understand what's going on under the hood and found something strange, the weblogic.webservice.rpc.timeoutsecs set as a system property was fetched inside the jared code (in webservices.jar) but was only used in the logic that handled https invocations (may be missed out looking at the right place or it was never there). In order to confirm my findings, I exposed the service over https and modified the client code with some additional properties (related to https invocations and nothing to do with web service in particular) and VOILA!!!! It worked :)
Inference: To use the timeout property for rpc calls when using client generated SII, the webservice should be exposed in https (can't change the code in the jars used by the client code to fix it as the code is not open source). Or write a DII (example given above). For SII invocation over https you need to use the below mentioned properties:
System.setProperty("weblogic.security.SSL.trustedCAKeyStore", "C:/bea/weblogic81/server/lib/DemoIdentity.jks"); System.setProperty("weblogic.webservice.client.ssl.strictcertchecking", "false"); System.setProperty("weblogic.webservice.rpc.timeoutsecs", "10");For invocations over https you shall need jsafeFIPS.jar & webserviceclient+ssl.jar in classpath in addition to webservices.jar & weblogic.jar (you can find all of those in the weblogic's lib folder). The invocation may also ask for license files (don't know why), then even put the license.bea & license_scale_limited.bea in the classpath.
For Weblogic 9 versions, the property to be set has changed. More details can be found at http://download.oracle.com/docs/cd/E13222_01/wls/docs92/webserv/client.html. Those properties are:
((Stub)service_action)._setProperty("weblogic.wsee.transport.read.timeout", 5000); //values are in millis ((Stub)service_action)._setProperty("weblogic.wsee.transport.connection.timeout", 5000); //values are in millisSimiliar properties for Weblogic 10 can be found at http://docs.oracle.com/cd/E13222_01/wls/docs100/webserv/client.html I hope you found this post helpful.