gpt4 book ai didi

java - JAXB、WSDL 和 RequestWrapper/ResponseWrapper

转载 作者:行者123 更新时间:2023-12-01 11:33:41 30 4
gpt4 key购买 nike

我希望生成的类使用像这样的“包装样式”元素(使用 @RequestWrapper@ResponseWrapper

@WebMethod(action = "http://.../IsThatServiceAvailable")
@RequestWrapper(localName = "isThatServiceAvailable", targetNamespace = "http://...", className = "....IsThatServiceAvailable")
@ResponseWrapper(localName = "isThatServiceAvailableResponse", targetNamespace = "http://...", className = "....IsThatServiceAvailableResponse")
@WebResult(name = "isAvailable", targetNamespace = "")
public boolean isThatServiceAvailable(
@WebParam(name = "context", targetNamespace = "")
...Context context
) throws WSException;

但我无法猜测,也找不到解释何时使用它的文档。肯定有一些与操作和参数名称或类型的命名有关的东西,因为当我使用小写的驼峰或大写的驼峰时,行为是不同的......但我不知道是什么(我试图重现我想到了另一个操作的方案,但它不起作用)。

你能给我规则吗?

最佳答案

这是我在 JAX WS 文档中找到的内容:https://jcp.org/aboutJava/communityprocess/pfd/jsr224/index.html (§2.3.1.2 包装样式)

A WSDL operation qualifies for wrapper style mapping only if the following criteria are met:

(i) The operation’s input and output messages (if present) each contain only a single part

(ii) The input message part refers to a global element declaration whose localname is equal to the operation name

(iii) The output message part refers to a global element declaration

(iv) The elements referred to by the input and output message parts (henceforth referred to as wrapper elements) are both complex types defined using the xsd:sequence compositor

(v) The wrapper elements only contain child elements, they must not contain other structures such as wildcards (element or attribute), xsd:choice, substitution groups (element references are not permitted) or attributes; furthermore, they must not be nillable.

注意:就我而言,(iv) 规则未得到遵守

关于java - JAXB、WSDL 和 RequestWrapper/ResponseWrapper,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30216637/

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