我有一个托管在 Azure 中的 WCF 服务,我能够正确获取 wsdl,但是当尝试调用一个方法时,它给了我以下错误。
在 https://pactwp7.cloudapp.net/Service1.svc上没有可以接受消息的端点监听。这通常是由不正确的地址或 SOAP 操作引起的。有关更多详细信息,请参阅 InnerException(如果存在)。
我在制作 https 时使用了自签名证书,因此在从客户端访问服务之前添加了以下内容:
ServicePointManager.ServerCertificateValidationCallback = (sender, cert, chain, error) => true;
以下是我使用的服务配置:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="httpsAzureBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<useRequestHeadersForMetadataAddress>
<defaultPorts>
<add scheme="http" port="80" />
<add scheme="https" port="443" />
</defaultPorts>
</useRequestHeadersForMetadataAddress>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="httpsBinding">
<binaryMessageEncoding />
<httpsTransport allowCookies="true" />
</binding>
</customBinding>
</bindings>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"
aspNetCompatibilityEnabled="true" />
<services>
<service behaviorConfiguration="httpsAzureBehavior"
name="PactServices.ServiceImplementation.PactService">
<endpoint address="" binding="customBinding"
bindingConfiguration="httpsBinding"
contract="PactServices.ServiceContracts.IPactServices"
listenUri="Service1.svc" />
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
有什么理由吗?