[英]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>
这只是我的web.config文件的一个示例。 当我在本地主机中运行该服务时,它运行良好,并且在wcf测试客户端的帮助下,我获得了所需的输出。 但是,当我将dlls
和web.config
放入必须托管服务的服务器中时,它会引发错误"Could not find a base address that matches scheme HTTP for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https]"
谁能告诉我上述错误的原因是什么? 我的Web服务应用程序的一般流程->服务器托管(calc.svc)-> https://******.****- * / ***** _ *****?SOAP(已验证),当我添加服务引用app.config时就已生成,并且默认情况下basichttpbinding已添加到app.config文件中。 根据我的理解,web.config文件用于在iis中托管服务,我认为我的web.config是错误的。 在客户端端点中,calc.svc或https:// * ?soap 的端点应该是什么 ? https://prd36/calc.svc url的basichttpbinding可以吗? 我是否还需要为应用程序指定一个绑定? 请帮助我了解我非常困惑,因为我编辑的web.config是一个仍在运行旧服务参考的现有配置。
<serviceMetadata httpsGetEnabled="true"/>
<endpoint address="json" binding="webHttpBinding" contract="Contract.IService" behaviorConfiguration="web"></endpoint>
<endpoint address="mex" binding="mexHttpsinding" contract="IMetadataExchange"/>
以上我所做的更改和服务URL在Web浏览器中运行。
在端点地址中使用http://而不是https:// 。 或在端点中使用User BasicHttpsBinding而不是BasicHttpBinding 。
如果问题仍然存在,请单击此链接 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.