gpt4 book ai didi

Java SOAP "wsimport"- 从文档/文字包装的 WSDL 强制包装绑定(bind)?

转载 作者:太空狗 更新时间:2023-10-29 22:59:14 25 4
gpt4 key购买 nike

Java 6 JAX-WS“wsimport”实用程序在给定 WSDL 文件的情况下生成 Web 服务框架(接口(interface))方面做得很好,但有一个令人讨厌的异常。

当给定一个使用 SOAP Document/literal wrapped style 的 WSDL 时( also described here ) 它生成一个带有“裸” SOAP binding parameter style 的服务接口(interface)(多个参数和返回值在方法签名中扩展为 "holder" objects)而不是 WSDL 指定的简单包装参数和返回值。其他工具,例如 Axis2 wsdl2java 只是使用包装器元素作为输入参数和返回值,而不是自动“展开”它们。

是否可以告诉“wsimport”将 SOAP 绑定(bind)参数保持为“包装”而不是“裸”?

最佳答案

据我所知,您需要指定一个自定义绑定(bind)文件来禁用包装器样式:

<bindings
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
wsdlLocation="OperationService.wsdl"
xmlns="http://java.sun.com/xml/ns/jaxws">
<!-- Disable default wrapper style -->
<enableWrapperStyle>false</enableWrapperStyle>
</bindings>

然后调用wsimport

$ wsimport -b binding.xml OperationService.wsdl

关于Java SOAP "wsimport"- 从文档/文字包装的 WSDL 强制包装绑定(bind)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7032381/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com