Question

My WCF service web.config.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <connectionStrings>
    <add name="ZesdaagseResultsContext" connectionString="Data Source=194.33.112.88\partywhere;Initial Catalog=ZesdaagseResults;Persist Security Info=True;User ID=*********;Password=******************/;MultipleActiveResultSets=True"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.serviceModel>
    <services>
      <service name="WcfOpzet.MobileService" behaviorConfiguration="MexBehavior">
        <endpoint binding="webHttpBinding" contract="WcfOpzet.IMobileService" behaviorConfiguration="webHttpBehavior" />
        <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="MexBehavior">
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="webHttpBehavior">
          <webHttp />
        </behavior>
      </endpointBehaviors>
    </behaviors>
  </system.serviceModel>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
  </startup>
  <system.web>
    <compilation debug="true" />
  </system.web>
</configuration>

My wcf client MobileServiceReference.ClientConfig.

<configuration>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="webHttpBinding"
                 maxBufferSize="2147483647"
                 maxReceivedMessageSize="2147483647">
          <security mode="None" />
        </binding>       
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://zesdaagse.mobi-app.be/WCFUrl/MobileService.svc"
                binding="basicHttpBinding"
                bindingConfiguration="webHttpBinding"
                contract="MobileService.IMobileService"
                name="webHttpBinding"

                />
    </client>
    <!--<behaviors>
      <endpointBehaviors>
        <behavior name="webHttpBehavior">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
    </behaviors>-->
  </system.serviceModel>
</configuration>

My Error when I run my Windows Phone Application.

There was no endpoint listening at http://zesdaagse.mobi-app.be/WCFUrl/MobileService.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

Explanation

I searched but I don't get it fixed. There is something wrong with my endpoints but I don't know what.

Was it helpful?

Solution

Ah, now I see it You are using the basicHttpBinding in your client and the webHttpBinding (REST) in your service... That's probably the reason why it's not working, no?

Extra FYI: I tried to call your service myself and now I get a 405, which probably means you didn't specify the [WebGet] or [WebInvoke] attributes to your service operations.

With the following client side config, you should be able to call your service (after attributing your operations with WebGet)

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
  <system.serviceModel>
    <bindings>
      <webHttpBinding>
        <binding name="webHttpBinding"
                 maxBufferSize="2147483647"
                 maxReceivedMessageSize="2147483647">
          <security mode="None" />
        </binding>
      </webHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://zesdaagse.mobi-app.be/WCFUrl/MobileService.svc"
                binding="webHttpBinding"
                bindingConfiguration="webHttpBinding"
                contract="MobileService.IMobileService"
                name="webHttpBinding"
                behaviorConfiguration="webHttpBehavior"
                />
    </client>
    <behaviors>
      <endpointBehaviors>
        <behavior name="webHttpBehavior">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top