【发布时间】:2018-05-04 23:25:33
【问题描述】:
有谁知道如何配置从 Azure Function 调用的 WCF 服务?
场景:
- 我有一个 azure 函数项目。
- 我有一个由控制器和映射器组成的核心项目。
- 此核心项目已配置连接服务。
- 我已经配置了在测试项目中工作的端点和绑定。
但是每次我从我得到的函数中调用它:
在 ServiceModel 客户端配置部分中找不到名称为“ABC”和合同“ABC”的端点元素。这可能是因为找不到您的应用程序的配置文件,或者因为在客户端元素中找不到与此名称匹配的端点元素。
服务配置:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="TranslationBridgeWebServiceSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" useDefaultWebProxy="true">
<security mode="None" />
</binding>
</basicHttpBinding>
<customBinding>
<binding name="TranslationBridgeWebServiceSoap12" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00">
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Soap12WSAddressingAugust2004" writeEncoding="utf-8">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</textMessageEncoding>
<security authenticationMode="UserNameOverTransport" allowInsecureTransport="false" />
<httpsTransport manualAddressing="false" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous" bypassProxyOnLocal="false" decompressionEnabled="true" hostNameComparisonMode="StrongWildcard" keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous" realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false" useDefaultWebProxy="true" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="https://abc/TranslationBridgeExternalService.asmx" binding="customBinding" bindingConfiguration="TranslationBridgeWebServiceSoap12" contract="ABC" name="ABC" />
<endpoint address="https://abc/TranslationBridgeExternalService.asmx" binding="basicHttpBinding" bindingConfiguration="TranslationBridgeWebServiceSoap" contract="ABC" name="ABC" />
</client>
感谢您的帮助。
【问题讨论】:
标签: c# azure wcf azure-functions