views:

53

answers:

2

Greetings,

i have to write a windows application in c# which 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?

A: 

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
sadly this does not work :(
xend
A: 

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