1 16 package org.apache.axis2.engine; 17 18 import org.apache.axis2.addressing.EndpointReference; 19 import org.apache.axis2.context.MessageContext; 20 import org.apache.axis2.description.HandlerDescription; 21 import org.apache.axis2.description.OperationDescription; 22 import org.apache.axis2.description.ServiceDescription; 23 24 import javax.xml.namespace.QName ; 25 26 29 public class AddressingBasedDispatcher extends AbstractDispatcher { 30 33 public static final QName NAME = 34 new QName ("http://axis.ws.apache.org", "AddressingBasedDispatcher"); 35 36 public AddressingBasedDispatcher() { 37 init(new HandlerDescription(NAME)); 38 } 39 40 public OperationDescription findOperation( 41 ServiceDescription service, 42 MessageContext messageContext) 43 throws AxisFault { 44 45 String action = (String ) messageContext.getWSAAction(); 46 if (action != null) { 47 QName operationName = new QName (action); 48 OperationDescription op = service.getOperation(operationName); 49 50 return op; 51 } 52 return null; 53 } 54 55 58 public ServiceDescription findService(MessageContext messageContext) throws AxisFault { 59 EndpointReference toEPR = messageContext.getTo(); 60 ServiceDescription service = null; 61 if (toEPR != null) { 62 QName serviceName = new QName (toEPR.getAddress()); 63 service = 64 messageContext.getSystemContext().getAxisConfiguration().getService(serviceName); 65 } 66 return service; 67 } 68 69 } 70 | Popular Tags |