Преобразовать wsHttpBinding SOAP 1.2 в BindingCustom SOAP 1.1
Код тега Web.config wsHttpBinding:
<wsHttpBinding>
<binding name="ServiceBinding" allowCookies="true" closeTimeout="01:01:50" openTimeout="01:01:05" receiveTimeout="01:10:05" sendTimeout="01:01:05" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</wsHttpBinding>
Тег CustomBinding:
<customBinding>
<binding name="WsHttpSoap11" >
<security authenticationMode="CertificateOverTransport" />
<textMessageEncoding messageVersion="Soap11WSAddressing10" maxReadPoolSize="2147483647" maxWritePoolSize="2147483647" />
<httpsTransport authenticationScheme="None" allowCookies="true" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" />
</binding>
</customBinding>
Продолжение кода web.config:
<services>
<service behaviorConfiguration="ServiceBehavior" name="WcfPecuaria.Service">
<endpoint name="ServiceBinding" contract="WcfPecuaria.IService" address="" binding="customBinding" bindingConfiguration="WsHttpSoap11" behaviorConfiguration="WsdlEndpointBehavior" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="WsdlEndpointBehavior">
<wsdlExtensions location="https://dominio.br/PecuariaWCFH/Service1.svc" singleFile="true"/>
<!--<wsdlExtensions location="http://localhost:44339/Service1.svc" singleFile="true"/> -->
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom" includeWindowsGroups="false" customUserNamePasswordValidatorType="CustomUserNameValidator.CustomUserNameValidator,App_Code" />
<clientCertificate>
<authentication customCertificateValidatorType="CustomUserNameValidator.CustomCertificateValidator,App_Code" certificateValidationMode="Custom" includeWindowsGroups="false" />
</clientCertificate>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
Отправляя запрос в SoapUI любым способом, я получаю сообщение об ошибке:
HTTP/1.1 415 Cannot process the message because the content type 'application/soap+xml;charset=UTF-
8;action="http://tempuri.org/ServiceContract/SendBuscaLotes"' was not the expected type 'text/xml;
charset=utf-8'.
Server: Microsoft-IIS/8.5
Date: Wed, 11 Mar 2020 12:10:39 GMT
Content-Length: 0