开发者

c# client application can't consume tomtom connect webservice

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开发者_如何学JAVA 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