The winform client obtains data through the Web Service (wse3.0 is used and MTOM is enabled) and occasionally receives the following message: "The request failed due to HTTP status 400: Bad request. "Error returned,
At the same time, the following errors are found in the server Event Log:
HTTP/asmx message receive failure: system. xml. xmlexception: the data at the root level is invalid. Row 2, position 1.
In system. xml. xmltextreaderimpl. Throw (exception E)
In system. xml. xmltextreaderimpl. Throw (string res, string Arg)
In system. xml. xmltextreaderimpl. Throw (string res)
In system. xml. xmltextreaderimpl. parserootlevelwhitespace ()
In system. xml. xmltextreaderimpl. parsedocumentcontent ()
In system. xml. xmltextreaderimpl. Read ()
In system. xml. xmltextreader. Read ()
In Microsoft. Web. services3.xml. xmlskipdtdreader. Read ()
In system. xml. xmlloader. Load (xmldocument doc, xmlreader reader, Boolean preservewhitespace)
In system. xml. xmldocument. Load (xmlreader reader)
In Microsoft. Web. services3.soapenvelope. Load (Stream instream)
In Microsoft. Web. services3.wseprotocol. createrequestsoapenvelope (soapservermessage message)
In Microsoft. Web. services3.wseprotocol. getrequestenvelopefrommessage (soapservermessage message)
After searching for a long time, I don't know what the problem is. It is estimated that MTOM is enabled. I don't know who has encountered this problem. Let's take a look.
My wse3.0 Configuration:
<Microsoft. Web. services3>
<Messaging>
<MTOM clientmode = "on" servermode = "optional"/>
</Messaging>
<Security>
<Securitytokenmanager>
<Add type = "torchusernametokenmanager" namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" localname = "userNameToken"/>
</Securitytokenmanager>
</Security>
<Policy filename = "wse3policycache. config"/>
</Microsoft. Web. services3>