我们有一个非.net客户端,可以在开发环境中使用基本HTTP绑定访问AX 2012 R2 AIF服务。当使用错误的XML调用服务时,可以理解,我们得到500 HTTP错误代码。但是,即使在更正客户端之后,对服务的后续请求也会失败一段时间。我们还没弄清楚我们要等多久。
Error details:
HttpStatusCode: 500
Content-Length: 2980
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Mon, 26 Jan 2015 21:24:19 GMT
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode>
<faultstring xml:lang="en-US">
Error in deserializing body of request message for operation 'myOperationName'.
OperationFormatter encountered an invalid Message body. Expected to find node type 'Element' with name 'MyServiceNameMyOperationNameRequest' and
namespace 'http://tempuri.org'. Found node type 'Element' with name 'MyServiceNamemyOperationNameRequest' and namespace ''
</faultstring>
<detail xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<HelpLink i:nil="true"></HelpLink>
<InnerException>
<HelpLink i:nil="true"></HelpLink>
<InnerException i:nil="true"></InnerException>
<Message>
OperationFormatter encountered an invalid Message body. Expected to find node type 'Element' with name 'MyServiceNameMyOperationNameRequest'
and namespace 'http://tempuri.org'. Found node type 'Element' with name 'MyServiceNamemyOperationNameRequest' and namespace ''
</Message>
<StackTrace>
at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action,
MessageDescription messageDescription, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters)
</StackTrace>
<Type>System.Runtime.Serialization.SerializationException</Type>
</InnerException>
<Message>Error in deserializing body of request message for operation 'myOperationName'. OperationFormatter encountered an invalid Message body. Expected to find node type 'Element' with name 'MyServiceNamemyOperationNameRequest' and namespace 'http://tempuri.org'. Found node type 'Element' with name 'MyServiceNamemyOperationNameRequest' and namespace ''</Message>
<StackTrace>
at System.ServiceModel.Dispatcher.OperationFormatter.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.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
</StackTrace>
<Type>System.ServiceModel.CommunicationException</Type>
</ExceptionDetail>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
有没有办法从这种情况中恢复而不必等待?
谢谢。
答案 0 :(得分:0)
您的讯息格式对此次通话无效。
错误清楚地表明:Expected to find node type 'Element' with name 'MyServiceNameMyOperationNameRequest' and namespace 'http://tempuri.org'. Found node type 'Element' with name 'MyServiceNamemyOperationNameRequest' and namespace ''
您必须在请求中添加 namespace
属性('http://tempuri.org
)。