Buenas noches foreros.
Estoy intentando crear un WCF con el protocolo wsHttpBinding y que sea seguro a nivel de Message.
Creo que lo tengo todo bien, pero me está fallando y me está lanzando una exceción del tipo InvalidOperationException y NO SÉ POR QUE COJONES ES.
Mi WCF lo estoy alojando en una aplicación windows, no en el IIS.
Hice lo siguiente:
1-. Configuré el app.config
Código:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="httpbindingSequeldenim" />
</basicHttpBinding>
<wsHttpBinding>
<binding name="wsBindingSequeldenim">
<security mode="Message">
<message clientCredentialType="Certificate" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="behaviorSequeldenim">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="behaviorSequeldenim" name="WCFSequeldemin.ServicioGestionProductos">
<endpoint address="http://127.0.0.1:8000/WCFSequeldenim/ServicioSequeldenim"
binding="wsHttpBinding" bindingConfiguration="wsBindingSequeldenim"
name="endPointSequeldenim" contract="WCFSequeldemin.IGestionProductos">
<identity>
<certificateReference storeName="My" storeLocation="LocalMachine" x509FindType="FindBySubjectName"
findValue="Hevia Software" />
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="http://127.0.0.1:8000/WCFSequeldenim/ServicioSequeldenim" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>
2-. Luego ejecuté el httpcfg, el cual pensaba que me iba a solucionar el problema, pero no ha servidor para una mierda... BRRRRRR
Código:
HttpCfg.exe set ssl -i 127.0.0.1:8000
3-. Ejecuto el servicio:
Código:
objServicio = new ServiceHost(typeof(ServicioGestionProductos));
objServicio.Open();
Excepción lanzada:
Código:
ChannelDispatcher en 'http://127.0.0.1:8000/WCFSequeldenim/ServicioSequeldenim' con los contratos '"IGestionProductos"' no puede abrir su IChannelListener.
POR FAVOR, ALGUIEN QUE TENGA EXPERIENCIA CON WCF, ME PUEDE AYUDAR ?? LLEVO 4 HORAS SEGUIDAS PARA ESTO...