关于wsdl消息绑定多个part的问题

[复制链接]
查看11 | 回复9 | 2007-1-24 12:56:49 | 显示全部楼层 |阅读模式
请教大家一个webservice的问题
我写的一个wsdl



























但是wsdl 校验器报告:WS-I: (BP2119) A document-literal binding which does not specify the parts attribute, has more than one wsdl

art in the associated wsdl:message element.
google上搜索:当您在定义 document/literal 服务时,只能为输入与输出消息各自设计一个part。因此,您的 Web services传送給方法的参数不能超过一個。如果您想要使用具有超过一個参数的方法,则必须改用 Document Wrapped 编码以符合标准。
但是在JAX-WS规范和WS-I Basic profile好像并没有这样的规定,只是规定了使用document/literal/wrapped时,输入和输出message只能存在一个part,请问这是怎么回事呢?
如果以上的规定存在,是不是意味着使用document/literal/bare方式时,输入参数只能有一个呢?
回复

使用道具 举报

千问 | 2007-1-24 12:56:49 | 显示全部楼层
document/literal/bare不是指只能有一个参数!可以是多个参数,但必须包装在一个ROOT元素下面!
回复

使用道具 举报

千问 | 2007-1-24 12:56:49 | 显示全部楼层

2005-11-19
2005-11-22

是合法的,但不符合WS-I的要求!
回复

使用道具 举报

千问 | 2007-1-24 12:56:49 | 显示全部楼层


2005-11-19
2005-11-22


是wrapper形式,多个参数,但是包装成一个完整的XML DOC片段!
回复

使用道具 举报

千问 | 2007-1-24 12:56:49 | 显示全部楼层
所以你在定义XSD和WSDL时,如果需要传递多个参数,需要将这多个参数包装成一个独立的类型或是元素!
回复

使用道具 举报

千问 | 2007-1-24 12:56:49 | 显示全部楼层
谢谢Sky-Tiger!!!
刚刚看到WS-I Basic Profile
R2201 A document-literal binding in a DESCRIPTION MUST, in each of its soapbind:body element(s), have at most one part listed in the parts attribute, if the parts attribute is specified
但是如果处理重载方法时,document/literal/wrapped方式不行,document/literal
回复

使用道具 举报

千问 | 2007-1-24 12:56:49 | 显示全部楼层
JAX-WS也提到了!
回复

使用道具 举报

千问 | 2007-1-24 12:56:49 | 显示全部楼层
原帖由 tangyangbuaa 于 2009-3-2 17:01 发表
谢谢Sky-Tiger!!!
刚刚看到WS-I Basic Profile
R2201 A document-literal binding in a DESCRIPTION MUST, in each of its soapbind:body element(s), have at most one part listed in the parts attribute, if the parts attribute is specified
但是如果处理重载方法时,document/literal/wrapped方式不行,document/literal

重载问题是WSDL1.1的约束,WSDL20会改进!


回复

使用道具 举报

千问 | 2007-1-24 12:56:49 | 显示全部楼层
不好意思 按错键了
回复

使用道具 举报

千问 | 2007-1-24 12:56:49 | 显示全部楼层
那bare和wrapped两种方式究竟存在什么区别呢
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行