.net - Silverlight+WCF exception: Expecting application/soap+xml, received text/xml -


I have a Silverlight application in which I would like to call a WCF service. When calling a service, I get the following response from the server:

415 can not process the message because the content type 'text / xml; Charset = utf-8 'expected type' application / soap + xml was not; Charset = utf-8

Has anyone experienced this problem before? Does anyone know what configuration settings do I need to adjust? Any information about deciding on this will be appreciated.

OK, do you compare the "Silverlight-enabled WCF service" template in VS2008, and the difference? I hope you need to use the basicHttpBinding and are using some more foreign.

For information, here is the web.config section for a default Silverlight / WCF service:

  & lt; System.serviceModel & gt; & Lt; Behavior & gt; & Lt; ServiceBehaviors & gt; & Lt; Behavior name = "MySite.Service1Behavior" & gt; & Lt; ServiceMetadata httpGetEnabled = "true" /> & Lt; The services included in the debugging include exceptions = DishialInstine = "false" /> & Lt; / Behavior & gt; & Lt; / ServiceBehaviors & gt; & Lt; / Behavior & gt; & Lt; Service hosting environment aspNetCompatibilityEnabled = "true" /> & Lt; Services & gt; & Lt; Service transaction support = "MySite.Service1Behavior" name = "MySite.Service1" & gt; & Lt; Endpoint address = "" binding = "basic HttpBinding" contract = "MySite.Service1" /> & Lt; Endpoint address = "Max" binding = "MaxHtpindex" contract = "IMAXADEXXchange" /> & Lt; / Services & gt; & Lt; / Services & gt; & Lt; /system.serviceModel>  

Comments