简体   繁体   中英

Https wcf webservice Error

<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="serviceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
<endpointBehaviors>
<behavior name="webHttp">
  <webHttp />
 </behavior>
 <behavior name="webHttpBehavior">
 <webHttp />
 </behavior></endpointBehaviors>
     </behaviors>
  <services>
  <service name="Implementation.Service" behaviorConfiguration="serviceBehavior">
  <endpoint address="" binding="basicHttpBinding"   contract="Contract.IService" behaviorConfiguration="web"    bindingConfiguration="basicHttpBinding"></endpoint>
 <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
  </services>
  <bindings>
  <basicHttpBinding>
   <binding name="CodeItSoap" closeTimeout="00:01:00">
   <security mode="Transport">
   <transport clientCredentialType="Basic" proxyCredentialType ="Basic"  realm =" "/>
 <message clientCredentialType= "username" algorithm ="default">
  </security>
 </binding>
 </basicHttpBinding>
 </bindings>
  <client>
 <endpoint address="https://******.****-***/*****_*****?SOAP"
  binding="basicHttpBinding" bindingConfiguration="CodeItSoap"
 contract="Service.CodeItSoap" name="CodeItSoap" />
</client>
 </system.serviceModel>
 </configuration>

This is just a sample of my web.config file. When I run the service in the local host it runs fine and with the help of wcf test client I am getting the required output. But when I put the dlls & web.config in the server where I have to host the service it's throwing an error "Could not find a base address that matches scheme HTTP for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https]"

Could any one tell me what the reason for the above error is? General Flow of my web service Application -> Server hosting(calc.svc) -> https://******.****- */*****_*****?SOAP(authenticated) when i add the service reference app.config got generated and by default basichttpbinding got added to app.config file. As per my understanding web.config file is used to host the service in iis & i think my web.config is wrong. In the client end point what should be the end point to calc.svc or https://* ?soap? Is the basichttpbinding ok for the https://prd36/calc.svc url? do i need to specify one more binding for the application too? Please help me understand i am heavily confused as the web.config which i have edited is a existing one which is still running the old service reference.

 <serviceMetadata httpsGetEnabled="true"/> 
 <endpoint address="json" binding="webHttpBinding" contract="Contract.IService" behaviorConfiguration="web"></endpoint> 
 <endpoint address="mex" binding="mexHttpsinding" contract="IMetadataExchange"/>

above changes i did and the service url is running in web browser.

Use http:// instead of https:// in your endpoint address. OR User BasicHttpsBinding instead of BasicHttpBinding in your endpoint.

follow this link if the problem still exist.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM