Search in sources :

Example 1 with MessageFactory

use of org.openecard.ws.soap.MessageFactory in project open-ecard by ecsec.

the class MarshalTest method testSOAPMarshal.

@Test
public void testSOAPMarshal() throws Exception {
    JAXBMarshaller m = new JAXBMarshaller();
    Document doc = m.str2doc(xmlStr);
    SOAPMessage msg = m.doc2soap(doc);
    Object o = m.unmarshal(msg.getSOAPBody().getChildElements().get(0));
    doc = m.marshal(o);
    MessageFactory factory = MessageFactory.newInstance();
    SOAPMessage soapMsg = factory.createMessage();
    soapMsg.getSOAPBody().addDocument(doc);
// soapMsg.writeTo(System.out);
}
Also used : MessageFactory(org.openecard.ws.soap.MessageFactory) Document(org.w3c.dom.Document) SOAPMessage(org.openecard.ws.soap.SOAPMessage) Test(org.testng.annotations.Test)

Aggregations

MessageFactory (org.openecard.ws.soap.MessageFactory)1 SOAPMessage (org.openecard.ws.soap.SOAPMessage)1 Test (org.testng.annotations.Test)1 Document (org.w3c.dom.Document)1