大型WCF客户端代理响应似乎在生产计算机上被截断,但不是dev使用相同的绑定

时间:2014-01-03 10:39:13

标签: wcf soap xml-serialization wcf-binding wcf-client

我在我的开发机器上运行服务调用没有问题,它响应了一个巨大的消息,但是当我发布客户端代理时,它不能在我们的服务器上运行(客户端是服务的一部分)。

是否有IIS设置或需要配置的内容以允许更大的响应?

当我与Fiddler一起观看时,它提到了内容长度不匹配的问题。

.Net错误是:

  

从网络收到的XML存在问题。   有关详细信息,请参阅内部异常   System.ServiceModel.ProtocolException:XML存在问题   从网络收到的。请参阅内部异常了解更多信   细节。 --->

System.Xml.XmlException: Unexpected end of file. Following elements are not closed: Body, Envelope. Line 1, position 2609.
       at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3)
       at System.Xml.XmlExceptionHelper.ThrowUnexpectedEndOfFile(XmlDictionaryReader reader)
       at System.Xml.XmlUTF8TextReader.ReadAttributes()
       at System.Xml.XmlUTF8TextReader.ReadStartElement()
       at System.Xml.XmlUTF8TextReader.Read()
       at System.Xml.XmlBaseReader.ReadEndElement()
       at System.ServiceModel.Channels.MessageHeaders.Init(MessageVersion version, XmlDictionaryReader reader, IBufferedMessageData bufferedMessageData, RecycledMessageState recycledMessageState, Boolean[] understoodHeaders)
       at System.ServiceModel.Channels.BufferedMessage..ctor(IBufferedMessageData messageData, RecycledMessageState recycledMessageState, Boolean[] understoodHeaders)
       at System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoder.ReadMessage(ArraySegment`1 buffer, BufferManager bufferManager, String contentType)
       at System.ServiceModel.Channels.HttpInput.DecodeBufferedMessage(ArraySegment`1 buffer, Stream inputStream)
       --- End of inner exception stack trace ---

我的绑定设置如下:

Dim myBinding As New CustomBinding
myBinding.Elements.Add(GetAsyBindingElement())

'Encoding Binding Element
Dim textMsgEncoder As New TextMessageEncodingBindingElement(MessageVersion.Soap11, System.Text.Encoding.UTF8)
textMsgEncoder.ReaderQuotas.MaxDepth = Integer.MaxValue '2147483647
textMsgEncoder.ReaderQuotas.MaxStringContentLength = Integer.MaxValue '2147483647
textMsgEncoder.ReaderQuotas.MaxArrayLength = Integer.MaxValue '2147483647
textMsgEncoder.ReaderQuotas.MaxBytesPerRead = Integer.MaxValue '2147483647
textMsgEncoder.ReaderQuotas.MaxNameTableCharCount = Integer.MaxValue '2147483647

myBinding.Elements.Add(textMsgEncoder)

Dim httpBindingElement As New HttpTransportBindingElement
httpBindingElement.MaxBufferSize = Integer.MaxValue
httpBindingElement.MaxReceivedMessageSize = Integer.MaxValue
httpBindingElement.MaxBufferPoolSize = Integer.MaxValue
myBinding.Elements.Add(httpBindingElement)

Return myBinding

我使用侦听器as suggested here

