2
SOAPヘッダーでユーザー資格情報を渡すことによって、WCF Webサービスに対する外部要求を認証しようとしています。WCF Webサービスへの外部リクエストを認証する方法は?
using (UsrService client = new UsrService())
{
client.Credentials = new System.Net.NetworkCredential("User 1", "Password 1");
client.SomeRemoteMethod();
}
私は例外を取得:
未処理の例外:System.Net.WebException:要求は とエラーメッセージが失敗しました:オブジェクトが
Unhandled exception: System.Net.WebException: The request failed with the error message:
--
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="/NuiLogin.aspx?ReturnUrl=%2f0%2fServiceModel%2fSimp
leCustomService.svc%2fsoap">here</a>.</h2>
</body></html>
--.
in System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClien
tMessage message, WebResponse response, Stream responseStream, Boolean asyncCall
)
in System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodNa
me, Object[] parameters)
in UsrService.SayHello() in c:\VS2015\Projects\WCFSharedDLL\WCFSharedDLL\TestPr
oxyClass.cs:line 44
in ConsoleApplicationForTesting.Program.Main(String[] args) in c:\VS2015\Projec
ts\ConsoleApplicationForTesting\ConsoleApplicationForTesting\Program.cs:line 1
6
どのようにすることができますを移動WCF Webサービスへの外部リクエストを認証しますか?
私は情報に非常に感謝します。ありがとうございます。