2009-08-31 25 views
8

Quiero usar netTCPbinding, así que he cambiado mi configuración web como se muestra a continuación. Estoy experimentando este error:WCF Service netTCPbinding

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

¿Cómo se puede resolver esto?

<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> 
+0

quieres saber más sobre NetTcpBinding en WCF ... Visita este enlace tiene mucha información .. http://www.planetofcoders.com/nettcpbinding-in-wcf/ –

Respuesta

5

HMm ... ha agregado la dirección base a su sección de servicios/host ok.

Pregunta rápida: ¿es usted autónomo o anfitrión en IIS? ¿Qué versión de IIS?

IIS5/6 solo admite conexiones HTTP: no puede alojar una NetTCP en IIS 5/6.

En IIS7, debe realizar manualmente una serie de pasos para habilitar enlaces no HTTP, pero es posible. Vea this MSDN article sobre cómo lograr esto.

El alojamiento propio es la mejor opción: obtiene todos los enlaces y tiene el control total de la recepción de su servicio.

Marc

+0

Estoy usando autohosting e IIS 7 –

+0

So Marc, estoy usando IIS 5.1 –

+0

Como ya mencioné, IIS5 * no * funcionará con el enlace de NetTCP; en este caso, necesitará usar el alojamiento propio. ¿También tienes el mismo error en el autohospedaje? –

4

Aquí es un ejemplo básico NetTcpBinding de MSDN. Vea si esto puede ayudarlo.

EDIT:

Y here es una cuestión de forma relacionada.

0

no puedo ver sección en su archivo de configuración, puede u por favor favor agregar este

<netTcpBinding> 

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

</netTcpBinding> 

Cuestiones relacionadas