You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by nt...@apache.org on 2007/02/15 21:28:13 UTC

svn commit: r508128 - /webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java

Author: nthaker
Date: Thu Feb 15 12:28:12 2007
New Revision: 508128

URL: http://svn.apache.org/viewvc?view=rev&rev=508128
Log:
Axis2-2194

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java?view=diff&rev=508128&r1=508127&r2=508128
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java Thu Feb 15 12:28:12 2007
@@ -38,6 +38,7 @@
 import org.apache.axis2.jaxws.core.controller.AxisInvocationController;
 import org.apache.axis2.jaxws.core.controller.InvocationController;
 import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.description.EndpointInterfaceDescription;
 import org.apache.axis2.jaxws.description.OperationDescription;
 import org.apache.axis2.jaxws.description.ServiceDescription;
 import org.apache.axis2.jaxws.i18n.Messages;
@@ -341,6 +342,23 @@
     
     protected static Throwable getFaultResponse(MessageContext msgCtx, OperationDescription opDesc) {
         Message msg = msgCtx.getMessage();
+        //In Async scenario if the client throws a user defined exception the Operation Description
+        //for Async method does not store the fault description as Asyc operation will never
+        //have throws clause in the method signature.
+        //The @WebMethod annotation on Asycn Method will point the wsdl defined operation
+        //and we will fetch the OperationDescription of the sync method and this should give us the
+        //correct fault description so we can throw the right user defined exception.
+        
+        String webMethodAnnoName = opDesc.getOperationName();
+        String javaMethodName = opDesc.getJavaMethodName();
+        if(webMethodAnnoName!=null && webMethodAnnoName.length()>0 && webMethodAnnoName != javaMethodName){
+        	EndpointInterfaceDescription eid = opDesc.getEndpointInterfaceDescription();
+			if(eid!=null){
+				//Switching the opDesc to wsdl operations opDesc.
+				opDesc = eid.getOperation(webMethodAnnoName);
+			}
+        }
+        
         if (msg!= null && msg.isFault()) {
             Object object = MethodMarshallerFactory.getMarshaller(opDesc, false).demarshalFaultResponse(msg, opDesc);
             if (log.isDebugEnabled()) {



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org