【发布时间】:2011-09-09 22:46:41
【问题描述】:
我在拨打服务电话时遇到以下错误
反序列化操作“IbankClientOperation”的请求消息正文时出错。 OperationFormatter 遇到无效的消息正文。预计会找到名称为“doClient_ws_IbankRequest”和命名空间“http://www.informatica.com/wsdl/”的节点类型“元素”。找到名称为“字符串”和命名空间“http://schemas.microsoft.com/2003/10/Serialization/”的节点类型“元素”
我正在使用以下代码调用服务
Message requestMsg = Message.CreateMessage(MessageVersion.Soap11, "http://tempuri.org/IService1/IbankClientOperation", requestMessage);
Message responseMsg = null;
BasicHttpBinding binding = new BasicHttpBinding();
IChannelFactory<IRequestChannel> channelFactory = binding.BuildChannelFactory<IRequestChannel>();
channelFactory.Open();
EndpointAddress address = new EndpointAddress(this.Url);
IRequestChannel channel = channelFactory.CreateChannel(address);
channel.Open();
responseMsg = channel.Request(requestMsg);
【问题讨论】:
-
我认为您需要向我们展示您的 requestMessage 参数被传递给 Message.CreateMessage。看来您的内容根本不符合另一端预期的消息架构。
标签: wcf serialization soap deserialization