aspose file tools*
The moose likes Web Services and the fly likes Problem with Java Client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Problem with Java Client" Watch "Problem with Java Client" New topic
Author

Problem with Java Client

janki rathod
Greenhorn

Joined: Oct 31, 2005
Posts: 1
I am trying to invoke a web-service that returns a String to my Java Client..
Here's the code snippet..

String endpoint = "http://203.94.240.89/webservices1.5/services/IRCTCAuthenticationService";

org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("http://webservices.irctc.com", "endUserAuthentication"));

setRequestHeaders(_call);
setAttachments(_call);
java.lang.Object _resp = _call.invoke(new java.lang.Object[] {inputXML});

This throws an error from _call.invoke, which is
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
faultSubcode:
faultString: java.lang.NullPointerException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace: java.lang.NullPointerException
at org.apache.axis.encoding.SerializationContextImpl.getTypeMapping(SerializationContextImpl.java:430)
at org.apache.axis.message.RPCParam.serialize(RPCParam.java:238)
at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:445)
at org.apache.axis.message.SOAPElementAxisImpl.output(SOAPElementAxisImpl.java:1456)
at org.apache.axis.message.SOAPBodyAxisImpl.outputImpl(SOAPBodyAxisImpl.java:156)
at org.apache.axis.message.SOAPEnvelopeAxisImpl.outputImpl(SOAPEnvelopeAxisImpl.java:588)
at org.apache.axis.message.SOAPElementAxisImpl.output(SOAPElementAxisImpl.java:1456)
at org.apache.axis.MessagePart.writeTo(MessagePart.java:276)
at org.apache.axis.MessagePart.getAsString(MessagePart.java:568)
at org.apache.axis.MessagePart.getAsBytes(MessagePart.java:424)
at org.apache.axis.Message.getContentType(Message.java:473)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:386)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:126)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:160)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:123)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:190)
at org.apache.axis.client.Call.invokeEngine(Call.java:3029)
at org.apache.axis.client.Call.invoke(Call.java:3014)
at org.apache.axis.client.Call.invoke(Call.java:2608)
at org.apache.axis.client.Call.invoke(Call.java:2513)
at org.apache.axis.client.Call.invokeInternal(Call.java:1973)
at org.apache.axis.client.Call.invoke(Call.java:1914)
at _89._72._210._210.webservices1_5.services.IRCTCAuthenticationService.IRCTCAuthenticationServiceSoapBindingStub.endUserAuthentication(IRCTCAuthenticationServiceSoapBindingStub.java:107)
at com.csam.irctc.IRCTCAuthenticationClient1.main(IRCTCAuthenticationClient1.java:21)


Please help me on this topic... tell me if i am doing something wrong.
Thanks.
Timothy Williams
Greenhorn

Joined: Nov 02, 2005
Posts: 2
_call.setSOAPActionURI("");

^^Missing out the endpoint?
janne s
Ranch Hand

Joined: Sep 21, 2004
Posts: 81
Hi! I'm also into similar kind of problem .pls help.

I'm using axis1.3

Below is the stack trace.

java.lang.NullPointerException

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.NullPointerException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at mpi.MPISoapBindingStub.queryRecord(MPISoapBindingStub.java:268)
at dhh.oph.latb.mpi.MPIClientTest.search(MPIClientTest.java:32)
at dhh.oph.latb.mpi.MPIClientTest.main(MPIClientTest.java:53)

{http://xml.apache.org/axis/}hostname : PHH-YYS

java.lang.NullPointerException
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at mpi.MPISoapBindingStub.queryRecord(MPISoapBindingStub.java:268)
at dhh.oph.latb.mpi.MPIClientTest.search(MPIClientTest.java:32)
at dhh.oph.latb.mpi.MPIClientTest.main(MPIClientTest.java:53)



Thank you.

[ November 09, 2005: Message edited by: janne s ]
[ November 09, 2005: Message edited by: janne s ]
Dharamvir (DV) Punia
Ranch Hand

Joined: Oct 04, 2004
Posts: 34
Here is a little sample:
========================

-DV
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with Java Client