【问题标题】:Exposing wcf service in BizTalk 2010在 BizTalk 2010 中公开 wcf 服务
【发布时间】:2012-12-28 02:13:01
【问题描述】:

过去几周我遇到了这个问题,但我仍然不知道为什么。

我有一个 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 登录凭据后,一切顺利。

【问题讨论】:

    标签: wcf biztalk biztalk-2010


    【解决方案1】:

    引发 SQL 异常的数据库是 BizTalk 数据库之一,可能是管理数据库或 SSO DB。

    该错误几乎可以肯定是由 IIS 设置引起的,无论是应用程序池标识还是网站安全设置。

    正在发生的事情是,当您第一次调用该服务时,IIS 正在编译您的服务,为此它显然需要访问其中一个 BizTalk 数据库,但由于某种原因,此调用未经过身份验证。

    这可能是因为应用程序池用户必须是 BizTalk 独立主机用户组的成员(根据 BizTalk 的设置方式,该组的名称可能有所不同。

    【讨论】:

    • 谢谢,休。我该如何纠正这种情况?我在应用程序站点->身份验证->高级设置->物理路径凭据中进入 IIS,并输入了正确的用户名和密码。我什至创建了一个专用的应用程序池并将应用程序绑定到使用该池。但是 BizTalk 似乎使用 [domain\ComputerName$] 来访问不正确的数据库。我很确定 BizTalk 已正确设置,因为它已在生产中,并且其他应用程序已在其上完美运行。也许我忽略了一些 IIS 设置,因为我是整个 IIS 传奇的新手......
    • 下面是我在 IIS 内的应用程序文件夹中找到的 webconfig.cfg。我不太明白的一件事是我确实告诉 IIS 我的应用程序正在使用框架 4.0,但 Web 配置似乎是为框架 2.0 设置的。那么IIS内文件夹中的Web配置是否完全使用?我没有看到它访问或尝试登录任何数据库...由于空间限制,请在下一条评论中查看我的网络配置
    • schemas.microsoft.com/.NetConfiguration/v2.0">
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-05-18
    • 2016-01-10
    • 2016-11-28
    • 2016-01-11
    • 1970-01-01
    • 2011-03-03
    • 1970-01-01
    相关资源
    最近更新 更多