我有一个.net 4.0 WCF REST服务,在Windows 7 IIS 7上本地运行完全正常, 但是当我尝试将其部署在运行Windows Server 2003且具有IIS 6的QA服务器上时,我开始收到错误请求错误。 我已经尝试了this解决方案,但它对我不起作用。 我发送到服务器的XML似乎没有被反序列化,我正在使用XmlSerializer。 有什么想法吗?
修改 使用Fiddler我有异常细节:
Request Error
The server encountered an error processing the request. The exception message is 'There is an error in XML document (4, 354066).'. See server logs for more details. The exception stack trace is: </p>
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)
at System.ServiceModel.Dispatcher.UnwrappedTypesXmlSerializerManager.XmlSerializerXmlObjectSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName)
at System.ServiceModel.Dispatcher.SingleBodyParameterMessageFormatter.ReadObject(Message message)
at System.ServiceModel.Dispatcher.SingleBodyParameterMessageFormatter.DeserializeRequest(Message message, Object[] parameters)
at System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(Message message, Object[] parameters)
at System.ServiceModel.Dispatcher.CompositeDispatchFormatter.DeserializeRequest(Message message, Object[] parameters)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
xmlvalidation.com告诉我我的XML是正确的,我在本地IIS上使用相同的XML得到了正确的响应
解决方案: here
答案 0 :(得分:0)
有两种可能性:
试试这个:
答案 1 :(得分:0)
我遇到的问题是没有设置邮件单个文本字段的最大长度。我假设,如果值为0,IIS将采用某种默认值,对于IIS 7而言,它比IIS 6更大,幸运的是我的XML消息。 请参考this链接。