Which of the following can be used on the SEI’s method parameter so that the corresponding generated schema type is wsiap:swaref ? (Choose one)
A.
@XMLSchemaType
B.
@SwaRef
C.
@XmlMimeType
D.
@XMLAttachmentRef
Which of the following can be used on the SEI’s method parameter so that the corresponding generated schema type is wsiap:swaref ? (Choose one)
Which of the following can be used on the SEI’s method parameter so that the corresponding generated schema type is wsiap:swaref ? (Choose one)
A.
@XMLSchemaType
B.
@SwaRef
C.
@XmlMimeType
D.
@XMLAttachmentRef
Answer is C
JAX-WS endpoints delegate all marshalling/unmarshalling to the JAXB API. The most simple way to enable SwaRef encoding for DataHandler types is to annotate a payload bean with the @XmlAttachmentRef annotation as shown below
https://docs.jboss.org/jbossas/docs/Server_Configuration_Guide/4/html/ch09s17s02s01.html
D. is correct
You can send and receive SOAP messages that include attachments represented in the service interface as swaRef-typed elements.
An swaRef-typed element is defined in the Web Services Interoperability Organization (WS-I) Attachments Profile Version 1.0 (http://www.ws-i.org/Profiles/AttachmentsProfile-1.0.html), which defines how message elements are related to MIME parts.
http://docs.oracle.com/javaee/5/api/javax/xml/bind/annotation/XmlAttachmentRef.html
@XmlRootElement
class Foo {
@XmlAttachmentRef
@XmlAttribute
DataHandler data;
@XmlAttachmentRef
@XmlElement
DataHandler body;
}
The above code maps to the following XML: