0
votes

I create and tested a WCF service locally and of course it works fine. I published to a shared hosting site and browsed to the wsdl and appears to be fine. But when I make a call in WP7 code to the service I get an error with a useless error message. After enabling includeExceptionDetailInFaults and WCF tracing the error reads. "System.ServiceModel.ProtocolException: Content Type application/soap+xml; charset=utf-8 was sent to a service expecting text/xml; charset=utf-8. The client and service bindings may be mismatched."

Here are parts of the web.config ...

<behaviors>
  <serviceBehaviors>
    <behavior name="SL_SeeYaThere_WCF.Web.SeeYaThereWCFBehavior">
     <serviceMetadata httpGetEnabled="true" />
     <serviceDebug httpHelpPageEnabled ="true" includeExceptionDetailInFaults="true"  />
    </behavior>
    <!—- other services… -->
  </serviceBehaviors>
</behaviors>

<bindings>
   <basicHttpBinding>
     <!—- there is not a binding for this service should there be? -->
     <!—- other services… -->
   </basicHttpBinding>
</bindings>

< services>
< service behaviorConfiguration="SL_SeeYaThere_WCF.Web.SeeYaThereWCFBehavior" name="SL_SeeYaThere_WCF.Web.SeeYaThereWCF">
< endpoint address="" binding="basicHttpBinding" contract="SL_SeeYaThere_WCF.Web.ISeeYaThereWCF" />
< endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
< /service>
< !—- other services… -->
< /services>

^^ appoligize about the format. editor would not display markup correctly.

This is my first experience with WFC and it hasn’t been enjoyable. What am I doing wrong?

Thanks for your help.

1

1 Answers

0
votes

Ok found the problem. In the WP7 app there is a ServicesReferences.clientConfig file that has the client bindings. There were two end points for the WCF service one for Localhost and one for the shared hosted address. It must have happened when I 'configure service reference' from the local host to shared host site.

I changed the local host adderss to shared hosted addresss and it works.