axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r384527 - in /webservices/axis2/trunk/java/modules: addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java core/src/org/apache/axis2/util/Utils.java
Date Thu, 09 Mar 2006 15:11:43 GMT
Author: chinthaka
Date: Thu Mar  9 07:11:41 2006
New Revision: 384527

URL: http://svn.apache.org/viewcvs?rev=384527&view=rev
Log:
- reverting my earlier commit
- refactoring a util method to Util class

Modified:
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java?rev=384527&r1=384526&r2=384527&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
Thu Mar  9 07:11:41 2006
@@ -24,17 +24,15 @@
 import org.apache.axis2.client.Options;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.i18n.Messages;
+import org.apache.axis2.util.Utils;
 import org.apache.ws.commons.om.OMAbstractFactory;
 import org.apache.ws.commons.om.OMAttribute;
 import org.apache.ws.commons.om.OMElement;
 import org.apache.ws.commons.om.OMNamespace;
 import org.apache.ws.commons.soap.SOAP12Constants;
 import org.apache.ws.commons.soap.SOAPFactory;
-import org.apache.ws.commons.soap.SOAPFaultCode;
 import org.apache.ws.commons.soap.SOAPFaultReason;
-import org.apache.ws.commons.soap.SOAPFaultSubCode;
 import org.apache.ws.commons.soap.SOAPFaultText;
-import org.apache.ws.commons.soap.SOAPFaultValue;
 import org.apache.ws.commons.soap.SOAPHeader;
 import org.apache.ws.commons.soap.SOAPHeaderBlock;
 
@@ -171,7 +169,7 @@
         faultInformation.put(Final.FAULT_HEADER_PROB_HEADER_QNAME, WSA_DEFAULT_PREFIX + ":"
+ addressingHeaderName);
         faultInformation.put(Final.WSA_FAULT_ACTION, Final.WSA_FAULT_ACTION);
         if (!messageContext.isSOAP11()) {
-            setFaultCode(messageContext, faultCode, faultSubCode);
+            Utils.setFaultCode(messageContext, faultCode, faultSubCode);
         }
         throw new AxisFault("A header representing a Message Addressing Property is not valid
and the message cannot be processed", WSA_DEFAULT_PREFIX + ":" + faultCode);
     }
@@ -191,21 +189,7 @@
         return null;
     }
 
