I have found that when the xml message inside the soap:body has the xml declaration that it throws this error
Code:
HTTP/ASMX Message Receive Failure: System.Xml.XmlException: Unexpected XML declaration. The XML declaration must be the first node in the document, and no white space characters are allowed to appear before it. Line 1, position 951.
However, If i remove the xml declaration inside the soap:body this is what is returned
Code:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<wsa:Action>http://schemas.xmlsoap.org/ws/2004/03/addressing/fault</wsa:Action>
<wsa:MessageID>uuid:ae568a6b-172f-4379-b62f-c48cc72dac9e</wsa:MessageID>
<wsa:RelatesTo>uuid:e39ef88e-5256-4080-bec0-4271cb443606</wsa:RelatesTo>
<wsa:To>http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous</wsa:To>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-73fa896a-2ed9-472d-9e97-476076d1174a">
<wsu:Created>2008-07-11T14:53:45Z</wsu:Created>
<wsu:Expires>2008-07-11T14:58:45Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>The message is not a valid XML message</faultstring>
<faultactor>https://ws.fastraxonline.com/FastraxRequest/FastraxNetwork.asmx</faultactor>
</soap:Fault>
</soap:Body>
</soap:Envelope>
I have tried enclosing the entire xmlmessage node inside the soap:body in CDATA, as well as the just the xmlmessage node's xml declaration and that did not work.
Does anyone know what I have to do to get this to work? The webservice I am trying to consume is written in C# and unfortunately the server that this site is on does not have asp.net enabled on it so I can not use C# to consume the webservice and need to find a way to consume the webservice.