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 Indrasish N Basuroychowdhury <in...@fanniemae.com> on 2002/05/22 16:24:45 UTC
SOAP error. Need urgent help.
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.