1
2
3
4
5
6
7 package org.mule.transport.soap.axis.style;
8
9 import javax.xml.soap.Name;
10 import javax.xml.soap.SOAPBody;
11 import javax.xml.soap.SOAPElement;
12 import javax.xml.soap.SOAPEnvelope;
13 import javax.xml.soap.SOAPException;
14
15 import org.apache.commons.logging.Log;
16 import org.apache.commons.logging.LogFactory;
17 import org.w3c.dom.Document;
18 import org.w3c.dom.Element;
19
20
21
22
23 public class DefaultMessageService implements MessageService
24 {
25
26 private static Log logger = LogFactory.getLog(DefaultMessageService.class);
27
28
29
30
31
32
33
34 public org.apache.axis.message.SOAPBodyElement[] soapBodyElement(org.apache.axis.message.SOAPBodyElement[] bodyElements)
35 {
36
37 logger.debug("bodyElementTest Called");
38 return bodyElements;
39 }
40
41 public Document document(Document body)
42 {
43
44 logger.debug("documentTest Called");
45 body.setNodeValue("TEST RESPONSE");
46 return body;
47 }
48
49 public Element[] elementArray(Element[] elems)
50 {
51
52 logger.debug("echoElements Called");
53 return elems;
54 }
55
56 public void soapRequestResponse(SOAPEnvelope req, SOAPEnvelope resp) throws SOAPException
57 {
58
59 logger.debug("envelopeTest Called");
60 SOAPBody body = resp.getBody();
61 Name ns0 = resp.createName("TestNS0", "ns0", "http://example.com");
62 Name ns1 = resp.createName("TestNS1", "ns1", "http://example.com");
63 SOAPElement bodyElmnt = body.addBodyElement(ns0);
64 SOAPElement el = bodyElmnt.addChildElement(ns1);
65 el.addTextNode("TEST RESPONSE");
66 }
67 }