You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Marc Dumontier <ma...@mdumontier.com> on 2011/02/18 07:07:51 UTC

How to manually serialize the objects generated from wsdl2java

Hi

I've got a WS client using cxf 2.1.3, which works fine. One of my
requirements to to manually submit the XML(without the SOAP envelope) so I
was wondering how I can serialize my object (class created by wsdl2java).
Someone pointing me in the right direction would be great.

here's a snippet from the class

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "transmissionHeader",
    "submissionContent"
})
@XmlRootElement(name = "IARSubmission")
public class IARSubmission {

    @XmlElement(name = "TransmissionHeader", namespace = "
http://iar.on.ca/types", required = true)
    protected TransmissionHeaderType transmissionHeader;
    @XmlElement(name = "SubmissionContent", namespace = "
http://iar.on.ca/types", required = true)
    protected SubmissionContent submissionContent;
    @XmlAttribute(name = "version", required = true)
    protected String version;



-- 
Marc Dumontier

AW: How to manually serialize the objects generated from wsdl2java

Posted by Christian Schneider <cs...@talend.com>.
Hi Marc,

you have to use a  JAXB context and marshaller. As the classes do not contain a @XmlRoot annotation you will also have to wrap them in a JAXBElement.
The following article may help. In your case you do not need the "if" as you know you will need the JAXBElement.

http://stackoverflow.com/questions/4146540/how-to-marshal-an-object-via-jaxb-without-any-information-about-it

Christian


-----Ursprüngliche Nachricht-----
Von: Marc Dumontier [mailto:marc@mdumontier.com] 
Gesendet: Freitag, 18. Februar 2011 07:08
An: users@cxf.apache.org
Betreff: How to manually serialize the objects generated from wsdl2java

Hi

I've got a WS client using cxf 2.1.3, which works fine. One of my requirements to to manually submit the XML(without the SOAP envelope) so I was wondering how I can serialize my object (class created by wsdl2java).
Someone pointing me in the right direction would be great.

here's a snippet from the class

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "transmissionHeader",
    "submissionContent"
})
@XmlRootElement(name = "IARSubmission")
public class IARSubmission {

    @XmlElement(name = "TransmissionHeader", namespace = "
http://iar.on.ca/types", required = true)
    protected TransmissionHeaderType transmissionHeader;
    @XmlElement(name = "SubmissionContent", namespace = "
http://iar.on.ca/types", required = true)
    protected SubmissionContent submissionContent;
    @XmlAttribute(name = "version", required = true)
    protected String version;



--
Marc Dumontier