WCF help, how can I expose a service over http, that calls another service over net.tcp?

Posted by Hcabnettek on Stack Overflow See other posts from Stack Overflow or by Hcabnettek
Published on 2010-06-01T19:00:06Z Indexed on 2010/06/01 19:03 UTC
Read the original article Hit count: 584

Hi All,
I have a WCF .svc file hosted in IIS. I want to use basicHTTP binding. This services job is to actually call another service over net.tcp. Everything works fine locally, but when I deployed, I'm getting this error.

The provided URI scheme 'http' is invalid; expected 'net.tcp'. Parameter name: via

Here is the server config

<client>
  <endpoint address="net.tcp://localhost:9300/InternalInterfaceService"
      binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IInternalInterfaceService"
      contract="IInternalInterfaceService" name="NetTcpBinding_IInternalInterfaceService">
    <identity>
      <servicePrincipalName value="localhost" />
    </identity>
  </endpoint>
</client>
<services>
<service name="MyExternalService">
<endpoint address="" binding="basicHttpBinding" contract="IMyExternalService" />
</service>
</services>

And here is the config that svcutil generates

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_IMyExternalService" closeTimeout="00:01:00"
                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                useDefaultWebProxy="true">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <security mode="None">
                    <transport clientCredentialType="None" proxyCredentialType="None"
                        realm="" />
                    <message clientCredentialType="UserName" algorithmSuite="Default" />
                </security>
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://myserver.somesdomain.com/Services/MyExternalService.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyExternalService"
            contract="IMyInternalService" name="BasicHttpBinding_IMyExternalService" />
    </client>
</system.serviceModel>

What do I need to do to wire this up correctly. I do not want to expose InternalInterfaceService over http. What am I doing incorrectly here? Any tips or suggestions are certainly appreciated.

Thanks,
~ck

© Stack Overflow or respective owner

Related posts about wcf

Related posts about binding