-    private void setFaultCode(MessageContext messageContext, String faultCode, String faultSubCode)
{
-        SOAPFactory soapFac = OMAbstractFactory.getSOAP12Factory();
-        SOAPFaultCode soapFaultCode = soapFac.createSOAPFaultCode();
-        SOAPFaultValue soapFaultValue = soapFac.createSOAPFaultValue(soapFaultCode);
-        soapFaultValue.setText(SOAP12Constants.SOAP_DEFAULT_NAMESPACE_PREFIX + ":" + SOAP12Constants.FAULT_CODE_SENDER);
-        SOAPFaultSubCode soapFaultSubCode = soapFac.createSOAPFaultSubCode(soapFaultCode);
-        SOAPFaultValue soapFaultSubcodeValue = soapFac.createSOAPFaultValue(soapFaultSubCode);
-        soapFaultSubcodeValue.setText(WSA_DEFAULT_PREFIX + ":" + faultCode);
-        if(faultSubCode != null) {
-            SOAPFaultSubCode soapFaultSubCode2 = soapFac.createSOAPFaultSubCode(soapFaultSubCode);
-            SOAPFaultValue soapFaultSubcodeValue2 = soapFac.createSOAPFaultValue(soapFaultSubCode2);
-            soapFaultSubcodeValue2.setText(WSA_DEFAULT_PREFIX + ":" + faultSubCode);
-        }
-        messageContext.setProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME, soapFaultCode);
-    }
+
 
     protected abstract void extractToEprReferenceParameters(EndpointReference toEPR, SOAPHeader
header);
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java?rev=384527&r1=384526&r2=384527&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
Thu Mar  9 07:11:41 2006
@@ -201,17 +201,17 @@
 
             if (epr != null) {
                 if (!epr.getAddress().equals(AddressingConstants.Final.WSA_NONE_URI)) {
-                    try {
+//                    try {
                         writeMessageWithCommons(msgContext, epr, dataOut, format);
-                    } catch (AxisFault axisFault) {
-                        // if the given to epr is an unreachable one, we should try to send
it
-                        // over the output stream. See AddressingInterop.test1260(http://www.w3.org/2002/ws/addr/testsuite/testcases/#test1260)
-                        if (axisFault != null && axisFault.getCause() instanceof
IOException) {
-                            sendUsingOutputStream(msgContext, format, dataOut);
-                        } else {
-                            throw axisFault;
-                        }
-                    }
+//                    } catch (AxisFault axisFault) {
+//                        // if the given to epr is an unreachable one, we should try to
send it
+//                        // over the output stream. See AddressingInterop.test1260(http://www.w3.org/2002/ws/addr/testsuite/testcases/#test1260)
+//                        if (axisFault != null && axisFault.getCause() instanceof
IOException) {
+//                            sendUsingOutputStream(msgContext, format, dataOut);
+//                        } else {
+//                            throw axisFault;
+//                        }
+//                    }
                 }
             } else {
                 sendUsingOutputStream(msgContext, format, dataOut);

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java?rev=384527&r1=384526&r2=384527&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java Thu Mar
 9 07:11:41 2006
@@ -43,6 +43,12 @@
 import org.apache.axis2.engine.MessageReceiver;
 import org.apache.axis2.receivers.AbstractMessageReceiver;
 import org.apache.axis2.receivers.RawXMLINOutMessageReceiver;
+import org.apache.ws.commons.om.OMAbstractFactory;
+import org.apache.ws.commons.soap.SOAP12Constants;
+import org.apache.ws.commons.soap.SOAPFactory;
+import org.apache.ws.commons.soap.SOAPFaultCode;
+import org.apache.ws.commons.soap.SOAPFaultSubCode;
+import org.apache.ws.commons.soap.SOAPFaultValue;
 import org.apache.wsdl.WSDLService;
 
 import javax.xml.namespace.QName;
@@ -136,7 +142,7 @@
         axisOp.setMessageReceiver(messageReceiver);
         axisOp.setStyle(WSDLService.STYLE_RPC);
         service.addOperation(axisOp);
-        service.mapActionToOperation(Constants.AXIS2_NAMESPACE_URI+"/"+opName.getLocalPart(),
axisOp);
+        service.mapActionToOperation(Constants.AXIS2_NAMESPACE_URI + "/" + opName.getLocalPart(),
axisOp);
 
         return service;
     }
@@ -314,5 +320,21 @@
             float m_c_vresion = Float.parseFloat(currentDefaultVersion);
             return m_version > m_c_vresion;
         }
+    }
+
+    public static void setFaultCode(MessageContext messageContext, String faultCode, String
faultSubCode) {
+        SOAPFactory soapFac = OMAbstractFactory.getSOAP12Factory();
+        SOAPFaultCode soapFaultCode = soapFac.createSOAPFaultCode();
+        SOAPFaultValue soapFaultValue = soapFac.createSOAPFaultValue(soapFaultCode);
+        soapFaultValue.setText(SOAP12Constants.SOAP_DEFAULT_NAMESPACE_PREFIX + ":" + SOAP12Constants.FAULT_CODE_SENDER);
+        SOAPFaultSubCode soapFaultSubCode = soapFac.createSOAPFaultSubCode(soapFaultCode);
+        SOAPFaultValue soapFaultSubcodeValue = soapFac.createSOAPFaultValue(soapFaultSubCode);
+        soapFaultSubcodeValue.setText(AddressingConstants.WSA_DEFAULT_PREFIX + ":" + faultCode);
+        if (faultSubCode != null) {
+            SOAPFaultSubCode soapFaultSubCode2 = soapFac.createSOAPFaultSubCode(soapFaultSubCode);
+            SOAPFaultValue soapFaultSubcodeValue2 = soapFac.createSOAPFaultValue(soapFaultSubCode2);
+            soapFaultSubcodeValue2.setText(AddressingConstants.WSA_DEFAULT_PREFIX + ":" +
faultSubCode);
+        }
+        messageContext.setProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME, soapFaultCode);
     }
 }



Mime
View raw message