gpt4 book ai didi

wcf - 无法使用 https 调用 Azure 中托管的 WCF 服务的方法

转载 作者:行者123 更新时间:2023-12-02 07:32:25 24 4
gpt4 key购买 nike

我有一个托管在 Azure 中的 WCF 服务,我能够正确获取 wsdl,但在尝试调用方法时出现以下错误。

There was no endpoint listening at https://pactwp7.cloudapp.net/Service1.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

我在设置 https 时使用了自签名证书,因此在从客户端访问服务之前我添加了以下内容:ServicePointManager.ServerCertificateValidationCallback = (发件人、证书、链、错误) => 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>

有什么原因吗?

最佳答案

您是否在 CSDEF 文件上打开了 443 输入端点?

我认为 RDP 到您的虚拟机并进行本地尝试可能有助于识别和调试。

关于wcf - 无法使用 https 调用 Azure 中托管的 WCF 服务的方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10676114/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com