System.FormatException : WSE839: An HTTP response was received that used
the following content type: text/xml; charset=utf-8. The following
content type was expected: multipart/related; type=application/xop+xml.
I'm not able to interpret the error. Has anyone an idea?
*** Sent via Developersdex http://www.developersdex.com ***
I think your service is set to use MTOM encoding (MTOM is set to Always)
while the client is set to Optional. Since it is the client that makes the
first request it does not optionally turns on the MTOM encoding but your
service method requires it. You can programatically set MTOM enconding to On
when you call this particular method.
Look here:
http://www.ftponline.com/vsm/2006_05/magazine/columns/gettingstarted
HTH,
--
Martin Kulov
http://www.codeattest.com/blogs/martin
MVP, MCT, MCSD, MCPD
NOTE:We can use some wrapper classes to convert the response.could you please the wrapper class.
Thanks,
Patro
Posted via DevelopmentNow.com Groups
http://www.developmentnow.com/g/
using System.Net;
class MyNewWebServiceProxy : MyWSE3GeneratedProxyClass
{
protected override WebResponse GetWebResponse(WebRequest request)
{
WebResponse response = base.GetWebResponse(request);
// if the response is non-MTOM like a SOAP fault, tell the proxy
// we don't really need MTOM
if (response.Headers[HttpResponseHeader.ContentType].ToLower().StartsWith("text/xml"))
{
this.RequireMtom = false;
}
return response;
}
}
The gotcha is you need to remember to reset the RequireMtom on the proxy before making another call on the same instance back to true if the method needs MTOM.
From http://www.developmentnow.com/g/28_2009_2_0_0_774961/Need-help-for-WSE-3-0-exception-WSE839.htm