Reputation: 95
Does anyone know how to configure a WCF service to be called from Azure Function?
Scenario:
But every time i call it from the functions i get:
Could not find endpoint element with name 'ABC' and contract 'ABC' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.
Configuration for service:
<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>
Thanks for helping.
Upvotes: 1
Views: 2299
Reputation: 35144
There is no web.config
file for Azure Function App (it will be ignored if you put it manually).
So you would have to create your WCF client by configuring it in code. Effectively, instantiate all the bindings, endpoints etc in the code. For each WCF class there's always a constructor to instantiate an entity with all the parameters without config files.
Upvotes: 1