Может кто-нибудь предоставить информацию, пожалуйста?Я получаю эту ошибку, когда служба WCF развернута в Azure VPN.Если я подключаюсь к службе, размещенной в среде разработки IIS или Visual Studio, проблема не возникает. Служба настроена на использование SSL, имя пользователя Basichttpbinding.Это одно и то же связывание как в размещенной службе Azure VPN, так и в среде VS dev.У меня есть журнал WCF в обоих случаях, и они очень похожи.С чего начать устранение неполадок?
<binding name="httpsCertificateBinding" closeTimeout="01:01:00" openTimeout="01:01:00" receiveTimeout="01:10:00" sendTimeout="01:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483646" maxBufferPoolSize="2147483646" maxReceivedMessageSize="2147483646"> <readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> <security mode="TransportWithMessageCredential"> <message clientCredentialType="UserName"/> <transport clientCredentialType="None"></transport> </security> </binding> <behavior name="DefaultBehavior"> <serviceMetadata httpGetEnabled ="true" httpsGetEnabled ="true" /> <serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" /> <serviceCredentials> <userNameAuthentication userNamePasswordValidationMode="MembershipProvider" membershipProviderName="CustomMembershipProvider"/> </serviceCredentials> <useRequestHeadersForMetadataAddress /> </behavior>
Ошибка:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <s:Fault> <faultcode xmlns="">s:MustUnderstand</faultcode> <faultstring xml:lang="en-US" xmlns="">The header 'Security' from the namespace 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd' was not understood by the recipient of this message, causing the message to not be processed. This error typically indicates that the sender of this message has enabled a communication protocol that the receiver cannot process. Please ensure that the configuration of the client's binding is consistent with the service's binding. </faultstring> </s:Fault> </s:Body> </s:Envelope>
Запрос:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <s:Header> <ActivityId CorrelationId="22b7f6e5-39c7-4c00-a295-9031a98236a6" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">fc8345bc-575a-4ba7-a9c2-71e39bc50bf4</ActivityId> <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <u:Timestamp u:Id="_0"> <u:Created>2019-03-05T22:25:35.059Z</u:Created> <u:Expires>2019-03-05T22:30:35.059Z</u:Expires> </u:Timestamp> <o:UsernameToken u:Id="uuid-0c895b96-82ef-440f-80ed-571bc08d3064-1"> <o:Username> <!-- Removed--> </o:Username> <o:Password> <!-- Removed--> </o:Password> </o:UsernameToken> </o:Security> <To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://aces/Services/2019/Image.svc</To> <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://hhh.com/ws/mgSrch</Action> </s:Header> <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> </s:Body> </s:Envelope>