문제

I have to write a windows application in c# which application is able to consume said webservice. I am using VS2010 with .Net 4

I added the service reference and the code compiles without any error, but when i run it i get a ProtocolException with the text:

The content type "multipart/related; type="application/xop+xml"; boundary="----=_Part_0_159582014.1283501395804"; start=""; start-info="application/soap+xml"" of the response does not match the binding (application/soap+xml; charset=utf-8)

When i try it with a VB sample provided by the developers of the webservice everything works fine.

Im totally lost here, googled since yesterday, came up with nothing... Anyone knows whats the problem there?

도움이 되었습니까?

해결책

Ok finally figured it out.

You need to manually edit the app.config file of your application and change all occurences of "textMessageEncoding" to "motmMessageEncoding" that will do the trick

다른 팁

no motmMessageEncoding -> mtomMessageEncoding

you need to make sure that your application supports MTOM. This requires a change to your app.config. More details can be found here:

http://www.tomtomwork.com/en/webfleet/connect/blog.xml - scroll down to the section "Updated Visual Basic example now uses SOAP, too"

Try adding a Web Reference rather than a Service Reference and see if that makes any difference. When you select Add Service Reference, click "Advanced..." then "Add Web Reference..." to bring up the old style reference screen.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top