使用.NET 3.5中的SOAP 1.1 Web服务 [英] Using a SOAP 1.1 web service from .NET 3.5

查看:47
本文介绍了使用.NET 3.5中的SOAP 1.1 Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来,.NET 3.5在处理Web服务时正在强制执行SOAP 1.2模式,即使该服务在SOAP信封的模式中指定了SOAP 1.1.是否有用于服务参考的设置以识别SOAP 1.1?

It appears that .NET 3.5 is enforcing the SOAP 1.2 schema when dealing with web services, even if the service specifies SOAP 1.1 in the schema for the SOAP envelope. Is there a setting to for the service reference to recognize SOAP 1.1?

问题是从Web服务返回到.NET 3.5客户端的SOAP Fault的格式.在SOAP 1.1中,可以将故障的第一个子元素为< faultactor> .在SOAP 1.2中,这不再有效-第一个子元素必须为< faultcode> .我看到的问题是,当SOAP 1.1 Web服务返回SOAP错误时,我会在.NET上收到异常,抱怨元素< faultcode> 是预期的,但<faultactor> 已收到.我认为我们已将问题范围缩小到SOAP版本控制问题.我们正在测试建议的解决方案.

The issue is the formatting of SOAP Faults returned from the web service to the .NET 3.5 client. In SOAP 1.1 it's acceptable to have the first sub-element of the fault to be <faultactor>. In SOAP 1.2 this is no longer valid - the first sub-element must be <faultcode>. The issue I saw is that when the SOAP 1.1 web service returned a SOAP fault I would get an exception on the .NET complaining that the the element <faultcode> was expected, but <faultactor> was received. I think we've narrowed the issue down to a SOAP versioning problem; we're testing the proposed solution now.

推荐答案

如果您使用的是WCF,请在自定义绑定中进行设置.

If you are using WCF set it in your custom binding.

 <textMessageEncoding messageVersion="Soap11" />

如果您正在使用asmx,这是一个很好的选择博客

If you are using asmx here is a good blog

这篇关于使用.NET 3.5中的SOAP 1.1 Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