1 package org.objectweb.petals.binding.axis2.client; 2 3 import java.io.StringWriter ; 4 import java.util.Set ; 5 6 import javax.activation.DataHandler ; 7 import javax.xml.namespace.QName ; 8 import javax.xml.transform.Transformer ; 9 import javax.xml.transform.TransformerFactory ; 10 import javax.xml.transform.dom.DOMSource ; 11 import javax.xml.transform.stream.StreamResult ; 12 13 import org.apache.axiom.soap.SOAPEnvelope; 14 import org.objectweb.petals.component.common.util.WSDLHelper; 15 import org.w3c.dom.Document ; 16 17 public final class SOAPClient { 18 19 private SOAPClient() { 20 } 21 22 32 public static SOAPEnvelope callInOutWS(SOAPEnvelope callEnv, 33 QName serviceName, String opName, Document serviceDesc, 34 String portName, Set <DataHandler > attachments) throws Exception { 35 DOMSource domSource = new DOMSource (serviceDesc); 36 StringWriter writer = new StringWriter (); 37 StreamResult result = new StreamResult (writer); 38 TransformerFactory tf = TransformerFactory.newInstance(); 39 Transformer transformer = tf.newTransformer(); 40 transformer.transform(domSource, result); 41 49 SOAPEnvelope outEnv = null; 56 75 return outEnv; 76 } 77 78 protected static String getTargetNamespace(Document serviceDesc) 79 throws Exception { 80 return WSDLHelper.getTargetNSFromWSDLDocument(serviceDesc); 81 } 82 } 83 | Popular Tags |