Я получил ниже конфиг с сервера.Я хочу вызвать мыльные действия из wsdl, но веб-сервис использует WCF (ASP.NET).Я получил следующий ответ от сервера: a:BadContextToken.Что не так с моим запросом SOAP?
a:BadContextToken
Запрос мыла:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/"> <soap:Header> <wsse:Security soap:mustUnderstand="true" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsse:UsernameToken wsu:Id="UsernameToken-54368F786D0B1FC28B154272072786867"> <wsse:Username>ExampleUsername</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">ExamplePlainPassword</wsse:Password> <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">RCbpWmhk5HUSwNhgEZYwiA==</wsse:Nonce> <wsu:Created>2018-11-20T13:32:07.868Z</wsu:Created> </wsse:UsernameToken> </wsse:Security> </soap:Header> <soap:Body> <tem:GetExampleResult/> </soap:Body> </soap:Envelope>
Конфигурация сервера:
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.serviceModel> <bindings> <wsHttpBinding> <binding name="WSHttpBinding_IDiagService"> <security mode="TransportWithMessageCredential"> <transport clientCredentialType="None" /> <message clientCredentialType="UserName" /> </security> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="https://ExampleWebService.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IDiagService" contract="IDiagService" name="WSHttpBinding_IDiagService"> <identity> <dns value="" /> </identity> </endpoint> </client> </system.serviceModel> </configuration>
Я получил описание ниже, но оно написано на C #, а не на PHP.
(Auth.PasswordIdentity)ServiceSecurityContext.Current.PrimaryIdentity. Access to password can be reached by: ServiceSecurityContext.Current: ((PasswordIdentity)ServiceSecurityContext.Current.PrimaryIdentity).Password. Call path: PasswordServiceCredentials - (if in config UsernamePasswordValidationMode == UserNamePasswordValidationMode.Custom)-> -> PasswordSecurityTokenManager -> PasswordSecurityTokenAuthenticator -> PasswordAuthorizationPolicy