You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2006/12/18 15:26:26 UTC

svn commit: r488278 - in /webservices/axis2/branches/java/1_1/modules: kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java xmlbeans/test-resources/simple-doc-literal.wsdl

Author: dims
Date: Mon Dec 18 06:26:24 2006
New Revision: 488278

URL: http://svn.apache.org/viewvc?view=rev&rev=488278
Log:
Fix for AXIS2-1882 - problem in picking the axis fault element from the binding element (in WSDL 1.1)

Modified:
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
    webservices/axis2/branches/java/1_1/modules/xmlbeans/test-resources/simple-doc-literal.wsdl

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java?view=diff&rev=488278&r1=488277&r2=488278
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java (original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java Mon Dec 18 06:26:24 2006
@@ -1,6 +1,7 @@
 package org.apache.axis2.description;
 
 import com.ibm.wsdl.util.xml.DOM2Writer;
+import com.ibm.wsdl.extensions.soap12.SOAP12FaultImpl;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.addressing.AddressingConstants;
 import org.apache.axis2.addressing.AddressingHelper;
@@ -16,6 +17,7 @@
 import org.apache.neethi.Policy;
 import org.apache.neethi.PolicyReference;
 import org.apache.ws.commons.schema.utils.NamespaceMap;
+import org.apache.axiom.soap.impl.llom.soap11.SOAP11FaultImpl;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -513,10 +515,30 @@
                 for (Iterator faultKeys = bindingFaultsMap.keySet().iterator(); faultKeys
                         .hasNext();) {
                     Object faultMapKey = faultKeys.next();
-                    BindingFault bindingFault = (BindingFault) bindingFaultsMap
-                            .get(faultMapKey);
-                    Fault wsdl4jFault = wsdl4jOperation.getFault(bindingFault
-                            .getName());
+                    BindingFault bindingFault = (BindingFault) bindingFaultsMap.get(faultMapKey);
+                    // accoding to the ws-basic profile and the wsdl 1.1 spec wsdl:fault element must have an
+                    // soap:fault extensibility element with the name attribute.
+                    String faultMappingName = null;
+                    Object nextElement;
+                    for (Iterator iter = bindingFault.getExtensibilityElements().iterator();
+                            iter.hasNext();){
+                       nextElement = iter.next();
+                       if (nextElement instanceof SOAP12Fault){
+                           SOAP12Fault soapFault = (SOAP12Fault) nextElement;
+                           faultMappingName = soapFault.getName();
+                       } else if (nextElement instanceof SOAPFault){
+                           SOAPFault soapFault = (SOAPFault) nextElement;
+                           faultMappingName = soapFault.getName();
+                       }
+                    }
+
+                    if (faultMappingName == null){
+                        throw new AxisFault("the fault binding " + bindingFault.getName()
+                                + " soap:fault element must be present and it should have an " +
+                                "name attribute to map to the wsdl:fault element.");
+                    }
+                    
+                    Fault wsdl4jFault = wsdl4jOperation.getFault(faultMappingName);
                     if (wsdl4jFault == null || wsdl4jFault.getMessage().getParts().size() == 0) {
                         throw new AxisFault("fault \"" + bindingFault.getName()
                                 + "\" not found in the Operation "

Modified: webservices/axis2/branches/java/1_1/modules/xmlbeans/test-resources/simple-doc-literal.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/xmlbeans/test-resources/simple-doc-literal.wsdl?view=diff&rev=488278&r1=488277&r2=488278
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/xmlbeans/test-resources/simple-doc-literal.wsdl (original)
+++ webservices/axis2/branches/java/1_1/modules/xmlbeans/test-resources/simple-doc-literal.wsdl Mon Dec 18 06:26:24 2006
@@ -307,7 +307,7 @@
                 <soap:body use="literal"/>
             </output>
             <fault name="SimpleFault">
-                <soap:fault use="literal"/>
+                <soap:fault name="SimpleFault"  use="literal"/>
             </fault>
             <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
         </operation>
@@ -320,7 +320,7 @@
                 <soap:body use="literal"/>
             </output>
             <fault name="SimpleFault">
-                <soap:fault use="literal"/>
+                <soap:fault name="SimpleFault" use="literal"/>
             </fault>
             <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
         </operation>
@@ -333,7 +333,7 @@
                 <soap:body use="literal"/>
             </output>
             <fault name="SimpleFault">
-                <soap:fault use="literal"/>
+                <soap:fault name="SimpleFault" use="literal"/>
             </fault>
             <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
         </operation>
@@ -346,13 +346,13 @@
                 <soap:body use="literal"/>
             </output>
             <fault name="SimpleFault1">
-                <soap:fault use="literal"/>
+                <soap:fault name="SimpleFault1" use="literal"/>
             </fault>
             <fault name="SimpleFault2">
-                <soap:fault use="literal"/>
+                <soap:fault name="SimpleFault2" use="literal"/>
             </fault>
             <fault name="SimpleFault3">
-                <soap:fault use="literal"/>
+                <soap:fault name="SimpleFault3" use="literal"/>
             </fault>
             <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
         </operation>
@@ -365,13 +365,13 @@
                 <soap:body use="literal"/>
             </output>
             <fault name="SimpleFault1">
-                <soap:fault use="literal"/>
+                <soap:fault name="SimpleFault1" use="literal"/>
             </fault>
             <fault name="SimpleFault2">
-                <soap:fault use="literal"/>
+                <soap:fault name="SimpleFault2" use="literal"/>
             </fault>
             <fault name="SimpleFault3">
-                <soap:fault use="literal"/>
+                <soap:fault name="SimpleFault3" use="literal"/>
             </fault>
             <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
         </operation>
@@ -384,10 +384,10 @@
                 <soap:body use="literal"/>
             </output>
             <fault name="SimpleFault1">
-                <soap:fault use="literal"/>
+                <soap:fault name="SimpleFault1" use="literal"/>
             </fault>
             <fault name="SimpleFault2">
-                <soap:fault use="literal"/>
+                <soap:fault name="SimpleFault2" use="literal"/>
             </fault>
             <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
         </operation>
@@ -400,10 +400,10 @@
                 <soap:body use="literal"/>
             </output>
             <fault name="SimpleFault1">
-                <soap:fault use="literal"/>
+                <soap:fault name="SimpleFault1" use="literal"/>
             </fault>
             <fault name="SimpleFault2">
-                <soap:fault use="literal"/>
+                <soap:fault name="SimpleFault2" use="literal"/>
             </fault>
             <soap:operation soapAction="http://soapinterop.org/r4/groupg/"/>
         </operation>



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