Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Error while running client code on axis webservice  RSS feed

 
venkatesh pendharkar
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI all,
I am using apche axis on Jboss 4.1. I have created a jws file called Calculator.jws in which i have writted a simple method as follows:
public Integer testing(Integer s) {
return s;
}

When I call this method using my client as follows:-
public class CalcClient {
public static void main(String[] args) throws Exception{
String endPoint = "http://localhost:8081/axis/Calculator.jws";
Integer i1 = new Integer(1);
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endPoint));
call.setOperationName("testing");
call.addParameter("op1",XMLType.XSD_INTEGER, ParameterMode.IN);
call.setReturnType( XMLType.XSD_INTEGER );
Integer ret = (Integer) call.invoke( new Object [] {i1});
System.out.println("Got result : " + ret);
}
}

when i run this code, i get following exception:-


- Exception:
org.xml.sax.SAXException: Bad types (int -> class java.math.BigInteger)
at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:286)
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:236)
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 CalcClient.main(CalcClient.java:32)
Exception in thread "main" AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXException: Bad types (int -> class java.math.BigInteger)
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: Bad types (int -> class java.math.BigInteger)
at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:286)
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:236)
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 CalcClient.main(CalcClient.java:32)

{http://xml.apache.org/axis/}hostname:redDevil

org.xml.sax.SAXException: Bad types (int -> class java.math.BigInteger)
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.client.Call.invoke(Call.java:2470)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at CalcClient.main(CalcClient.java:32)
Caused by: org.xml.sax.SAXException: Bad types (int -> class java.math.BigInteger)
at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:286)
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:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
... 3 more

Can anyone help me in this???
 
Manhar Puri
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just googled your error message and found this forum

mail-archives.apache.org
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!