axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kei...@apache.org
Subject svn commit: r504442 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2: engine/HTTPLocationBasedDispatcher.java transport/http/CommonsHTTPTransportSender.java transport/http/util/RESTUtil.java util/Builder.java
Date Wed, 07 Feb 2007 05:33:12 GMT
Author: keithc
Date: Tue Feb  6 21:33:11 2007
New Revision: 504442

URL: http://svn.apache.org/viewvc?view=rev&rev=504442
Log:
Fixing fault handling in rest case when detail element is missing in the soap fault


Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/HTTPLocationBasedDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/RESTUtil.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Builder.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/HTTPLocationBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/HTTPLocationBasedDispatcher.java?view=diff&rev=504442&r1=504441&r2=504442
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/HTTPLocationBasedDispatcher.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/HTTPLocationBasedDispatcher.java
Tue Feb  6 21:33:11 2007
@@ -114,7 +114,9 @@
             }
              else {
                 int queryIndex = path.indexOf("?");
-                service = path.substring(queryIndex);
+                if (queryIndex != -1) {
+                    service = path.substring(queryIndex);
+                }
             }
              return service;
    }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java?view=diff&rev=504442&r1=504441&r2=504442
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
Tue Feb  6 21:33:11 2007
@@ -19,6 +19,8 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMOutputFormat;
 import org.apache.axiom.om.impl.MIMEOutputUtils;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPFaultDetail;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.addressing.EndpointReference;
@@ -187,8 +189,13 @@
              */
             if (msgContext.isDoingREST()) {
                 if (msgContext.getFLOW() == MessageContext.OUT_FAULT_FLOW) {
-                    dataOut = msgContext.getEnvelope().getBody().getFault().getDetail()
-                            .getFirstElement();
+                    SOAPFault fault = msgContext.getEnvelope().getBody().getFault();
+                    SOAPFaultDetail soapFaultDetail = fault.getDetail();
+                    dataOut = soapFaultDetail.getFirstElement();
+                    if (dataOut == null) {
+                        dataOut = fault.getReason();
+                    }
+
                 } else {
                     dataOut = msgContext.getEnvelope().getBody().getFirstElement();
                 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/RESTUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/RESTUtil.java?view=diff&rev=504442&r1=504441&r2=504442
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/RESTUtil.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/RESTUtil.java
Tue Feb  6 21:33:11 2007
@@ -18,6 +18,7 @@
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.impl.OMNodeEx;
 import org.apache.axiom.om.impl.builder.OMBuilder;
+import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.soap.SOAPBody;
 import org.apache.axiom.soap.SOAPEnvelope;
@@ -283,7 +284,7 @@
                 if (request.getContentLength() != 0) {
                     xmlreader = StAXUtils.createXMLStreamReader(inputStream,
                                                                 charSetEnc);
-                    OMBuilder builder = Builder.getBuilder(inputStream, charSetEnc, null);
+                    OMBuilder builder = Builder.getPOXBuilder(inputStream, charSetEnc, null);
                     OMNodeEx documentElement = (OMNodeEx) builder.getDocumentElement();
                     documentElement.setParent(null);
                     body.addChild(documentElement);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Builder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Builder.java?view=diff&rev=504442&r1=504441&r2=504442
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Builder.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Builder.java Tue
Feb  6 21:33:11 2007
@@ -42,12 +42,9 @@
 
     public static StAXBuilder getPOXBuilder(InputStream inStream, String charSetEnc, String
soapNamespaceURI) throws XMLStreamException {
         StAXBuilder builder;
-        SOAPEnvelope envelope;
-        SOAPFactory soapFactory = new SOAP11Factory();
         XMLStreamReader xmlreader =
                 StAXUtils.createXMLStreamReader(inStream, charSetEnc);
         builder = new StAXOMBuilder(xmlreader);
-        builder.setOMBuilderFactory(soapFactory);
         return builder;
     }
 



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


Mime
View raw message