1
2
3
4
5
6
7
8
9
10
11 package org.mule.providers.soap.xfire;
12
13 import org.mule.config.MuleProperties;
14 import org.mule.providers.soap.MuleSoapHeaders;
15
16 import org.codehaus.xfire.MessageContext;
17 import org.codehaus.xfire.handler.AbstractHandler;
18 import org.jdom.Element;
19 import org.jdom.Namespace;
20
21
22
23
24 public class MuleHeadersInHandler extends AbstractHandler
25 {
26 protected final Namespace ns = Namespace.getNamespace(MuleSoapHeaders.MULE_NAMESPACE,
27 MuleSoapHeaders.MULE_10_ACTOR);
28
29
30
31
32
33
34
35 public void invoke(MessageContext context) throws Exception
36 {
37 if (context.getInMessage() != null)
38 {
39 Element header = context.getInMessage().getHeader();
40 if (header == null)
41 {
42 return;
43 }
44
45 Element muleHeaders = header.getChild(MuleSoapHeaders.MULE_HEADER, ns);
46 if (muleHeaders != null)
47 {
48 Element child = muleHeaders.getChild(MuleProperties.MULE_CORRELATION_ID_PROPERTY, ns);
49 if (child != null)
50 {
51 context.setProperty(MuleProperties.MULE_CORRELATION_ID_PROPERTY, child.getText());
52 }
53 child = muleHeaders.getChild(MuleProperties.MULE_CORRELATION_GROUP_SIZE_PROPERTY, ns);
54 if (child != null)
55 {
56 context.setProperty(MuleProperties.MULE_CORRELATION_GROUP_SIZE_PROPERTY, child.getText());
57 }
58 child = muleHeaders.getChild(MuleProperties.MULE_CORRELATION_SEQUENCE_PROPERTY, ns);
59 if (child != null)
60 {
61 context.setProperty(MuleProperties.MULE_CORRELATION_SEQUENCE_PROPERTY, child.getText());
62 }
63 child = muleHeaders.getChild(MuleProperties.MULE_REPLY_TO_PROPERTY, ns);
64 if (child != null)
65 {
66 context.setProperty(MuleProperties.MULE_REPLY_TO_PROPERTY, child.getText());
67 }
68 }
69 }
70 }
71
72 }