Search code examples
wcfcassini

Access WCF Service from another pc


I've spend hours and hours on this and simply can't get it to work. Maybe my understanding of hosting WCF service and creating a client for it isn't correct.

My website has a WCF Service added to it, with the following config...

<system.serviceModel>

<bindings>
  <wsHttpBinding>
    <binding name="Binding1">
      <security mode="None">
        <transport clientCredentialType="None" />
        <message establishSecurityContext="false" />
      </security>
    </binding>
  </wsHttpBinding>
</bindings>

    <behaviors>
        <serviceBehaviors>
            <behavior name="MyWCFWebApp.Service1Behavior">
                <serviceMetadata httpGetEnabled="true"/>
                <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>

    <services>
        <service behaviorConfiguration="MyWCFWebApp.Service1Behavior" name="MyWCFWebApp.Service1">
            <endpoint address="" binding="wsHttpBinding" contract="MyWCFWebApp.IService1" bindingConfiguration="Binding1">
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
        </service>
    </services>

</system.serviceModel>

When I run the website through Visual Studio using build in web server, I can access the webservice through http://localhost:9988/Service1.svc

but...

When hosting the web site through cassiniDev Server, binding to ip and hostname, I can access the wcf service through http://localhost:9988/Service1.svc, but as soon as I try to access the wcf service using ip or hostname http://10.111.202.73:9988/Service1.svc, it returns the following error:

"No protocol binding matches the given address 'http://10.111.202.73:9988/Service1.svc'. Protocol bindings are configured at the Site level in IIS or WAS configuration."

I have no idea why this is happening. Any ideas?


Solution

  • So it turns out the issue was related to cassinidev webservice, which doesn't support WCF 3.5.... Took me a while to figure that one out...