views:

3412

answers:

4

I want to user netTCPbinding for that I changed my web config as below :

<services>
  <service name="DXDirectory.DXDirectoryService" behaviorConfiguration="DXDirectory.Service1Behavior">
    <!-- Service Endpoints -->
    <endpoint address="" binding="netTcpBinding" bindingConfiguration="WindowsSecured" contract="DXDirectory.IDXDirectoryService">
      <!-- 
          Upon deployment, the following identity element should be removed or replaced to reflect the 
          identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
          automatically.
      -->
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://localhost:2582/DXDirectoryService" />
      </baseAddresses>
    </host>

  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="DXDirectory.Service1Behavior">
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="false" />
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="false" />
      <serviceAuthorization principalPermissionMode="UseWindowsGroups" />
      <!--<serviceCredentials>-->
        <!--<userNameAuthentication userNamePasswordValidationMode="Custom"
                                membershipProviderName="CustomUserNameValidator"/>-->
      <!--</serviceCredentials>-->
    </behavior>
  </serviceBehaviors>
</behaviors>

But still I am getting the below error:

Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http].

Please Help!!

+1  A: 

Here is a NetTcpBinding basic example from msdn. See if this can help you.

EDIT:

And here is a related SO question.

Ezombort
+1  A: 

HMm... you've added the base address to your services/host section ok.

Quick question: are you self-hosting, or hosting in IIS ?? Which version of IIS ??

IIS5/6 only support HTTP connections - you cannot host a NetTCP in IIS 5/6.

In IIS7, you have to manually go through a series of steps to enable non-HTTP bindings, but it's possible. See this MSDN article on how to achieve this.

Self-hosting is the best option - you get all bindings and are in total control of your service being hosted.

Marc

marc_s
I am using self hosting and IIS 7
Ashish Ashu
Sorry Marc, I am using IIS 5.1
Ashish Ashu
As I mentioned - IIS5 will *not* work with the NetTCP binding - you'll need to use self-hosting in this case. Do you have the same error in self-hosting, too?
marc_s
A: 

Do you have a BindingConfiguration named "WindowsSecured"? If not, add a Bindings section to you config and specify that the WindowsSecured binding use the NetTcpBinding. WCF configuration can be quite circular but making sure that you properly complete every configuration section is a good start.

Kirk Broadhurst
<bindings> <netTcpBinding> <binding name="WindowsSecured"> <security mode="Transport"> <transport clientCredentialType="Windows" /> </security> </binding> </netTcpBinding> </bindings>
Ashish Ashu
A: 

I cant see section in your config file, can u please please add this

<netTcpBinding>

 <binding name="WindowsSecured">
 <security mode="none"/> 
 </binding> 

</netTcpBinding>

Ajax2020