0
SOAP Webサービスと通信したいのですが、wsdlファイルからSvcUtil.exeによって作成されたC#クラスがありました。.NET SOAPは要求ヘッダーでBASIC認証を送信しません
私はSystem.ServiceModel.Security.MessageSecurityExceptionを受信し、トラフィックをBurpプロキシ経由で送信することでHTTP要求をチェックすると、BASIC認証情報は表示されません。合格。 C#コードのSOAP要求に何かが欠落しているか、BASIC認証が機能しないという問題がありますか?
var binding = new WSHttpBinding();
binding.MessageEncoding = WSMessageEncoding.Mtom;
binding.Security.Mode = SecurityMode.Transport;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
binding.Name = "BasicAuthSecured";
SearchServicePortClient searchClient = new SearchServicePortClient(binding, new EndpointAddress("https://myUrl:Port/myService"));
searchClient.ClientCredentials.UserName.UserName = "username";
searchClient.ClientCredentials.UserName.Password = "pw";
query soap = new query();
//...
queryResponse response = searchClient.query(soap);
事前