1 55 56 package org.jboss.axis.transport.java; 57 58 import org.jboss.axis.AxisFault; 59 import org.jboss.axis.MessageContext; 60 import org.jboss.axis.client.Call; 61 import org.jboss.axis.description.OperationDesc; 62 import org.jboss.axis.enums.Scope; 63 import org.jboss.axis.handlers.BasicHandler; 64 import org.jboss.axis.handlers.soap.SOAPService; 65 import org.jboss.axis.providers.java.MsgProvider; 66 import org.jboss.axis.providers.java.RPCProvider; 67 import org.jboss.logging.Logger; 68 69 public class JavaSender extends BasicHandler 70 { 71 private static Logger log = Logger.getLogger(JavaSender.class.getName()); 72 73 public void invoke(MessageContext msgContext) throws AxisFault 74 { 75 if (log.isDebugEnabled()) 76 { 77 log.debug("Enter: JavaSender::invoke"); 78 } 79 80 SOAPService service = null; 81 SOAPService saveService = msgContext.getService(); 82 OperationDesc saveOp = msgContext.getOperation(); 83 84 Call call = (Call)msgContext.getProperty(MessageContext.CALL); 85 String url = call.getTargetEndpointAddress(); 86 String cls = url.substring(5); 87 88 msgContext.setService(null); 89 msgContext.setOperation(null); 90 91 if (msgContext.getProperty(msgContext.IS_MSG) == null) 92 service = new SOAPService(new RPCProvider()); 93 else 94 service = new SOAPService(new MsgProvider()); 95 96 if (cls.startsWith("//")) cls = cls.substring(2); 97 service.setOption(RPCProvider.OPTION_CLASSNAME, cls); 98 service.setEngine(msgContext.getAxisEngine()); 99 100 service.setOption(RPCProvider.OPTION_ALLOWEDMETHODS, "*"); 101 service.setOption(RPCProvider.OPTION_SCOPE, Scope.DEFAULT.getName()); 102 service.getInitializedServiceDesc(msgContext); 103 service.init(); 104 105 msgContext.setService(service); 106 107 service.invoke(msgContext); 108 109 msgContext.setService(saveService); 110 msgContext.setOperation(saveOp); 111 112 if (log.isDebugEnabled()) 113 { 114 log.debug("Exit: JavaSender::invoke"); 115 } 116 } 117 } 118 | Popular Tags |