2009-04-28 17 views
12

. Soy figthing durante horas ahora para resolver este problema.WCF + SSL no se encontró el punto final

Tengo un servicio wcf que alojo en II7, todo funciona bien cuando uso el protocolo http normal.

He añadido capabilidades de SSL y desde entonces no puedo acceder a él desde el código. Puedo crear un cliente pero no puedo ejecutar ninguno de sus métodos.

aquí es lo que tengo

<system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
      <binding name="WSHttp0"> 
       <security mode="Transport"> 
        <transport realm ="" clientCredentialType="None" /> 
       </security> 
      </binding> 
     </wsHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="https://serverName.domname.local/WCFTest/MyWebServicec.svc" 
      binding="wsHttpBinding" bindingConfiguration="WSHttp0" contract="SSLWebService.IMyWebService" 
      name="WSEP"> 
      <identity> 
       <dns value="serverName.domname.local" /> 
      </identity> 
     </endpoint> 
    </client> 
</system.serviceModel> 

he añadido una referencia de servicio a mi proyecto

y lo uso como esa

Dim client As MyWebServiceClient = New MyWebServiceClient() 
Try 
    client.GetDocumentByDocID(5) 
Catch ex As Exception 
    MessageBox.Show(ex.Message) 
End Try 

y aquí es lo que me pasa

No hubo punto final escuchando en https://serverName.domname.local/WCFTest/MyWebService.svc que podría aceptar el mensaje. Esto a menudo es causado por una dirección incorrecta o acción SOAP. Vea InnerException, si está presente, para más detalles.

¿Alguien me puede ayudar en esto? Realmente no entiendo lo que está pasando ...

nota: Puedo tener acceso al servicio web correctamente con Internet Explorer (así que supongo que mi certificado está bien)

+0

puede ser útil para ver la configuración del servidor –

Respuesta

3

Usted tenía razón sobre eso,

Sg mal en el lado del servidor.

aquí es cómo lo hice trabajando

<system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
      <binding name="wsHttpEndpointBinding"> 
       <security mode="Transport"> 
        <transport clientCredentialType ="None"/> 
       </security> 
      </binding> 
     </wsHttpBinding> 
    </bindings> 
    <services> 
     <service behaviorConfiguration="App_WcfWebService.AppWebServiceBehavior" name="App_WcfWebService.AppWebService"> 
      <endpoint address="" binding="wsHttpBinding" bindingConfiguration ="wsHttpEndpointBinding" contract="App_WcfWebService.IAppWebService"> 

      </endpoint> 
      <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
      <behavior name="App_WcfWebService.AppWebServiceBehavior"> 
       <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 
       <serviceMetadata httpsGetEnabled="true"/> 
       <!-- 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="true"/> 
       <serviceThrottling maxConcurrentSessions="90" />      
      </behavior> 
     </serviceBehaviors> 
    </behaviors> 
</system.serviceModel> 
4

creo que el web.config servidor podría ser el defectuoso aquí. Tengo WCF sobre SSL que funciona con la siguiente app.config en el lado del cliente.

<configuration> 
    <system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="WSHttpBinding_IService" > 
      <security mode="Transport"> 
      <transport realm ="" clientCredentialType="Windows" /> 
      </security> 
     </binding> 

     </wsHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="https://mycomputer/Service/Service.svc" 
      binding="wsHttpBinding" 
      bindingConfiguration="WSHttpBinding_IService" 
      contract="ServiceProxy.IService" name="WSHttpBinding_IService"> 
     <identity> 
      <dns value="mycomputer" /> 
     </identity> 
     </endpoint> 
    </client> 
    </system.serviceModel> 
</configuration> 

La única diferencia visible es ClientCredentialType que he puesto a Windows como yo quiero usar la autenticación de Windows integrada. El servidor web.config incluye las siguientes líneas para configurar el servicio que el cliente puede consumir.

<system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="WindowsBinding"> 
      <security mode="Transport"> 
      <transport proxyCredentialType="Windows" /> 
      </security> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 
    <services> 
     <service behaviorConfiguration="Service.Service1Behavior" 
       name="Service.Service"> 
     <endpoint address="" binding="wsHttpBinding" 
        bindingConfiguration="WindowsBinding" 
        contract="ServiceInterface.IService"> 
      <identity> 
      <dns value="mycomputer" /> 
      </identity> 
     </endpoint> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="Service.Service1Behavior"> 
      <serviceMetadata httpGetEnabled="true"/> 
      <serviceDebug includeExceptionDetailInFaults="false"/> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 

¿Podría comparar esto con su web.config en el servidor y ver qué difiere? O agregue su web.config a la pregunta.

Cuestiones relacionadas