silverlight - Exposing a webHttpBinding WCF service to mobile clients -


I have created a very basic service operation, which needs to be written in my database. Looks like:

ImyService is defined as defined here:

  [ServiceContract] Public Interface ImyService {[Operation Contract] [WebInvoke (BodyStyle = WebMessageBodyStyle.Wrapped)] MyServiceResult MyMethod (string P1, string P2); }  

This service will be exposed to both WP7 and iPhone client applications. Because of this, I believe that I need to use the WebHttp binding I have my web The following settings have been used in the config file:

  & lt; System.serviceModel & gt; & Lt; Behavior & gt; & Lt; Endpoint beehaviors & gt; & Lt; Transaction name = "myServiceBehavior" & gt; & Lt; WebHttp / & gt; & Lt; / Behavior & gt; & Lt; / EndpointBehaviors & gt; & Lt; ServiceBehaviors & gt; & Lt; Transaction name = "" & 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 ASPnet Compatibility Enabled = "True" Multiple SiteBindingsEnabled = "true" /> & Lt; Services & gt; & Lt; Service name = "myservice" & gt; & Lt; Endpoint address = "behavior" configuration = "myServiceBehavior" binding = "webHTPbinding" contract = "IMSI service" /> & Lt; / Services & gt; & Lt; / Services & gt; & Lt; /system.serviceModel>  

Both services and WP7 apps are part of the same solution. I can successfully add a reference to the service in my application when I run the application, the page throws an error in the context of the service saying the error:

In the ServiceModel client configuration section, click 'MyServiceProxy ImyService 'reference contract can not be referenced. This can happen because no configuration file is found for your application, or any end point element matching this agreement can not be found in the client element.

What am I doing? It just seems that it should be a very simple thing. Thanks for your help.

Have you copied "ServiceReferences.ClientConfig" into "Windows 7 Service" project? This file is in your WCF project. Besides, WP7 clients only support basicHttpBinding, therefore, you can see the empty "ServiceReferences.ClientConfig" file until you switch to the original HttpBinding


Comments