Is it possible to extract an attribute (as in XML attribute value) from a RequestWrapper object?
In my implementation, I'd like to use the value of the attribute, but can't reference it with @WebParam, as that is only for elements (I believe)
@SOAPBinding is defined "Document/Literal/Wrapped"
WSDL (relevant sections, target attribute at **):
<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 abstract method (able to specify XML elements with WebParam):
@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
);
Implementation:
@Override
public void getStatus(
Entity entity,
Holder<StatusCode> statusCode,
Holder<Server> server
) { ... }
It’s obvious how I can read the value of the @RequestWrapper bean Status (Entity via @WebParam), but is there any way to access the value (Handle) within Status. WebParam, as far as I understand, does not support attributes, only elements.
An alternate way to ask/seek solution might be asking how to access the full bean being referenced by RequestWrapper, in this case GetStatus.
I know if I transition to Document/Literal/Bare I can simply have the parameters and return value reflect the bean, but I'd prefer to solve this using wrapped as all information points to this being the most widely preferred binding.