0
我創建了一個簡單的業務流程來調用WCF服務並從中獲取響應。 Web服務的方法很簡單:BizTalk和WCF服務:無法找到類System Diagnostics.TextWriterTraceListener的類型?
string GetSimple(int value)
的BizTalk監視的文件夾,並使用文件適配器從那裏收到激活郵件,然後構造適當的消息並調用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
。它在哪裏?如何擺脫這種異常?
我試過了。當我從簡單的WPF項目調用服務時,它工作正常。 – mmdemirbas
有問題的配置文件元素幾乎肯定是從以下MSDN文章複製的:https://msdn.microsoft.com/en-us/library/bb203855.aspx?f=255&MSPPError=-2147217396。它有一個空格而不是一個點;應該說「System.Diagnostics.TextWriterTraceListener」而不是「System Diagnostics.TextWriterTraceListener」。 –