简体   繁体   English

WSDL使用SOAP 1.2时生成webservice客户端

[英]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-pluginwsimport生成它,但无济于事; 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.

相关问题 wsimport使用SOAP 1.2 for SOAP 1.1 wsdl - wsimport uses SOAP 1.2 for SOAP 1.1 wsdl 当服务器使用 Windows 集成身份验证时,从 wsdl 生成 webservice soap 客户端 - Generate webservice soap client from wsdl when server using Windows Integrated Authentication 如何生成使用WSDL动态位置的SOAP客户端代码? - How to generate SOAP client code that uses dynamic location for WSDL? WSDL SOAP Web 服务 Java 客户端的错误 415 - Error 415 for WSDL SOAP Webservice Java client 生成客户端肥皂时将wsdl日期类型转换为XMLGregorianCalendar - wsdl date type transformed to XMLGregorianCalendar when generate client soap ReST Web服务客户端-是否从WSDL生成? - ReST webservice client - generate from WSDL or not? 如何使用Enunciate生成SOAP 1.2 WSDL? - How do you generate a SOAP 1.2 WSDL with Enunciate? SOAP 1.2 消息在发送到 SOAP 1.1 端点时无效 WSDL 中使用 SOAP 1.2 时出现错误 - A SOAP 1.2 message is not valid when sent to a SOAP 1.1 only endpoint Error While Using SOAP 1.2 in WSDL 使用@webservice 将 wsdl 文件/工件导入 SOAP 初学者/测试客户端的 .netbeans - Import wsdl file/artifacts to netbeans for SOAP beginner/test client with @webservice 提供wsdl时,CXF Webservice客户端会中断 - CXF Webservice client breaks when providing wsdl
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM