RequestWrapperオブジェクトから(XML属性値のように)属性を抽出することは可能ですか?
私の実装では、属性の値を使用したいのですが、@ WebParamで参照することはできません。これは、要素専用であるためです(私は信じています)
@SOAPBindingは「Document/Literal/Wrapped」と定義されています
WSDL(関連セクション、**のターゲット属性):
<s:element name="GetStatus">
<s:complexType>
<s:element minOccurs="0" maxOccurs="1" name="Entity" type="s0:Entity"/>
**<s:attribute name="Handle" type="s:string"/>
</s:complexType>
</s:element>
<s:element name="GetStatusResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="StatusCode" type="s0:StatusCode"/>
<s:element minOccurs="0" maxOccurs="1" name="Server" type="s0:Server"/>
</s:sequence>
</s:complexType>
</s:element>
<message name="GetStatusIn">
<part name="parameters" element="s0:GetStatus"/>
</message>
<message name="GetStatusOut">
<part name="parameters" element="s0:GetStatusResponse"/>
</message>
<portType name="Service">
<operation name="GetStatus">
<input message="s0:GetStatusIn"/>
<output message="s0:GetStatusOut"/>
</operation>
</portType>
SEI抽象メソッド(WebParamでXML要素を指定できます):
@WebMethod(operationName="GetStatus")
@RequestWrapper(localName=“GetStatus",className="com.example.GetStatus")
@ResponseWrapper(localName=“GetStatusResponse",className="com.example.GetStatusResponse")
public void getStatus(
@WebParam(name="Entity”)Entity entity,
@WebParam(name="StatusCode",mode=WebParam.Mode.OUT)Holder<StatusCode> statusCode,
@WebParam(name="Server", mode=WebParam.Mode.OUT)Holder<Server> server
);
実装:
@Override
public void getStatus(
Entity entity,
Holder<StatusCode> statusCode,
Holder<Server> server
) { ... }
@RequestWrapper Bean Status(@WebParam経由のエンティティ)の値を読み取る方法は明らかですが、 Status内の値( Handle )にアクセスする方法はあります。WebParamは、私が理解している限り、属性をサポートせず、要素のみをサポートします。
解決策を尋ねる/探す別の方法は、RequestWrapperによって参照されている完全なBean(この場合はGetStatus )にアクセスする方法を尋ねることです。
Document / Literal / Bareに移行する場合は、パラメーターと戻り値にBeanを反映させることができますが、すべての情報がこれが最も広く推奨されるバインディングであることを示しているため、wrappedを使用してこれを解決したいと思います。