You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Hitesh Seth <hi...@SeraNova.com> on 2000/08/22 04:11:56 UTC
Error while Call a Soap Service
Greetings
Environment: Apache SOAP 2.0, JRun 3.0, Windows 2000, Xerces/J 1.1.3
I have been able to use the web based deploy/list/un-deploy administration
to deploy a simple JavaScript based SOAP Service. However, whenever I am
trying to call the service I am getting an error like .. (this seems to
happen
with any service).
org.xml.sax.SAXParseException: The markup in the document preceding the root
ele
ment must be well-formed.
at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:969)
at
org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XM
LDocumentScanner.java:625)
at
org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatcher.disp
atch(XMLDocumentScanner.java:804)
at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
canner.java:380)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:861)
at
org.apache.soap.util.xml.XercesParserLiaison.read(XercesParserLiaison
.java:85)
at org.apache.soap.rpc.Call.invoke(Call.java:157)
at HelloClient.main(HelloClient.java:12)
Exception in thread "main" [SOAPException: faultCode=SOAP-ENV:Protocol;
msg=java
.lang.NullPointerException
at
org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.
java, Compiled Code)
BTW, here is the client side program
import java.net.*;
import java.util.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.*;
import org.apache.soap.rpc.*;
public class HelloClient {
public static void main(String[] args) throws Exception {
Call call = new Call ();
call.setTargetObjectURI ("urn:xml-soap-hello");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
call.setMethodName ("sayHello");
Response resp = call.invoke (new
URL("http://localhost/soap/servlet/rpcrouter"),"");
if (resp.generatedFault ()) {
Fault fault = resp.getFault ();
System.out.println ("Ouch, the call failed: ");
System.out.println (" Fault Code = " + fault.getFaultCode ());
System.out.println (" Fault String = " + fault.getFaultString ());
} else {
Parameter result = resp.getReturnValue();
System.out.println(result.getValue());
}
}
}
Any help would be appreciated.
BTW, is their an archive of this mailing list available? - Thanks
Thanks
Best Regards
Hitesh.
Re: Error while Call a Soap Service
Posted by Cory Isaacson <ci...@capita2.com>.
I had a similar problem, and it could be the version of the Servlet API you
are using. SOAP 2.0 requires Servlet 2.2.
Cory
----- Original Message -----
From: "Hitesh Seth" <hi...@SeraNova.com>
To: <so...@xml.apache.org>
Sent: Monday, August 21, 2000 10:11 PM
Subject: Error while Call a Soap Service
> Greetings
>
> Environment: Apache SOAP 2.0, JRun 3.0, Windows 2000, Xerces/J 1.1.3
>
> I have been able to use the web based deploy/list/un-deploy administration
> to deploy a simple JavaScript based SOAP Service. However, whenever I am
> trying to call the service I am getting an error like .. (this seems to
> happen
> with any service).
>
> org.xml.sax.SAXParseException: The markup in the document preceding the
root
> ele
> ment must be well-formed.
> at
> org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:969)
>
> at
> org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XM
> LDocumentScanner.java:625)
> at
> org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatcher.disp
> atch(XMLDocumentScanner.java:804)
> at
> org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
> canner.java:380)
> at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:861)
> at
> org.apache.soap.util.xml.XercesParserLiaison.read(XercesParserLiaison
> .java:85)
> at org.apache.soap.rpc.Call.invoke(Call.java:157)
> at HelloClient.main(HelloClient.java:12)
> Exception in thread "main" [SOAPException: faultCode=SOAP-ENV:Protocol;
> msg=java
> .lang.NullPointerException
> at
> org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.
> java, Compiled Code)
>
> BTW, here is the client side program
>
> import java.net.*;
> import java.util.*;
> import org.apache.soap.util.xml.*;
> import org.apache.soap.*;
> import org.apache.soap.rpc.*;
> public class HelloClient {
> public static void main(String[] args) throws Exception {
> Call call = new Call ();
> call.setTargetObjectURI ("urn:xml-soap-hello");
> call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> call.setMethodName ("sayHello");
> Response resp = call.invoke (new
> URL("http://localhost/soap/servlet/rpcrouter"),"");
> if (resp.generatedFault ()) {
> Fault fault = resp.getFault ();
> System.out.println ("Ouch, the call failed: ");
> System.out.println (" Fault Code = " + fault.getFaultCode ());
> System.out.println (" Fault String = " + fault.getFaultString ());
> } else {
> Parameter result = resp.getReturnValue();
> System.out.println(result.getValue());
> }
> }
> }
>
> Any help would be appreciated.
>
> BTW, is their an archive of this mailing list available? - Thanks
>
> Thanks
>
> Best Regards
>
> Hitesh.
>
Re: Error while Call a Soap Service
Posted by Cory Isaacson <ci...@capita2.com>.
I had a similar problem, and it could be the version of the Servlet API you
are using. SOAP 2.0 requires Servlet 2.2.
Cory
----- Original Message -----
From: "Hitesh Seth" <hi...@SeraNova.com>
To: <so...@xml.apache.org>
Sent: Monday, August 21, 2000 10:11 PM
Subject: Error while Call a Soap Service
> Greetings
>
> Environment: Apache SOAP 2.0, JRun 3.0, Windows 2000, Xerces/J 1.1.3
>
> I have been able to use the web based deploy/list/un-deploy administration
> to deploy a simple JavaScript based SOAP Service. However, whenever I am
> trying to call the service I am getting an error like .. (this seems to
> happen
> with any service).
>
> org.xml.sax.SAXParseException: The markup in the document preceding the
root
> ele
> ment must be well-formed.
> at
> org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:969)
>
> at
> org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XM
> LDocumentScanner.java:625)
> at
> org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatcher.disp
> atch(XMLDocumentScanner.java:804)
> at
> org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
> canner.java:380)
> at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:861)
> at
> org.apache.soap.util.xml.XercesParserLiaison.read(XercesParserLiaison
> .java:85)
> at org.apache.soap.rpc.Call.invoke(Call.java:157)
> at HelloClient.main(HelloClient.java:12)
> Exception in thread "main" [SOAPException: faultCode=SOAP-ENV:Protocol;
> msg=java
> .lang.NullPointerException
> at
> org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.
> java, Compiled Code)
>
> BTW, here is the client side program
>
> import java.net.*;
> import java.util.*;
> import org.apache.soap.util.xml.*;
> import org.apache.soap.*;
> import org.apache.soap.rpc.*;
> public class HelloClient {
> public static void main(String[] args) throws Exception {
> Call call = new Call ();
> call.setTargetObjectURI ("urn:xml-soap-hello");
> call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> call.setMethodName ("sayHello");
> Response resp = call.invoke (new
> URL("http://localhost/soap/servlet/rpcrouter"),"");
> if (resp.generatedFault ()) {
> Fault fault = resp.getFault ();
> System.out.println ("Ouch, the call failed: ");
> System.out.println (" Fault Code = " + fault.getFaultCode ());
> System.out.println (" Fault String = " + fault.getFaultString ());
> } else {
> Parameter result = resp.getReturnValue();
> System.out.println(result.getValue());
> }
> }
> }
>
> Any help would be appreciated.
>
> BTW, is their an archive of this mailing list available? - Thanks
>
> Thanks
>
> Best Regards
>
> Hitesh.
>