Error consuming webservice, content type “application/xop+xml” does not match expected type “text/xml”

前端 未结 7 1863
我在风中等你
我在风中等你 2020-11-30 03:16

I\'m having a weird issue when consuming a webservice for a product that my company has bought. The product is called Campaign Commander and it\'s made by a company called

7条回答
  •  青春惊慌失措
    2020-11-30 03:41

    If you're self-hosting a WCF service and you're consuming the service with a WCF client. You must remember to set the MessageEncoding property in the host like this:

    BasicHttpBinding binding = new BasicHttpBinding();
    binding.MessageEncoding = WSMessageEncoding.Mtom;
    

    I ran into this problem as well. My client kept throwing this Exception on start up and I couldn't figure out why until I realized that I forgot to set my bindings MessageEncoding property in the host application.

提交回复
热议问题