CRM4の一部としてデプロイされているカスタムWebサービスを呼び出そうとすると、次のエラーが発生します。
Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.
The request failed with the error message:
--
<html>
<head>
<title>No Microsoft Dynamics CRM user exists with the specified domain name and user ID</title>
<style>
...
</style>
</head>
<body bgcolor="white">
<span><H1>Server Error in '/RecurrenceService' Application.<hr width=100% size=1 color=silver></H1>
<h2> <i>No Microsoft Dynamics CRM user exists with the specified domain name and user ID</i> </h2></span>
...
<table width=100% bgcolor="#ffffcc">
<tr>
<td>
[CrmException: No Microsoft Dynamics CRM user exists with the specified domain name and user ID]
Microsoft.Crm.Authentication.WindowsAuthenticationProvider.Authenticate(HttpApplication application) +895
Microsoft.Crm.Authentication.AuthenticationStep.Authenticate(HttpApplication application) +125
Microsoft.Crm.Authentication.AuthenticationPipeline.Authenticate(HttpApplication application) +66
Microsoft.Crm.Authentication.AuthenticationEngine.Execute(Object sender, EventArgs e) +513
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
</td>
</tr>
</table>
<br>
<hr width=100% size=1 color=silver>
<b>Version Information:</b> Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
</font>
</body>
</html>
<!--
[CrmException]: No Microsoft Dynamics CRM user exists with the specified domain name and user ID
at Microsoft.Crm.Authentication.WindowsAuthenticationProvider.Authenticate(HttpApplication application)
at Microsoft.Crm.Authentication.AuthenticationStep.Authenticate(HttpApplication application)
at Microsoft.Crm.Authentication.AuthenticationPipeline.Authenticate(HttpApplication application)
at Microsoft.Crm.Authentication.AuthenticationEngine.Execute(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
-->
--.
Webサービスを呼び出すためのコード:
RecurrenceService serv = new RecurrenceService();
serv.Credentials = System.Net.CredentialCache.DefaultCredentials;
string result = serv.UpdateSeries();
CRM4のURL:http://cw-dev-5/loader.aspx
カスタムサービスのURL:http://cw-dev-5/RecurrenceService/RecurrenceService.asmx
次のコードスニペットSystem.Security.Principal.WindowsIdentity.GetCurrent().Name
が返されますNT AUTHORITY\NETWORK SERVICE
(エラーの原因だと思います)
誰かが私の問題を解決するための解決策を私に提案できますか?