|
OMDOMFactory; import pl.poznan.put.cs.itsoa.ob2_5._2010._02. compensationdefinition.model. CompensationsGenerator; public class Klasanr12 implements CompensationsGenerator { public static String E2PC_NS = "http://cs.put.poznan.pl/itsoa/OB2-5/mat/2009/11/Enhanced2PC"; public static QName ENVELOPE_BODY = new QName(E2PC_NS, "EnvelopeBody"); public static QName ENVELOPE_HEADER = new QName(E2PC_NS, "EnvelopeHeader"); @Override public String generateCompensation(OMElement body, OMElement header, OMElement compensationBody) { OMDOMFactory factory = new OMDOMFactory(); OMElement Action = factory.createOMElement(new QName( "http://www.w3.org/2005/08/addressing", "Action")); Action.setText("urn:Cancel"); compensationBody.getFirstChildWithName(ENVELOPE_HEADER) .
|
|
package extension; import javax.xml.namespace.QName; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.impl.dom.factory.OMDOMFactory; import pl.poznan.put.cs.itsoa.ob2_5._2010. _02.compensationdefinition.model.CompensationsGenerator; public class Klasanr12 implements CompensationsGenerator { public static String E2PC_NS = "http://cs.put.poznan.pl/itsoa/OB2-5/mat/2009/11/Enhanced2PC"; public static QName ENVELOPE_BODY = new QName(E2PC_NS, "EnvelopeBody"); public static QName ENVELOPE_HEADER = new QName(E2PC_NS, "EnvelopeHeader"); @Override public String generateCompensation( OMElement body, OMElement header, OMElement compensationBody) { OMDOMFactory factory = new OMDOMFactory(); OMElement Action = factory.createOMElement( new QName( "http://www.w3.org/2005/08/addressing", "Action")); Action.setText("urn:Cancel"); compensationBody.getFirstChildWithName(ENVELOPE_HEADER) .addChild(Action); OMElement bodyContent = factory.createOMElement( new QName( "http://morek.com.pl.service.definition", "Cancel")); bodyContent.setText("Wycofaj"); compensationBody.getFirstChildWithName(ENVELOPE_BODY).addChild(body); return "http://127.0.0.1:8080/ode/processes/DumbService"; } }
|