前提・実現したいこと
C#のWebアプリケーションからSAPにSOAPにてXMLを送信したいです。
発生している問題・エラーメッセージ
WSDLファイルからサービス参照を行い、SOAPを使ってXMLを送信する機能を実装中に以下のエラーメッセージが発生しました。
※下記ソースコードの9行目実行時にエラーが発生
この HTTP 要求は、クライアントの認証方式 'Basic' では承認されません。サーバーから受信した認証ヘッダーは 'Basic realm="SAP NetWeaver Application Server [LEP/316][alias]"' でした。
該当のソースコード
C#
101 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; 202 // WSDLファイルから情報を取得 303 SAPService.ManageCustomerQuoteInClient client = new SAPService.ManageCustomerQuoteInClient("*******", @"URL"); 404 client.ClientCredentials.UserName.UserName = "*******"; 505 client.ClientCredentials.UserName.Password = "*******"; 606 SAPService.CustomerQuoteMaintainRequestBundleMessage_sync request = new 7 _ SAPService.CustomerQuoteMaintainRequestBundleMessage_sync(); 807 908 client.Open(); 1009 SAPService.MaintainBundleResponse response = await client.MaintainBundleAsync(request); 1110 client.Close();
試したこと
web.configのhttpsTransportタグの属性authenticationSchemeの値がクライアントの認証方式に紐づいていたので'Basic' から 'Basic realm="SAP NetWeaver Application Server [LEP/316][alias]"'に変更しましたが、以下のエラーメッセージが表示されました。
プロパティ 'authenticationScheme' の値を解析できません。エラー: 列挙値には次のうちの 1 つを指定しなければなりません: None, Digest, Negotiate, Ntlm, IntegratedWindowsAuthentication, Basic, Anonymous
補足情報(FW/ツールのバージョンなど)
Microsoft Visual C# 2012
.NET Framework 4.5
あなたの回答
tips
プレビュー