c# - Error when configure HTTPS in WCF Service -


i have wcf service in vs 2010, .net 4.0.

iis site virtual directory.

i try configure , access using https

https://pruebaslba.xxxx.net/serviciopys/service.svc?wsdl

but error

could not find base address matches scheme https endpoint binding wshttpbinding. registered base address schemes [http]. 

or

could not find base address matches scheme https endpoint binding basichttpbinding. registered base address schemes [http]. 

googleing, have seen several alternatives configurations: servicemetadata, bindings, baseaddresses, ..

i try different configurations, same error:

servicemetadata

<servicemetadata httpgetenabled="false or true" httpsgetenabled="true" /> 

bindings

i use <security mode="transport">

 <bindings>        <basichttpbinding>         <binding name="securetransportonly">           <security mode="transport">             <transport clientcredentialtype="none" proxycredentialtype="none" realm="" />           </security>         </binding>          <binding name="nosecure">           <security mode="none"><transport clientcredentialtype="none"/></security>         </binding>        </basichttpbinding>        <wshttpbinding>         <binding name="securetransportonly">           <security mode="transport">               <transport clientcredentialtype="none" proxycredentialtype="none" realm="" />           </security>         </binding>        </wshttpbinding>     </bindings> 

endpoint

 <endpoint             address=""             binding="basichttpbinding"             bindingconfiguration="securetransportonly"             name="xxxactualserviceendpoint"             bindingnamespace="https://pruebaslba.xxxx.net/serviciopys"             contract="ixxxactualservice"> 

mex

<endpoint address="mex" binding="mexhttpbinding o mexhttpsbinding" contract="imetadataexchange"/> 

and tried too:

  <!--<host>           <baseaddresses>             <add  baseaddress="https://pruebaslba.xxxx.net o https://pruebaslba.xxxx.net/serviciopys"/>           </baseaddresses>         </host>-->            <!--<identity>             <dns value="localhost" />           </identity>--> 

i tried, think, configurations i've found in forums. don't know solution.

update more information it. website in 2 servers (preproduction environment): preiis01 , preiis02. ssl not enabled.

i can access http://preiis01/serviciopys/service.svc?wsdl ok http.

https://pruebaslba.xxxx.net/serviciopys/service.svc?wsdl public url nlb (load balanced, think, f5). in nlb, ssl configured. dont know more information, departament has information.

the problem wsdl

http://preiis01/serviciopys/service.svc?wsdl

<wsdl:service name="actualservice">  <wsdl:port name="actualserviceendpoint"binding="i0:actualserviceendpoint">  <soap:addresslocation="http://preiis01/serviciopys/service.svc/service.svc" />  </wsdl:port>  </wsdl:service> 

url wsdl in nlb hast problema soap:address location part , not generated right (set http, , not https)

https://pruebaslba.xxxx.net/serviciopys/service.svc?wsdl

<wsdl:service name="actualservice">  <wsdl:port name="actualserviceendpoint"binding="i0:actualserviceendpoint">  <soap:addresslocation="http://pruebaslba.xxxx.net/serviciopys/service.svc/service.svc" />  </wsdl:port>  </wsdl:service> 

quickly solution modify manually wsdl (singlefile) , set https in soap:addresslocation part, in new url https://pruebaslba.xxxx.net/serviciopys/wsdl/servicewsdlmodificado.single.wsdl

https://pruebaslba.xxxx.net/serviciopys/wsdl/servicewsdlmodificado.single.wsdl

<wsdl:service name="actualservice">  <wsdl:port name="actualserviceendpoint"binding="tns:actualserviceendpoint">  <soap:addresslocation="https://pruebaslba.xxxx.net/serviciopys/service.svc/service.svc"/>  </wsdl:port>      </wsdl:service> 

i think, there solution practices. don't know.

website in iis has not ssl enabled, , nlb has ssl.

maybe “ssl pass-through” , don't know

http://blog.tonysneed.com/2012/06/18/building-scalable-and-secure-wcf-services/

any suggestions?

there error says base address uses 'http' scheme, when needs instead use 'https.' when hosting in iis, address configured in iis, rather hosts element in config.

that means need set ssl in iis: http://www.iis.net/learn/manage/configuring-security/how-to-set-up-ssl-on-iis.

then open visual studio administrator, go web tab of project properties , change base address there use https local iis. vs create virtual directory https scheme.


Popular posts from this blog