【问题标题】:BizTalk & WCF Service: Couldn't find type for class System Diagnostics.TextWriterTraceListener?BizTalk 和 WCF 服务:找不到类 System Diagnostics.TextWriterTraceListener 的类型?
【发布时间】:2012-02-19 17:31:57
【问题描述】:

我创建了一个简单的编排来调用 WCF 服务并从中获取响应。 Web服务方法很简单:

字符串GetSimple(int value)

BizTalk 监视文件夹并使用 FILE 适配器从那里接收激活消息,然后构造适当的消息并调用 Web 服务。但因此异常而失败:

错误描述:System.Configuration.ConfigurationErrorsException:找不到类 System Diagnostics.TextWriterTraceListener 的类型。 服务器堆栈跟踪: 在 System.Diagnostics.TraceUtils.GetRuntimeObject(字符串类名,类型 baseType,字符串初始化数据) 在 System.Diagnostics.TypedElement.BaseGetRuntimeObject() 在 System.Diagnostics.ListenerElement.GetRuntimeObject() 在 System.Diagnostics.ListenerElement.GetRuntimeObject() 在 System.Diagnostics.ListenerElementsCollection.GetRuntimeObject() 在 System.Diagnostics.TraceSource.Initialize() 在 System.Net.Logging.InitializeLogging() 在 System.Net.Logging.get_On() 在 System.Net.WebRequest.Create(Uri requestUri,布尔值 useUriBase) 在 System.Net.WebRequest.Create(Uri requestUri) 在 System.ServiceModel.Channels.HttpChannelFactory.GetWebRequest(EndpointAddress 到,Uri 通过,NetworkCredential 凭据,TokenImpersonationLevel impersonationLevel,AuthenticationLevel authenticationLevel,SecurityTokenProviderContainer proxyTokenProvider,SecurityTokenContainer clientCertificateToken,TimeSpan 超时) 在 System.ServiceModel.Channels.HttpChannelFactory.GetWebRequest(端点地址,Uri 通过,SecurityTokenProviderContainer tokenProvider,SecurityTokenProviderContainer proxyTokenProvider,SecurityTokenContainer clientCertificateToken,TimeSpan 超时) 在 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.GetWebRequest(端点地址,Uri 通过,SecurityTokenContainer clientCertificateToken,TimeoutHelper 和 timeoutHelper) 在 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.GetWebRequest(端点地址,Uri 通过,TimeoutHelper 和 timeoutHelper) 在 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.BeginSendRequest(消息消息,TimeSpan 超时) 在 System.ServiceModel.Channels.RequestChannel.BeginRequest(消息消息,TimeSpan 超时,AsyncCallback 回调,对象状态) 在 System.ServiceModel.Dispatcher.RequestChannelBinder.BeginRequest(消息消息,TimeSpan 超时,AsyncCallback 回调,对象状态) 在 System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartSend(布尔完成同步) 在 System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.Begin() 在 System.ServiceModel.Channels.ServiceChannel.BeginCall(字符串操作,布尔单向,ProxyOperationRuntime 操作,Object[] ins,TimeSpan 超时,AsyncCallback 回调,对象 asyncState) 在 System.ServiceModel.Channels.ServiceChannel.BeginRequest(消息消息,TimeSpan 超时,AsyncCallback 回调,对象状态) 在 System.ServiceModel.Channels.ServiceChannel.BeginRequest(消息消息,AsyncCallback 回调,对象状态) 在 [0] 处重新抛出异常: 在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg) 在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData,Int32 类型) 在 System.ServiceModel.Channels.IRequestChannel.BeginRequest(消息消息,AsyncCallback 回调,对象状态) 在 Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendRequestMessage(IBaseMessage bizTalkMessage,IRequestChannel 频道) 在 Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendMessage(IBaseMessage bizTalkMessage) 异常类型:XlangSoapException 来源:Microsoft.XLANGs.BizTalk.Engine 目标站点:Void VerifyTransport(Microsoft.XLANGs.Core.Envelope, Int32, Microsoft.XLANGs.Core.Context) 以下是标识异常发生位置的堆栈跟踪 在 Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase.VerifyTransport(信封 env,Int32 operationId,上下文 ctx) 在 Microsoft.XLANGs.Core.Subscription.Receive(Segment s、上下文 ctx、Envelope& env、Boolean topOnly) 在 Microsoft.XLANGs.Core.PortBase.GetMessageId(订阅订阅、Segment currentSegment、Context cxt、Envelope& env、CachedObject 位置) 在 Orch.Orc.segment1(停止条件 stopOn) 在 Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s、StopConditions stopCond、Exception& exp)


我找不到TextWriterTraceListener。它在哪里?如何摆脱这个异常?

【问题讨论】:

    标签: wcf biztalk biztalk-2010


    【解决方案1】:

    WCF 服务的配置文件或 BTSNtSvc.exe.config 似乎有问题。 BizTalk 似乎正在发送正确的请求。

    很可能,您围绕 WCF 记录消息的配置存在问题,或者 BTSNtSvc.exe.config 的日志记录参数不正确。

    您可能希望从标准 .net 客户端调用服务以缩小问题范围。

    HTH

    【讨论】:

    • 我试过了。当我从一个简单的 WPF 项目调用服务时,它工作正常。
    • 有问题的配置文件元素几乎肯定是从这篇 MSDN 文章中复制的:msdn.microsoft.com/en-us/library/…。它有一个空格而不是一个点;应该说“System.Diagnostics.TextWriterTraceListener”而不是“System Diagnostics.TextWriterTraceListener”。
    猜你喜欢
    • 2011-09-12
    • 2013-07-09
    • 1970-01-01
    • 1970-01-01
    • 2016-01-11
    • 2011-03-28
    • 2012-04-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多