过去几周我遇到了这个问题,但我仍然不知道为什么。
我有一个 BizTalk 业务流程,它接收 BizTalk 消息,对其进行处理并最终将其写入文件。为简单起见,假设我们的目标是获取消息(实际上是一项调查)并将其按原样保存到文件夹中。我创建了一个公共接收端口来捕获味精和一个发送端口来将结果写入磁盘。
我已成功部署该项目并已成功将其发布到 IIS。我能够在 IIS 中看到 WCF 服务并将其设置为使用 Framework 4.0。我已经设置了所有相关的接收和发送端口,并从 BizTalk 管理控制台成功启动了应用程序。(接收位置是我发布 wcf 服务时自动创建的,发送位置是位于计算机文件夹中的 FILE 类型)
从 IIS 中的 DefaultSite,我可以看到我的 WCF。但是,当我尝试时,http://localhost/TestSurvey/TestSurvey_Orchestration_1_getSurveyPort.svc,
出现以下错误:
Server Error in '/TestSurvey' Application.
--------------------------------------------------------------------------------
Login failed for user 'Domain\ComputerName$'.
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.Data.SqlClient.SqlException: Login failed for user 'ACAD1\DENBIZDEV$'.
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:
[SqlException (0x80131904): Login failed for user 'Domain\ComputeName$'.]
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
Microsoft.BizTalk.TransportProxy.Interop.IBTTransportProxy.RegisterIsolatedReceiver(String url, IBTTransportConfig callback) +0
Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfIsolatedReceiver`2.RegisterIsolatedReceiver(Uri uri) +1028
Microsoft.BizTalk.Adapter.Wcf.Runtime.WebServiceHostFactory`3.CreateServiceHost(String constructorString, Uri[] baseAddresses) +363
System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1413
System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +50
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +1172
[ServiceActivationException: The service '/TestSurvey/TestSurvey_Orchestration_1_getSurveyPort.svc' cannot be activated due to an exception during compilation. The exception message is: Exception has been thrown by the target of an invocation..]
System.Runtime.AsyncResult.End(IAsyncResult result) +901424
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +178638
System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +107
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
我的问题是:BizTalk 试图登录的是什么?Domain\ComputerName$ 绝对不是用户。我没有尝试从编排访问任何数据库。我相信我的 IIS 设置正确,因为我从 VS2010 创建了一个快速而肮脏的 wcf 服务测试并将其发布到我的 IIS,然后成功创建了一个简单的客户端来使用 wcf 服务测试。直接创建wcf服务测试时没有遇到同样的问题。
非常感谢任何帮助或提示!
编辑
我设法解决了这个问题:它不是由 BizTalk 创建的 Web 配置。我必须创建一个特殊的应用程序池并将我的应用程序绑定到使用它。在应用程序池中,我必须使用 BizTalk 正在使用的自定义凭据。使用内置凭据导致了我遇到的问题。我的菜鸟错误!使用 BizTalk 登录凭据后,一切顺利。