Announcement Announcement Module
Collapse
No announcement yet.
SOAP attachment : swaref and jaxb2 with spring-ws Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SOAP attachment : swaref and jaxb2 with spring-ws

    hello,

    I have been trying to use swaref (attachment profile 1.x attachment profile 1.x in order to send a file as a SOAP attachement, using spring-ws on the server side and Jaxb2 as the marshalling / unmarshalling layer.

    In the (generated) wsdl i get :
    Code:
    <xs:schema ... xmlns:ref="http://ws-i.org/profiles/basic/1.1/xsd" ...>
    ...
    <xs:complexType name="InfoAttachement">
      <xs:sequence>
        <xs:element name="reference" type="ref:swaRef"/>
      </xs:sequence>
    </xs:complexType>
    As a matter of fact the mapping class generated by jaxb-xjc is correctly annoted with @xmlAttachmentRef :
    Code:
    ...
    public class InfoAttachement {
        @XmlElement(required = true, type = String.class)
        @XmlAttachmentRef
        protected DataHandler reference;
    ...
    So everything seems to be ok on the client side and as a matter of fact fhe client (soapui) correctly associates the attachment with the swaref in the mime-content.

    The problem stands on the server side as i get a null reference in the InfoAttachement when i try to deal with the request.

    I am using the following fw versions :
    - latest spring-ws 1.5.8,
    - sun jaxb2 2.1.12,
    - sun saaj 1.3
    The attachment is there as i have been able to get access to it so i figure there might be a problem between jaxb2 and spring-ws.

    So i was wondering if spring-ws actually supports this kind of SOAP attachment ?
    Or maybe i am just doing wrong and there is a way to make it work properly ?
Working...
X