捕获了WCF错误
<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>0</EventID><Type>3</Type><SubType Name="Transfer">0</SubType><Level>255</Level><TimeCreated SystemTime="2014-01-03T18:14:17.0992190Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" RelatedActivityID="{69598e69-7f36-498c-a6d4-e53cfccf7a31}" /><Execution ProcessName="w3wp" ProcessID="5620" ThreadID="5" /><Channel/><Computer>APPSERVER1</Computer></System><ApplicationData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131085</EventID><Type>3</Type><SubType Name="Start">0</SubType><Level>255</Level><TimeCreated SystemTime="2014-01-03T18:14:17.0992190Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{69598e69-7f36-498c-a6d4-e53cfccf7a31}" /><Execution ProcessName="w3wp" ProcessID="5620" ThreadID="5" /><Channel/><Computer>APPSERVER1</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Start"><TraceIdentifier>http://msdn.microsoft.com/en-GB/library/System.ServiceModel.Diagnostics.ActivityBoundary.aspx</TraceIdentifier><Description>Activity boundary.</Description><AppDomain>/LM/W3SVC/1/ROOT/Test_ServiceMenuIntegrationService_2_3_6-1-130332464553179690</AppDomain><ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord"><ActivityName>Construct ChannelFactory. Contract type: 'ServiceClient.wcfServiceProxy.Service'.</ActivityName><ActivityType>Construct</ActivityType></ExtendedData></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>0</EventID><Type>3</Type><SubType Name="Transfer">0</SubType><Level>255</Level><TimeCreated SystemTime="2014-01-03T18:14:17.1148440Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{69598e69-7f36-498c-a6d4-e53cfccf7a31}" RelatedActivityID="{00000000-0000-0000-0000-000000000000}" /><Execution ProcessName="w3wp" ProcessID="5620" ThreadID="5" /><Channel/><Computer>APPSERVER1</Computer></System><ApplicationData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131085</EventID><Type>3</Type><SubType Name="Stop">0</SubType><Level>255</Level><TimeCreated SystemTime="2014-01-03T18:14:17.1148440Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{69598e69-7f36-498c-a6d4-e53cfccf7a31}" /><Execution ProcessName="w3wp" ProcessID="5620" ThreadID="5" /><Channel/><Computer>APPSERVER1</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Stop"><TraceIdentifier>http://msdn.microsoft.com/en-GB/library/System.ServiceModel.Diagnostics.ActivityBoundary.aspx</TraceIdentifier><Description>Activity boundary.</Description><AppDomain>/LM/W3SVC/1/ROOT/Test_ServiceMenuIntegrationService_2_3_6-1-130332464553179690</AppDomain><ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord"><ActivityName>Construct ChannelFactory. Contract type: 'ServiceClient.wcfServiceProxy.Service'.</ActivityName><ActivityType>Construct</ActivityType></ExtendedData></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>0</EventID><Type>3</Type><SubType Name="Transfer">0</SubType><Level>255</Level><TimeCreated SystemTime="2014-01-03T18:14:17.1148440Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" RelatedActivityID="{25a71701-e229-4517-b70c-f7d913aacda9}" /><Execution ProcessName="w3wp" ProcessID="5620" ThreadID="5" /><Channel/><Computer>APPSERVER1</Computer></System><ApplicationData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131085</EventID><Type>3</Type><SubType Name="Start">0</SubType><Level>255</Level><TimeCreated SystemTime="2014-01-03T18:14:17.1148440Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{25a71701-e229-4517-b70c-f7d913aacda9}" /><Execution ProcessName="w3wp" ProcessID="5620" ThreadID="5" /><Channel/><Computer>APPSERVER1</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Start"><TraceIdentifier>http://msdn.microsoft.com/en-GB/library/System.ServiceModel.Diagnostics.ActivityBoundary.aspx</TraceIdentifier><Description>Activity boundary.</Description><AppDomain>/LM/W3SVC/1/ROOT/Test_ServiceMenuIntegrationService_2_3_6-1-130332464553179690</AppDomain><ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord"><ActivityName>Open ClientBase. Contract type: 'ServiceClient.wcfServiceProxy.Service'.</ActivityName><ActivityType>Open</ActivityType></ExtendedData></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>0</EventID><Type>3</Type><SubType Name="Transfer">0</SubType><Level>255</Level><TimeCreated SystemTime="2014-01-03T18:14:17.1304690Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{25a71701-e229-4517-b70c-f7d913aacda9}" RelatedActivityID="{00000000-0000-0000-0000-000000000000}" /><Execution ProcessName="w3wp" ProcessID="5620" ThreadID="5" /><Channel/><Computer>APPSERVER1</Computer></System><ApplicationData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131085</EventID><Type>3</Type><SubType Name="Stop">0</SubType><Level>255</Level><TimeCreated SystemTime="2014-01-03T18:14:17.1304690Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{25a71701-e229-4517-b70c-f7d913aacda9}" /><Execution ProcessName="w3wp" ProcessID="5620" ThreadID="5" /><Channel/><Computer>APPSERVER1</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Stop"><TraceIdentifier>http://msdn.microsoft.com/en-GB/library/System.ServiceModel.Diagnostics.ActivityBoundary.aspx</TraceIdentifier><Description>Activity boundary.</Description><AppDomain>/LM/W3SVC/1/ROOT/Test_ServiceMenuIntegrationService_2_3_6-1-130332464553179690</AppDomain><ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord"><ActivityName>Open ClientBase. Contract type: 'ServiceClient.wcfServiceProxy.Service'.</ActivityName><ActivityType>Open</ActivityType></ExtendedData></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>0</EventID><Type>3</Type><SubType Name="Transfer">0</SubType><Level>255</Level><TimeCreated SystemTime="2014-01-03T18:14:17.1304690Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" RelatedActivityID="{faa212a6-54bc-4d7a-a20b-a045ac093ea2}" /><Execution ProcessName="w3wp" ProcessID="5620" ThreadID="5" /><Channel/><Computer>APPSERVER1</Computer></System><ApplicationData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131085</EventID><Type>3</Type><SubType Name="Start">0</SubType><Level>255</Level><TimeCreated SystemTime="2014-01-03T18:14:17.1304690Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{faa212a6-54bc-4d7a-a20b-a045ac093ea2}" /><Execution ProcessName="w3wp" ProcessID="5620" ThreadID="5" /><Channel/><Computer>APPSERVER1</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Start"><TraceIdentifier>http://msdn.microsoft.com/en-GB/library/System.ServiceModel.Diagnostics.ActivityBoundary.aspx</TraceIdentifier><Description>Activity boundary.</Description><AppDomain>/LM/W3SVC/1/ROOT/Test_ServiceMenuIntegrationService_2_3_6-1-130332464553179690</AppDomain><ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord"><ActivityName>Process action ''.</ActivityName><ActivityType>ProcessAction</ActivityType></ExtendedData></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>458781</EventID><Type>3</Type><SubType Name="Information">0</SubType><Level>8</Level><TimeCreated SystemTime="2014-01-03T18:14:17.1304690Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{faa212a6-54bc-4d7a-a20b-a045ac093ea2}" /><Execution ProcessName="w3wp" ProcessID="5620" ThreadID="5" /><Channel/><Computer>APPSERVER1</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information"><TraceIdentifier>http://msdn.microsoft.com/en-GB/library/System.ServiceModel.Security.SecurityBindingOutgoingMessageSecured.aspx</TraceIdentifier><Description>The security protocol secured the outgoing message.</Description><AppDomain>/LM/W3SVC/1/ROOT/Test_ServiceMenuIntegrationService_2_3_6-1-130332464553179690</AppDomain><ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/SecurityProtocolTraceRecord"><SecurityProtocol>System.ServiceModel.Security.TransportSecurityProtocol</SecurityProtocol></ExtendedData></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>262163</EventID><Type>3</Type><SubType Name="Information">0</SubType><Level>8</Level><TimeCreated SystemTime="2014-01-03T18:14:17.5523440Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{faa212a6-54bc-4d7a-a20b-a045ac093ea2}" /><Execution ProcessName="w3wp" ProcessID="5620" ThreadID="5" /><Channel/><Computer>APPSERVER1</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information"><TraceIdentifier>http://msdn.microsoft.com/en-GB/library/System.ServiceModel.Channels.MessageSent.aspx</TraceIdentifier><Description>Sent a message over a channel.</Description><AppDomain>/LM/W3SVC/1/ROOT/Test_ServiceMenuIntegrationService_2_3_6-1-130332464553179690</AppDomain><Source>System.ServiceModel.Channels.HttpOutput+WebRequestHttpOutput/41973342</Source><ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/MessageTraceRecord"><MessageProperties><Encoder>text/xml; charset=utf-8</Encoder><AllowOutputBatching>False</AllowOutputBatching><Via>http://www..ford.com/services//1.0</Via></MessageProperties><MessageHeaders><ActivityId CorrelationId="12823e4b-228f-420b-bf56-3f0e051984b6" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">faa212a6-54bc-4d7a-a20b-a045ac093ea2</ActivityId></MessageHeaders></ExtendedData></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131075</EventID><Type>3</Type><SubType Name="Error">0</SubType><Level>2</Level><TimeCreated SystemTime="2014-01-03T18:14:17.8492190Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{faa212a6-54bc-4d7a-a20b-a045ac093ea2}" /><Execution ProcessName="w3wp" ProcessID="5620" ThreadID="5" /><Channel/><Computer>APPSERVER1</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error"><TraceIdentifier>http://msdn.microsoft.com/en-GB/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceIdentifier><Description>Throwing an exception.</Description><AppDomain>/LM/W3SVC/1/ROOT/Test_ServiceMenuIntegrationService_2_3_6-1-130332464553179690</AppDomain><Exception><ExceptionType>System.ServiceModel.ProtocolException, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>There is a problem with the XML that was received from the network. See inner exception for more details.</Message><StackTrace>   at System.ServiceModel.Channels.HttpInput.DecodeBufferedMessage(ArraySegment`1 buffer, Stream inputStream)
   at System.ServiceModel.Channels.HttpInput.ReadBufferedMessage(Stream inputStream)
   at System.ServiceModel.Channels.HttpInput.ParseIncomingMessage(Exception&amp;amp; requestException)
   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp;amp; msgData, Int32 type)
   at ServiceClient.wcfServiceProxy.Service.list(listRequest request)
   at ServiceClient.wcfServiceProxy.ServiceClient.wcfServiceProxy_Service_list(listRequest request)
   at ServiceClient.Service.ServiceClient.GetData(Service clientProxy, Request request)
   at ServiceClient.Service.ServiceClient.Query(Request request)
   at ServiceClient.Facades.Facade.Query(Request request)
   at ServiceMenuIntegrationService.CatalogueIntegrationService.GetInformation(Request request)
   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct&amp;amp; sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values)
   at System.Web.Services.Protocols.WebServiceHandler.Invoke()
   at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
   at System.Web.Services.Protocols.SyncSessionlessHandler.ProcessRequest(HttpContext context)
   at System.Web.Script.Services.ScriptHandlerFactory.HandlerWrapper.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp;amp; completedSynchronously)
   at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
   at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
   at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
   at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus&amp;amp; notificationStatus)
   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
   at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
