Webservice client deployment
sudhakaratbits Nov 8, 2005 6:23 AMHello All
I am kinda new to webservices and also JBoss. I am trying out the examples given in the JBossWS documentation Wiki. I am trying to develop a document type service and a client for that service. I am able to deploy the service successfully but now the problem is with the client application. I am writing a stand-alone client (a helper class) that accesses this webservice and fetches the information i need. My webservice returns a custom value object as a return type. I am getting an error something like this.
org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
at org.jboss.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:206)
at org.jboss.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:1168)
at org.jboss.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:244)
at org.jboss.axis.message.SOAPElementAxisImpl.publishToHandler(SOAPElementAxisImpl.java:1386)
at org.jboss.axis.message.RPCElement.deserialize(RPCElement.java:262)
at org.jboss.axis.message.RPCElement.getParams(RPCElement.java:396)
at org.jboss.axis.client.Call.invoke(Call.java:2662)
at org.jboss.axis.client.Call.invoke(Call.java:2538)
at org.jboss.axis.client.Call.invokeInternal(Call.java:1976)
at org.jboss.axis.client.Call.invoke(Call.java:1914)
Here is the code i used for client application....
// call the webservice
URL url = new URL(SvcLocation);
QName svcName = new QName(qn,"ListCustomerService");
QName opName = new QName(qn,"getListOfCustomers");
QName retName = new QName(qn,"result");
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(url);
call.setOperationName(opName);
call.addParameter("String_1", XMLType.XSD_STRING,ParameterMode.IN);
call.registerTypeMapping(ListCustomersVO.class, retName,
new org.jboss.axis.encoding.ser.BeanSerializerFactory(ListCustomersVO.class, retName),new org.jboss.axis.encoding.ser.BeanDeserializerFactory(ListCustomersVO.class, retName));
call.setReturnType(retName,ListCustomersVO.class );
ListCustomersVO resListCustomersVO = (ListCustomersVO)call.invoke(new Object[] {CustomerName});
I am really stuck...n not able to proceed further... pls help.
thanks
sudhakar