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