</StackTrace><ExceptionString>System.ServiceModel.ProtocolException: There is a problem with the XML that was received from the network. See inner exception for more details. ---&amp;gt; System.Xml.XmlException: Unexpected end of file. Following elements are not closed: Body, Envelope. Line 1, position 2793.
   at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3)
   at System.Xml.XmlExceptionHelper.ThrowUnexpectedEndOfFile(XmlDictionaryReader reader)
   at System.Xml.XmlUTF8TextReader.ReadAttributes()
   at System.Xml.XmlUTF8TextReader.ReadStartElement()
   at System.Xml.XmlUTF8TextReader.Read()
   at System.Xml.XmlBaseReader.ReadEndElement()
   at System.ServiceModel.Channels.MessageHeaders.Init(MessageVersion version, XmlDictionaryReader reader, IBufferedMessageData bufferedMessageData, RecycledMessageState recycledMessageState, Boolean[] understoodHeaders)
   at System.ServiceModel.Channels.BufferedMessage..ctor(IBufferedMessageData messageData, RecycledMessageState recycledMessageState, Boolean[] understoodHeaders)
   at System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoder.ReadMessage(ArraySegment`1 buffer, BufferManager bufferManager, String contentType)
   at System.ServiceModel.Channels.HttpInput.DecodeBufferedMessage(ArraySegment`1 buffer, Stream inputStream)
   --- End of inner exception stack trace ---</ExceptionString><InnerException><ExceptionType>System.Xml.XmlException, System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Unexpected end of file. Following elements are not closed: Body, Envelope. Line 1, position 2793.</Message><StackTrace>   at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3)
   at System.Xml.XmlExceptionHelper.ThrowUnexpectedEndOfFile(XmlDictionaryReader reader)
   at System.Xml.XmlUTF8TextReader.ReadAttributes()
   at System.Xml.XmlUTF8TextReader.ReadStartElement()
   at System.Xml.XmlUTF8TextReader.Read()
   at System.Xml.XmlBaseReader.ReadEndElement()
   at System.ServiceModel.Channels.MessageHeaders.Init(MessageVersion version, XmlDictionaryReader reader, IBufferedMessageData bufferedMessageData, RecycledMessageState recycledMessageState, Boolean[] understoodHeaders)
   at System.ServiceModel.Channels.BufferedMessage..ctor(IBufferedMessageData messageData, RecycledMessageState recycledMessageState, Boolean[] understoodHeaders)
   at System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoder.ReadMessage(ArraySegment`1 buffer, BufferManager bufferManager, String contentType)
   at System.ServiceModel.Channels.HttpInput.DecodeBufferedMessage(ArraySegment`1 buffer, Stream inputStream)</StackTrace><ExceptionString>System.Xml.XmlException: Unexpected end of file. Following elements are not closed: Body, Envelope. Line 1, position 2793.
   at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3)
   at System.Xml.XmlExceptionHelper.ThrowUnexpectedEndOfFile(XmlDictionaryReader reader)
   at System.Xml.XmlUTF8TextReader.ReadAttributes()
   at System.Xml.XmlUTF8TextReader.ReadStartElement()
   at System.Xml.XmlUTF8TextReader.Read()
   at System.Xml.XmlBaseReader.ReadEndElement()
   at System.ServiceModel.Channels.MessageHeaders.Init(MessageVersion version, XmlDictionaryReader reader, IBufferedMessageData bufferedMessageData, RecycledMessageState recycledMessageState, Boolean[] understoodHeaders)
   at System.ServiceModel.Channels.BufferedMessage..ctor(IBufferedMessageData messageData, RecycledMessageState recycledMessageState, Boolean[] understoodHeaders)
   at System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoder.ReadMessage(ArraySegment`1 buffer, BufferManager bufferManager, String contentType)
   at System.ServiceModel.Channels.HttpInput.DecodeBufferedMessage(ArraySegment`1 buffer, Stream inputStream)</ExceptionString></InnerException></Exception></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>0</EventID><Type>3</Type><SubType Name="Transfer">0</SubType><Level>255</Level><TimeCreated SystemTime="2014-01-03T18:14:17.8492190Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{faa212a6-54bc-4d7a-a20b-a045ac093ea2}" RelatedActivityID="{00000000-0000-0000-0000-000000000000}" /><Execution ProcessName="w3wp" ProcessID="5620" ThreadID="5" /><Channel/><Computer>APPSERVER1</Computer></System><ApplicationData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131085</EventID><Type>3</Type><SubType Name="Stop">0</SubType><Level>255</Level><TimeCreated SystemTime="2014-01-03T18:14:17.8492190Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{faa212a6-54bc-4d7a-a20b-a045ac093ea2}" /><Execution ProcessName="w3wp" ProcessID="5620" ThreadID="5" /><Channel/><Computer>APPSERVER1</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Stop"><TraceIdentifier>http://msdn.microsoft.com/en-GB/library/System.ServiceModel.Diagnostics.ActivityBoundary.aspx</TraceIdentifier><Description>Activity boundary.</Description><AppDomain>/LM/W3SVC/1/ROOT/Test_ServiceMenuIntegrationService_2_3_6-1-130332464553179690</AppDomain><ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord"><ActivityName>Process action ''.</ActivityName><ActivityType>ProcessAction</ActivityType></ExtendedData></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent>

2 个答案:

答案 0 :(得分:1)

确保两者 WCF客户端&amp;生产中的服务配置为扩展您在问题中显示的默认长度值。您的错误消息与通常由MaxReceivedMessageSize值不足生成的错误消息不同,因此生产中可能存在其他问题。

我将配置WCF跟踪设置以捕获soap消息,以查看“truncate”XML的实际长度。添加MessageLogging跟踪,如图所示in this SO answer

答案 1 :(得分:1)

问题是服务返回请求并导致客户端出错。实际问题是客户端计算机的时间设置为不正确的值,这意味着将来签署了请求,服务拒绝了它。

我一定会推荐以下错误消息:p

  嘿,它没有发生,是吗?它“将会有   发生了“发生了,但实际上并没有”发生“发生了,   实际上。

相关问题