axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anne Thomas Manes <atma...@gmail.com>
Subject Re: Axis version help. (pls ignore my previous mail)
Date Mon, 02 Jan 2006 21:57:41 GMT
Can you trace the input messages? Are they the same?
It appears that the client is failing on a returned fault mesage.

On 1/2/06, Gurunathan, Selvapandian (Cognizant) <
Selvapandian.Gurunathan@cognizant.com> wrote:
>
>
> Hi,
> I want to invoke a web service running in a remote location and it is
> written in Apache SOAP.
>
> Please find attached the sample java application written in axis version
> 1.1 that I use to invoke the web service.
> This is working fine and I am able to get a response from the target
> machine.
>
> When I use axis 1.2 or later I am unable to invoke the same web service.
>
> I always get a NullPointer exception.
> Please find attached the Axis 1.3 code and the exception.
>
> It would be a great help if someone throw a light on this issue.
>
> Axis 1.1 code
> ---------------
>
> import java.io.ByteArrayInputStream;
> import java.io.InputStream;
> import java.net.URL;
> import java.util.Vector;
> import org.apache.axis.client.Call;
> import org.apache.axis.client.Service;
> import org.apache.axis.message.SOAPBodyElement;
> import org.apache.axis.utils.XMLUtils;
> import org.apache.xerces.parsers.DOMParser;
> import org.w3c.dom.Document;
> import org.xml.sax.InputSource;
>
> public class Axis1Client {
>
> public static void main(String shr[]) throws Exception
> {
> String content = "<<XML content>>";
> String serverURL = "http://<<TARGET IP>>/emf1/servlet/messagerouter";
> String encodeType = "UTF-8";
> int timeOut = 5;
>
> InputStream inputStr = new ByteArrayInputStream(content.getBytes());
> InputSource inputSource = new InputSource(inputStr);
> inputSource.setEncoding(encodeType);
>
> DOMParser parser = new DOMParser();
> parser.parse(inputSource);
> Document request = parser.getDocument();
>
> Service service = new Service();
> Call call = (Call) service.createCall();
> call.setTargetEndpointAddress(new URL(serverURL));
> Vector result = (Vector) call.invoke(new Object[]
> {
>         new SOAPBodyElement(request.getDocumentElement())});
>         SOAPBodyElement sbe = (SOAPBodyElement) result.get(0);
>         Document response = sbe.getAsDocument();
>         System.out.println("response  " +
> XMLUtils.DocumentToString(response));
>
> }
> }
>
>
> Axis 1.3 program
> ----------------
> String endPoint = "http://<<IP>>/emf1/servlet/messagerouter";
> String ngRequest = "<<XML>>";
> String operationName = "getMatch";
>
> Service service = new Service();
> Call call = (Call) service.createCall();
>
> call.setTargetEndpointAddress(endPoint);
> call.setOperationName(operationName);
> call.invoke(new Object[] { ngRequest });
>
> Exception
> ---------
> AxisFault
> faultCode:
> faultSubcode:
> faultString: java.lang.NullPointerException
> faultActor: /emf1/servlet/messagerouter
> faultNode:
> faultDetail:
>
> {http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
>         at
> org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.ja
> va:221)
>         at
> org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.jav
> a:128)
>         at
> org.apache.axis.encoding.DeserializationContext.endElement(Deserializati
> onContext.java:1087)
>         at
> oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParse
> r.java:1120)
>         at
> oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingP
> arser.java:293)
>         at
> oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingPars
> er.java:260)
>         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:149)
>         at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
>         at
> org.apache.axis.encoding.DeserializationContext.parse(DeserializationCon
> text.java:227)
>         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
>         at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
>         at
> org.mule.providers.soap.axis.extensions.MuleHttpSender.readFromSocket(Mu
> leHttpSender.java:737)
>         at
> org.mule.providers.soap.axis.extensions.MuleHttpSender.invoke(MuleHttpSe
> nder.java:158)
>         at
> org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.j
> ava:32)
>         at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
>         at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
>         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
>         at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
>         at org.apache.axis.client.Call.invoke(Call.java:2748)
>         at org.apache.axis.client.Call.invoke(Call.java:2424)
>         at org.apache.axis.client.Call.invoke(Call.java:2347)
>         at org.apache.axis.client.Call.invoke(Call.java:1804)
>         at
> org.mule.providers.soap.axis.AxisMessageDispatcher.doSend(AxisMessageDis
> patcher.java:222)
>         at
> org.mule.providers.AbstractMessageDispatcher.send(AbstractMessageDispatc
> her.java:169)
>         at org.mule.impl.MuleSession.sendEvent(MuleSession.java:193)
>         at org.mule.extras.client.MuleClient.send(MuleClient.java:596)
>         at org.mule.extras.client.MuleClient.send(MuleClient.java:570)
>         at org.mule.extras.client.MuleClient.send(MuleClient.java:525)
>         at AxisMuleClient.main(AxisMuleClient.java:54)
>
>         {http://xml.apache.org/axis/}hostname:PCIIB07658
>
> java.lang.NullPointerException
>         at
> org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.ja
> va:221)
>         at
> org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.jav
> a:128)
>         at
> org.apache.axis.encoding.DeserializationContext.endElement(Deserializati
> onContext.java:1087)
>         at
> oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParse
> r.java:1120)
>         at
> oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingP
> arser.java:293)
>         at
> oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingPars
> er.java:260)
>         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:149)
>         at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
>         at
> org.apache.axis.encoding.DeserializationContext.parse(DeserializationCon
> text.java:227)
>         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
>         at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
>         at
> org.mule.providers.soap.axis.extensions.MuleHttpSender.readFromSocket(Mu
> leHttpSender.java:737)
>         at
> org.mule.providers.soap.axis.extensions.MuleHttpSender.invoke(MuleHttpSe
> nder.java:158)
>         at
> org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.j
> ava:32)
>         at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
>         at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
>         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
>         at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
>         at org.apache.axis.client.Call.invoke(Call.java:2748)
>         at org.apache.axis.client.Call.invoke(Call.java:2424)
>         at org.apache.axis.client.Call.invoke(Call.java:2347)
>         at org.apache.axis.client.Call.invoke(Call.java:1804)
>         at
> org.mule.providers.soap.axis.AxisMessageDispatcher.doSend(AxisMessageDis
> patcher.java:222)
>         at
> org.mule.providers.AbstractMessageDispatcher.send(AbstractMessageDispatc
> her.java:169)21
>         at org.mule.impl.MuleSession.sendEvent(MuleSession.java:193)
>         at org.mule.extras.client.MuleClient.send(MuleClient.java:596)
>         at org.mule.extras.client.MuleClient.send(MuleClient.java:570)
>         at org.mule.extras.client.MuleClient.send(MuleClient.java:525)
>         at AxisMuleClient.main(AxisMuleClient.java:54)
> java.lang.NullPointerException
>         at AxisMuleClient.main(AxisMuleClient.java:56)
> Thanks & Regards,
> Selva.
>
>
> This e-mail and any files transmitted with it are for the sole use of the
> intended recipient(s) and may contain confidential and privileged
> information.
> If you are not the intended recipient, please contact the sender by reply
> e-mail and destroy all copies of the original message.
> Any unauthorised review, use, disclosure, dissemination, forwarding,
> printing or copying of this email or any action taken in reliance on this
> e-mail is strictly
> prohibited and may be unlawful.
>
>   Visit us at http://www.cognizant.com
>

Mime
View raw message