Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating Web Services With Apache Axis with more than One Argument

 
Sabbir Manandhar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have created a web service in intellijIdea. I have a function in server as

@WebMethod
public int sum(Integer x, Integer y){
System.out.println("summing...");
return x + y;
}


when i call the function from client, the parameter x is ok, but y becomes null, hence exception is thrown at client.

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.NullPointerException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:NET

java.lang.NullPointerException
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
....................



the service call is alright for the services with single argument as for:

@WebMethod
public Test setTest(String name){
Test test = new Test();
test.setName(name);

return test;
}

and
@WebMethod
public String showNumber(int num){
return new String(num + "");
}

Any suggestions where i am gone wrong?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic