1 17 package org.apache.geronimo.axis.client; 18 19 import java.io.Serializable ; 20 import java.rmi.RemoteException ; 21 22 import javax.xml.namespace.QName ; 23 24 import org.apache.axis.description.OperationDesc; 25 import org.apache.axis.description.FaultDesc; 26 import org.apache.axis.client.Call; 27 import org.apache.axis.soap.SOAPConstants; 28 import org.apache.axis.AxisFault; 29 import net.sf.cglib.core.Signature; 30 31 34 public class OperationInfo implements Serializable { 35 36 private final OperationDesc operationDesc; 37 private final boolean useSOAPAction; 38 private final String soapActionURI; 39 private final SOAPConstants soapVersion; 40 private final QName operationName; 41 private final String methodName; 42 private final String methodDesc; 43 44 public OperationInfo(OperationDesc operationDesc, boolean useSOAPAction, String soapActionURI, SOAPConstants soapVersion, QName operationName, String methodName, String methodDesc) { 45 this.operationDesc = operationDesc; 46 this.useSOAPAction = useSOAPAction; 47 this.soapActionURI = soapActionURI; 48 this.soapVersion = soapVersion; 49 this.operationName = operationName; 50 this.methodName = methodName; 51 this.methodDesc = methodDesc; 52 } 53 54 public Signature getSignature() { 55 return new Signature(methodName, methodDesc); 56 } 57 58 public OperationDesc getOperationDesc() { 59 return operationDesc; 60 } 61 62 public boolean isUseSOAPAction() { 63 return useSOAPAction; 64 } 65 66 public String getSoapActionURI() { 67 return soapActionURI; 68 } 69 70 public SOAPConstants getSoapVersion() { 71 return soapVersion; 72 } 73 74 public QName getOperationName() { 75 return operationName; 76 } 77 78 public void prepareCall(Call call) { 79 call.setOperation(operationDesc); 80 call.setUseSOAPAction(useSOAPAction); 81 call.setSOAPActionURI(soapActionURI); 82 call.setSOAPVersion(soapVersion); 83 call.setOperationName(operationName); 84 call.setOperationStyle(operationDesc.getStyle()); 86 call.setOperationUse(operationDesc.getUse()); 87 } 88 89 public Throwable unwrapFault(RemoteException re) { 90 if (re instanceof AxisFault && re.getCause() != null) { 91 Throwable t = re.getCause(); 92 if (operationDesc.getFaultByClass(t.getClass()) != null) { 93 return t; 94 } 95 } 96 return re; 97 } 98 } 99 | Popular Tags |