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