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);
}
Aggregations