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 | 0 | public class MuleHeadersInHandler extends AbstractHandler |
25 | |
{ |
26 | 0 | 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 | 0 | if (context.getInMessage() != null) |
38 | |
{ |
39 | 0 | Element header = context.getInMessage().getHeader(); |
40 | 0 | if (header == null) |
41 | |
{ |
42 | 0 | return; |
43 | |
} |
44 | |
|
45 | 0 | Element muleHeaders = header.getChild(MuleSoapHeaders.MULE_HEADER, ns); |
46 | 0 | if (muleHeaders != null) |
47 | |
{ |
48 | 0 | Element child = muleHeaders.getChild(MuleProperties.MULE_CORRELATION_ID_PROPERTY, ns); |
49 | 0 | if (child != null) |
50 | |
{ |
51 | 0 | context.setProperty(MuleProperties.MULE_CORRELATION_ID_PROPERTY, child.getText()); |
52 | |
} |
53 | 0 | child = muleHeaders.getChild(MuleProperties.MULE_CORRELATION_GROUP_SIZE_PROPERTY, ns); |
54 | 0 | if (child != null) |
55 | |
{ |
56 | 0 | context.setProperty(MuleProperties.MULE_CORRELATION_GROUP_SIZE_PROPERTY, child.getText()); |
57 | |
} |
58 | 0 | child = muleHeaders.getChild(MuleProperties.MULE_CORRELATION_SEQUENCE_PROPERTY, ns); |
59 | 0 | if (child != null) |
60 | |
{ |
61 | 0 | context.setProperty(MuleProperties.MULE_CORRELATION_SEQUENCE_PROPERTY, child.getText()); |
62 | |
} |
63 | 0 | child = muleHeaders.getChild(MuleProperties.MULE_REPLY_TO_PROPERTY, ns); |
64 | 0 | if (child != null) |
65 | |
{ |
66 | 0 | context.setProperty(MuleProperties.MULE_REPLY_TO_PROPERTY, child.getText()); |
67 | |
} |
68 | |
} |
69 | |
} |
70 | 0 | } |
71 | |
|
72 | |
} |