1

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?

Mark Amery
  • 143,130
  • 81
  • 406
  • 459
xend
  • 41
  • 6

3 Answers3

1

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

xend
  • 41
  • 6
1

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"

RGB
  • 51
  • 1
  • 4
0

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.

DavidGouge
  • 4,583
  • 6
  • 34
  • 46