• Post Reply Bookmark Topic Watch Topic
  • New Topic

calling a webservice  RSS feed

 
Anish Kuti
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have generated webservices stub using axis 1.4 tool kit.
When I am calling the webservice with the below client it's error
------------------------------------------------------------

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

import com.hp.oo.service.ws.SendStatusRequest;
import com.hp.oo.service.ws.SendStatusResponse;

import javax.xml.namespace.QName;

public class testClient {
public static void main(String [] args) {
try {
String endpoint = "http://localhost:7001/axis/services/HPOOWebService";

Service service = new Service();
Call call = (Call) service.createCall();



call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("http://com/hp/oo/service/", "sendStatus"));

SendStatusRequest req = new SendStatusRequest();
req.setAppId("0");
req.setCustomerId("0");

SendStatusResponse res = (SendStatusResponse) call.invoke( new Object[] { req} );

System.out.println("Return Value" + res.getErrorCode() + "'");
System.out.println("Return Value" + res.getErrorText() + "'");
} catch (Exception e) {
System.err.println(e.toString());
}
}
}
----------------------------
error
------
- Exception:
org.xml.sax.SAXException: Deserializing parameter 'sendStatusReturn': could not find deserializer for type {urn:com.hp.oo.service}SendStatusResponse
at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:277)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:345)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.bt.client.testClient.main(testClient.java:44)
org.xml.sax.SAXException: Deserializing parameter 'sendStatusReturn': could not find deserializer for type {urn:com.hp.oo.service}SendStatusResponse

----------------------------
can any one help me to resolve this
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!