-
1. Re: how to set time out in soap client using JBossWS
thomas.diesler Feb 6, 2006 7:26 AM (in response to luan)If you want to use ths Sun client
com.sun.xml.rpc.client.StubBase
then you should ask them.
If you want to uise the jboss client, then we have this method availbale on the Stub
http://anoncvs.forge.jboss.com/viewrep/JBoss/webservice/src/main/org/jboss/webservice/client/Stub.java?r=1.1.2.9 -
2. Re: how to set time out in soap client using JBossWS
luan Feb 11, 2006 11:37 AM (in response to luan)Thanks for the info.
I followed the WSClientDII example and created a jboss client trying to access a doc/lit service generated by jwsdp. When I run the client, I got NullPointerException because the string parameter I passed into the method became null somewhere.
I believe this should work unless I'm doing something wrong.
Please help,
Thanks,
Luan
Below is the client code and part of the exception stack:
package mgiparck;
import java.net.*;
import java.io.*;
import javax.xml.namespace.*;
import org.jboss.webservice.client.*;
import org.jboss.axis.client.*;
public class mgiparserJBossclient {
public static void main(String[] args) throws Exception {
mgiparserJBossclient mgiparserjbossclient = new mgiparserJBossclient();
URL wsdlURL= null;
URL mappingURL = null;
try {
wsdlURL = new URL("http://localhost:8080/MgiParserServerJBoss/myParserService?wsdl");
mappingURL = new File("c:/jboss-4.0.3SP1/jbossj2eetutorial/examples/mgiparser/dd/ws/jaxrpc-mapping.xml").toURL();
} catch (Exception e) {
}
QName serviceName = new QName("http://com.mgiparser/MgiParser", "MgiParser");
ServiceFactoryImpl factory = (ServiceFactoryImpl)ServiceFactory.newInstance();
Service service = (org.jboss.axis.client.Service)factory.createService(wsdlURL, mappingURL, null, serviceName, null);
Call call = (org.jboss.axis.client.Call)service.createCall(new QName("http://com.mgiparser/MgiParser", "MgiParserInterfacePort"), "getParsingResult");
call.setTimeout(60000);
String result = (String)call.invoke(new Object[] {"This is a test"});
System.out.println("result is: " + result);
}
}
10:36:45,320 INFO [STDOUT] incoming message is: null
10:36:45,320 ERROR [InvokerProviderJSE] Error from service endpoint, processing
fault handler chain
java.lang.NullPointerException
at mgipack.MgiMsgHandler.parseMsg(MgiMsgHandler.java:12)
at mgipack.MgiParserImpl.getParsingResult(MgiParserImpl.java:12)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.webservice.server.InvokerProviderJSE.invokeServiceEndpoint(
InvokerProviderJSE.java:154)
at org.jboss.webservice.server.InvokerProvider.invokeMethod(InvokerProvi
der.java:305)
at org.jboss.axis.providers.java.RPCProvider.invokeTarget(RPCProvider.ja
va:176)
at org.jboss.webservice.server.InvokerProviderJSE.invokeTarget(InvokerPr
oviderJSE.java:93)
at org.jboss.axis.providers.java.RPCProvider.processMessage(RPCProvider.
java:121)
at org.jboss.axis.providers.java.JavaProvider.invoke(JavaProvider.java:3
58)
at org.jboss.axis.strategies.InvocationStrategy.visit(InvocationStrategy
.java:73)
at org.jboss.axis.SimpleChain.doVisiting(SimpleChain.java:160)
at org.jboss.axis.SimpleChain.invoke(SimpleChain.java:123)
at org.jboss.axis.handlers.soap.SOAPService.invoke(SOAPService.java:560)
......... -
3. Re: how to set time out in soap client using JBossWS
luan Feb 11, 2006 11:50 AM (in response to luan)This is the wsdl:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="MgiParser" targetNamespace="http://com.mgiparser/MgiParser" xmlns:tns="http://com.mgiparser/MgiParser" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns2="http://com.mgiparser/MgiParser/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<schema targetNamespace="http://com.mgiparser/MgiParser/types" xmlns:tns="http://com.mgiparser/MgiParser/types" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://www.w3.org/2001/XMLSchema">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<soap:operation soapAction=""/>
<soap:body use="literal"/>
<soap:body use="literal"/>
<soap:address location="http://luan-1:8080/MgiParserServerJBoss/myParserService?wsdl"/> -
4. Re: how to set time out in soap client using JBossWS
luan Feb 11, 2006 11:53 AM (in response to luan)<?xml version="1.0" encoding="UTF-8" ?>
- <definitions name="MgiParser" targetNamespace="http://com.mgiparser/MgiParser" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns2="http://com.mgiparser/MgiParser/types" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://com.mgiparser/MgiParser" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <schema targetNamespace="http://com.mgiparser/MgiParser/types" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://com.mgiparser/MgiParser/types" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
-
-
-
-
-
-
-
-
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
-
<soap:operation soapAction="" />
-
<soap:body use="literal" />
-
<soap:body use="literal" />
-
-
<soap:address location="http://LUAN-1:8080/MgiParserServerJBoss/myParserService" /> -
5. Re: how to set time out in soap client using JBossWS
luan Feb 11, 2006 11:58 AM (in response to luan)Sorry, having problem posting the entire wsdl. Somehow it leaves the most important parts.
Anyway, the service has one method which takes one string parameter. -
6. Re: how to set time out in soap client using JBossWS
thomas.diesler Feb 15, 2006 8:35 AM (in response to luan)You could take a look at the samples that are attached to the wiki.
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossWS