You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by "Tolsch, Ed" <Ed...@fmr.com> on 2002/05/22 15:30:00 UTC
Need help/advice with Soap Faults
I'm using Apache Soap 2.2.
I'm trying to capture some detailed information in my implementation class
to be used in the detail section of the SOAP Fault.
I've create a MyOwnFault class which I'm throwing from the implementation
class. It doesn't seem that I can catch it in the rpcrouter try / catch
block.
Do I need to register a Fault Listener in my deployment descriptor? If so,
how does the implementation class use that as well as the rpcrouter servlet?
Any insight/advice would be greatly appreciated. Thanks in advance.
SOAP error. Need urgent help.
Posted by Indrasish N Basuroychowdhury <in...@fanniemae.com>.
I am getting a SOAP error after sending the following SOAP envelope. Need help
desparately. Any help will be appreciated.
<SOAP-ENV:Body>
<ReturnService xmlns="http://localhost/FirstTry/WebServices/">
<ah><Username>User</Username><Password>Pass</Password></ah>
</ReturnService>
</SOAP-ENV:Body>
SOAP error is following:
Env:[Attributes={ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"}] [Header=null]
[Body=[Attributes={}] [BodyEntries=]] [EnvelopeEntries=]
SOAP Message:<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>System.Web.Services.Protocols.SoapException: Server was
unable to process request. ---> System.Exception: There was an error
generating the XML document. ---> System.Exception: The type
fanniemae.TestArray.ReturnObj was not expected. Use the XmlInclude or
SoapInclude attribute to specify types that are not known statically.
at System.Xml.Serialization.XmlSerializationWriter.WriteTypedPrimitive(String
name, String ns, Object o, Boolean xsiType)
at
n2499d7d93ffa468fbd8861780677ee41.XmlSerializationWriter1.Write2_Object(String
n, String ns, Object o, Boolean isNullable, Boolean needType)
at
n2499d7d93ffa468fbd8861780677ee41.XmlSerializationWriter1.Write4_ReturnServiceResponse(Object[]
p)
at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter,
Object o, XmlSerializerNamespaces namespaces)
at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter,
Object o)
at System.Web.Services.Protocols.SoapServerProtocol.WriteReturns(Object[]
returnValues, Stream outputStream)
at System.Web.Services.Protocols.WebServiceHandler.WriteReturns(Object[]
returnValues)
at System.Web.Services.Protocols.WebServiceHandler.Invoke()
at
System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>
The http requst and response is following:
The following is a sample SOAP request and response. The placeholders shown need
to be replaced with actual values.
POST /FirstTry/WebServices/Array/TestArray.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://localhost/FirstTry/WebServices/ReturnService"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ReturnService xmlns="http://localhost/FirstTry/WebServices/">
<ao>
<ArrayObj>
<Username>string</Username>
<Password>string</Password>
</ArrayObj>
<ArrayObj>
<Username>string</Username>
<Password>string</Password>
</ArrayObj>
</ao>
</ReturnService>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ReturnServiceResponse xmlns="http://localhost/FirstTry/WebServices/">
<ReturnServiceResult>
<Object />
<Object />
</ReturnServiceResult>
</ReturnServiceResponse>
</soap:Body>
</soap:Envelope>
Thanks,
Indrasish.
SOAP error. Need urgent help.
Posted by Indrasish N Basuroychowdhury <in...@fanniemae.com>.
I am getting a SOAP error after sending the following SOAP envelope. Need help
desparately. Any help will be appreciated.
<SOAP-ENV:Body>
<ReturnService xmlns="http://localhost/FirstTry/WebServices/">
<ah><Username>User</Username><Password>Pass</Password></ah>
</ReturnService>
</SOAP-ENV:Body>
SOAP error is following:
Env:[Attributes={ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"}] [Header=null]
[Body=[Attributes={}] [BodyEntries=]] [EnvelopeEntries=]
SOAP Message:<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>System.Web.Services.Protocols.SoapException: Server was
unable to process request. ---> System.Exception: There was an error
generating the XML document. ---> System.Exception: The type
fanniemae.TestArray.ReturnObj was not expected. Use the XmlInclude or
SoapInclude attribute to specify types that are not known statically.
at System.Xml.Serialization.XmlSerializationWriter.WriteTypedPrimitive(String
name, String ns, Object o, Boolean xsiType)
at
n2499d7d93ffa468fbd8861780677ee41.XmlSerializationWriter1.Write2_Object(String
n, String ns, Object o, Boolean isNullable, Boolean needType)
at
n2499d7d93ffa468fbd8861780677ee41.XmlSerializationWriter1.Write4_ReturnServiceResponse(Object[]
p)
at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter,
Object o, XmlSerializerNamespaces namespaces)
at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter,
Object o)
at System.Web.Services.Protocols.SoapServerProtocol.WriteReturns(Object[]
returnValues, Stream outputStream)
at System.Web.Services.Protocols.WebServiceHandler.WriteReturns(Object[]
returnValues)
at System.Web.Services.Protocols.WebServiceHandler.Invoke()
at
System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>
The http requst and response is following:
The following is a sample SOAP request and response. The placeholders shown need
to be replaced with actual values.
POST /FirstTry/WebServices/Array/TestArray.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://localhost/FirstTry/WebServices/ReturnService"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ReturnService xmlns="http://localhost/FirstTry/WebServices/">
<ao>
<ArrayObj>
<Username>string</Username>
<Password>string</Password>
</ArrayObj>
<ArrayObj>
<Username>string</Username>
<Password>string</Password>
</ArrayObj>
</ao>
</ReturnService>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ReturnServiceResponse xmlns="http://localhost/FirstTry/WebServices/">
<ReturnServiceResult>
<Object />
<Object />
</ReturnServiceResult>
</ReturnServiceResponse>
</soap:Body>
</soap:Envelope>
Thanks,
Indrasish.