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

  • SOAP attachment : swaref and jaxb2 with spring-ws


    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 :
    <xs:schema ... xmlns:ref="" ...>
    <xs:complexType name="InfoAttachement">
        <xs:element name="reference" type="ref:swaRef"/>
    As a matter of fact the mapping class generated by jaxb-xjc is correctly annoted with @xmlAttachmentRef :
    public class InfoAttachement {
        @XmlElement(required = true, type = String.class)
        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 ?