[英]Generate webservice client when WSDL uses SOAP 1.2
I have a WSDL file which I want to generate a webservice client from.我有一个 WSDL 文件,我想从中生成一个 Web 服务客户端。 The problem is that the WSDL I've gotten uses SOAP 1.2:问题是我得到的 WSDL 使用 SOAP 1.2:
<wsdl:definitions xmlns:wsoap12="http://schemas.xmlsoap.org/wsdl/soap12/" [...]>
And和
<wsoap12:operation soapAction="[...]" />
When I try to generate a client from this I only get the request/response Java beans.当我尝试从中生成客户端时,我只得到请求/响应 Java bean。
If I on the other hand edit the WSDL to use SOAP 1.1 (and nothing else), everything generates beautifully, except that it will send SOAP 1.1 request instead of SOAP 1.2, and the server will yell at me to use 1.2 instead... If I on the other hand edit the WSDL to use SOAP 1.1 (and nothing else), everything generates beautifully, except that it will send SOAP 1.1 request instead of SOAP 1.2, and the server will yell at me to use 1.2 instead...
I generate the code using Spring Tool Suite on Windows 7 by right clicking the WSDLs and selecting "Web services > Generate client".我使用 Windows 7 上的 Spring Tool Suite 生成代码,方法是右键单击 WSDL 并选择“Web 服务 > 生成客户端”。 All this have worked like a charm before, when we were using SOAP 1.1.当我们使用 SOAP 1.1 时,所有这一切都像魅力一样起作用。
I've also tried to generate it with wsimport
of the maven plugin jaxws-maven-plugin
to no avail;我还尝试使用 maven 插件jaxws-maven-plugin
的wsimport
生成它,但无济于事; it too generates only the beans, not the proxy.它也只生成bean,而不是代理。
Is there a way to get this to work?有没有办法让它工作? Or is there some way I can modify the generated *ServiceProxy.java
classes for them to use SOAP 1.2 instead of 1.1?或者有什么方法可以修改生成的*ServiceProxy.java
类,让他们使用 SOAP 1.2 而不是 1.1?
You might want to look at Metro.你可能想看看地铁。 That should support Soap 1.2.那应该支持 Soap 1.2。
Someone posted a reference to client gen using Metro here: Generating Metro Client Using Local WSDL File有人在这里使用 Metro 发布了对客户端 gen 的引用: 使用本地 WSDL 文件生成 Metro 客户端
Metro wsimport options: http://metro.java.net/1.2/docs/wsimport.html Metro wsimport 选项: http://metro.java.net/1.2/docs/wsimport.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.