BizTalk& WCF服务:找不到类System Diagnostics.TextWriterTraceListener的类型?

时间:2012-01-26 16:14:34

标签: wcf biztalk biztalk-2010

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

string GetSimple(int value)

BizTalk监视文件夹并从那里使用FILE适配器接收激活消息,然后构造正确的消息并调用Web服务。但是没有这个例外:

Error Description: System.Configuration.ConfigurationErrorsException: Couldn't find type for class System Diagnostics.TextWriterTraceListener.

Server stack trace: 
    at System.Diagnostics.TraceUtils.GetRuntimeObject(String className, Type baseType, String initializeData)
    at System.Diagnostics.TypedElement.BaseGetRuntimeObject()
    at System.Diagnostics.ListenerElement.GetRuntimeObject()
    at System.Diagnostics.ListenerElement.GetRuntimeObject()
    at System.Diagnostics.ListenerElementsCollection.GetRuntimeObject()
    at System.Diagnostics.TraceSource.Initialize()
    at System.Net.Logging.InitializeLogging()
    at System.Net.Logging.get_On()
    at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
    at System.Net.WebRequest.Create(Uri requestUri)
    at System.ServiceModel.Channels.HttpChannelFactory.GetWebRequest(EndpointAddress to, Uri via, NetworkCredential credential, TokenImpersonationLevel impersonationLevel, AuthenticationLevel authenticationLevel, SecurityTokenProviderContainer proxyTokenProvider, SecurityTokenContainer clientCertificateToken, TimeSpan timeout)
    at System.ServiceModel.Channels.HttpChannelFactory.GetWebRequest(EndpointAddress to, Uri via, SecurityTokenProviderContainer tokenProvider, SecurityTokenProviderContainer proxyTokenProvider, SecurityTokenContainer clientCertificateToken, TimeSpan timeout)
    at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.GetWebRequest(EndpointAddress to, Uri via, SecurityTokenContainer clientCertificateToken, TimeoutHelper& timeoutHelper)
    at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.GetWebRequest(EndpointAddress to, Uri via, TimeoutHelper& timeoutHelper)
    at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.BeginSendRequest(Message message, TimeSpan timeout)
    at System.ServiceModel.Channels.RequestChannel.BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, Object state)
    at System.ServiceModel.Dispatcher.RequestChannelBinder.BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, Object state)
    at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartSend(Boolean completedSynchronously)
    at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.Begin()
    at System.ServiceModel.Channels.ServiceChannel.BeginCall(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, TimeSpan timeout, AsyncCallback callback, Object asyncState)
    at System.ServiceModel.Channels.ServiceChannel.BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, Object state)
    at System.ServiceModel.Channels.ServiceChannel.BeginRequest(Message message, AsyncCallback callback, Object state)

Exception rethrown at [0]: 
    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
    at System.ServiceModel.Channels.IRequestChannel.BeginRequest(Message message, AsyncCallback callback, Object state)
    at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendRequestMessage(IBaseMessage bizTalkMessage, IRequestChannel channel)
    at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendMessage(IBaseMessage bizTalkMessage)


Exception type: XlangSoapException
Source: Microsoft.XLANGs.BizTalk.Engine
Target Site: Void VerifyTransport(Microsoft.XLANGs.Core.Envelope, Int32, Microsoft.XLANGs.Core.Context)
The following is a stack trace that identifies the location where the exception occured

    at Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase.VerifyTransport(Envelope env, Int32 operationId, Context ctx)
    at Microsoft.XLANGs.Core.Subscription.Receive(Segment s, Context ctx, Envelope& env, Boolean topOnly)
    at Microsoft.XLANGs.Core.PortBase.GetMessageId(Subscription subscription, Segment currentSegment, Context cxt, Envelope& env, CachedObject location)
    at Orch.Orc.segment1(StopConditions stopOn)
    at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)
        


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

1 个答案:

答案 0 :(得分:1)

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

最有可能的是,您对来自WCF的日志消息的配置存在问题,或者BTSNtSvc.exe.config在日志记录方面的参数不正确。

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

HTH