2017-10-20 30 views
0

私は、Windows 10 v1607でのWebサービスを呼び出していた場合、それは私のために正常に動作しますが、私は、Windows 10 v1703で同じWebサービスをしようとすると、それは私に、このエラーを与える:要求はHTTPステータス401:Unauthorizedで失敗しました。

The request failed with HTTP status 401: Unauthorized. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Net.WebException: The request failed with HTTP status 401: Unauthorized. 

Source Error: 


An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace: 



[WebException: The request failed with HTTP status 401: Unauthorized.] 
    System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +237136 
    System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +267 
    CPR.Apps.CPMS.ServiceWrapper.CPMSProxy.CPMSService.GetUserGroupTasks(User& user) +138 
    CPR.Apps.CPMS.ServiceWrapper.WebAppServiceWrapper.GetUserGroupTasks(User& cpmsUser) +111 
    CCPS.App.Web.UI.Global.Session_Start(Object sender, EventArgs e) +145 
    System.Web.SessionState.SessionStateModule.CompleteAcquireState() +380 
    System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +1250 
    System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +631 
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +134 

は、それが動作することに注意してくださいWebサービス認証を匿名に設定した場合、これはセキュリティの観点からは受け入れられません。現在、セキュリティ設定はasp.net偽装とWindows認証です。

また、私はwebService.UseDefaultCredentials = trueを持っています。

誰にも提案はありますか? >Servers - - Visual Studioのソリューションは、WebアプリケーションのプロパティWebのために持っていた -

答えて

1

OK、問題を発見したデバッグのために正常に動作しますhttp://localhost:51243のような値を持つ>IIS Expressが、私は公開するとき、それはなりますので、これらの設定を保持します運用サーバーでは動作しません。

問題を解決するため、プロダクションURLでExternal Hostに切り替えました。

v1703が401エラーを出す間に、Windows 10 v1607はこのことに気にしないというのは興味深いことです。

関連する問題