Click here to Skip to main content
15,916,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When i post my xml to web service i got this exception.

There is a problem with the XML that was received from the network. See inner exception for more details.

And the inner exception of the error was "the data at the root level is invalid. line 1 position".

And the xml i sent like was this

XML
POST "xxxxx"
MIME-Version: xx
Content-Type: xxx
VsDebuggerCausalityData: xxxx
SOAPAction: "xxx"
Host: xxxx
Expect: xxx
Accept-Encoding: xxx
Connection: Keep-Alive
Content-Length: 178101

Content-ID: xxxx
Content-Transfer-Encoding: xxx
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"

<s:Envelope xmlns:s="xxxx">
  <s:Body xmlns:xsi="xxxxx" xmlns:xsd="xxxx">
    <Vehicle xmlns="xxxx">
      <document xsi:type="xxxxx">
        <documentMetadata>
          <documentName>xxxx</documentName>
        </documentMetadata>
        <content>
          <theContentType>application/pdf</theContentType>
          <theBinData>
            <xop:Include href="xxx" xmlns:xop="xxx"/>
          </theBinData>
          <theBinLength>242452542</theBinLength>
        </content>
      </document>
      <eventNotification>
        <eventType>xxxx</eventType>
        <claimNumber>4524245</claimNumber>
        <vehicleNumber>452</vehicleNumber>
      </eventNotification>
    </Vehicle>
  </s:Body>
</s:Envelope>

Content-ID: <34547878>
Content-Transfer-Encoding: binary
Content-Type: application/octet-stream

%PDF-1.4
%äüöß
2 0 obj



The response i get was


XML
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsd="sdfsdf" xmlns:dpconfig="sdf" xmlns:dpquery="sdf" xmlns:local="sdf" xmlns:mgmt="sdf" xmlns:soap="sdfsdf">
  <soap:Body>
    <soap:Fault>
      <faultcode/>
      <faultstring>Rejected by policy.</faultstring>
      <faultactor>WebServiceGateway</faultactor>
      <detail>Generic Fault</detail>
    </soap:Fault>
  </soap:Body>
</soap:Envelope>



Thanks
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900