刚刚尝试从 WSDL 文件生成 java 客户端生成(使用 XFire 使用 XMLBeans 绑定)
我能够生成客户端 + 故障消息(无错误),但是没有生成输入消息和输出消息,它也没有在客户端生成操作。我的 WSDL 文件有什么问题,或者有什么我想念的吗?
更新 :
我在这里更新了我的测试 XFire 项目。
我开始怀疑这个问题可以孤立到WSDL(因为我可以成功生成其他WSDL)。我发现了这些警告,我觉得它们是相关的:
WS-I:(BP2402) wsdl:binding 元素不使用“3 SOAP 绑定”部分中定义的 soapbind:binding 元素。WSDL 1.1 规范。
WS-I:(BP2032) 有缺陷的soapbind:fault 元素:“name”属性值与父元素wsdl:fault 上的“name”属性值不匹配。
WS-I:(AP2901) 描述既不使用 WSDL 1.1 第 5 节中描述的 WSDL MIME 绑定,也不使用 WSDL 1.1 第 3 节中描述的 WSDL SOAP 绑定对 wsdl:binding 的每个 wsdl:input 或 wsdl:output 元素.
刚刚发现soap12可能导致了这个问题。如果我将 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap12/" 更改为 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 并删除soap中的soapActionRequired :操作它可以成功生成客户端。但是webservice目前只有soap1.2而已。所以改变wsdl 使用soap1.1 不是这里的情况。
这是我的 WSDL 文件:
<!--Created by TIBCO WSDL-->
<wsdl:definitions xmlns:tns="http://schemas.ocbc.com/soa/WSDL/service/CBS-CustAccountInfo-I" xmlns:soap1="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:jndi="http://www.tibco.com/namespaces/ws/2004/soap/apis/jndi" xmlns:ns="http://schemas.ocbc.com/soa/emf/common/envelope/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" …Run Code Online (Sandbox Code Playgroud) 我发现apache xfire在其标题中添加了一个head参数:
POST /testservice/services/TestService1.1 HTTP/1.1
SOAPAction:"testAPI"Content-Type:text/xml; charset = UTF-8
User-Agent:Mozilla/4.0(兼容; MSIE 6.0; Windows NT 5.0; XFire Client + http://xfire.codehaus.org)
主持人:192.168.10.111 :9082
期望:100-continue
这个Expect:100-continue会在xfire客户端和它的端点服务器之间进行往返调用有点浪费,因为它会再使用一次握手让原始服务器返回"愿意接受请求"吗?
这只是我的猜测.
万斯