How to write a client that calls a document-style web servic
mette Jan 26, 2005 6:46 PMI have created a JSE web service, document-style, and I am currently creating the client part, to test the deployed service.
I have done a cut and paste of the client code in the Wiki, and replaced the names, url's and so forth, but wen i try to run it, I get the following exception:
Exception in thread "main" javax.xml.rpc.ServiceException: java.lang.NullPointerException
at org.jboss.webservice.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:125)
at sandbox.mette.ws.device.WSClient.main(WSClient.java:46)
Caused by: java.lang.NullPointerException
at java.util.StringTokenizer.(StringTokenizer.java:139)
at java.util.StringTokenizer.(StringTokenizer.java:155)
at org.jboss.webservice.deployment.ServiceDescription.getPackageName(ServiceDescription.java:824)
at org.jboss.webservice.deployment.ServiceDescription.initTypeMappings(ServiceDescription.java:798)
at org.jboss.webservice.deployment.ServiceDescription.initServiceDescription(ServiceDescription.java:114)
at org.jboss.webservice.deployment.ServiceDescription.(ServiceDescription.java:81)
at org.jboss.webservice.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:120)
... 1 more
My client code is:
URL url =
new URL("http://localhost:8080/ws4ee/services/SensorRegistryServiceJSE?wsdl");
QName qname = new QName("urn:com:bonsaidevelopment:schemas:registry:SensorRegistryCommands.xsd",
"SensorRegistryServiceJSE");
ServiceFactory factory = ServiceFactory.newInstance();
Service service = factory.createService(url, qname);
It fails on the last line.
Now, I found the following paragraph in the Wiki:
This service can now be accessed from any webservice client. Here is a simple test case, that shows how a java client would first obtain the WSDL from the remote location, and then invoke getContactInfo on the service endpoint interface. Please note that in the case of document style web services, the client should be given a pointer to the jaxrpc-mapping.xml file, which the standard JAXRPC javax.xml.rpc.ServiceFactory? does not support.
So, this may be the cause for my exception, but I cannot find any information on how to write a client with JBoss for document-style, or what the quite vague description "the client should be given a pointer to the jaxrpc-mapping.xml file" means. Also, if i do not use the standard JAXRPC service factory, then what am I supposed to use?