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 am...@apache.org on 2006/12/18 09:34:16 UTC

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

Author: amilas
Date: Mon Dec 18 00:34:15 2006
New Revision: 488152

URL: http://svn.apache.org/viewvc?view=rev&rev=488152
Log:
fixed the issue 1882. add code to WSDL11ToAxisServiceBuilder.java to pick the fault element using the saap:fault name 
attribute instead of fault name attribute.

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

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java?view=diff&rev=488152&r1=488151&r2=488152
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java Mon Dec 18 00:34:15 2006
@@ -516,10 +516,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/trunk/java/modules/xmlbeans/test-resources/simple-doc-literal.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/xmlbeans/test-resources/simple-doc-literal.wsdl?view=diff&rev=488152&r1=488151&r2=488152
==============================================================================
--- webservices/axis2/trunk/java/modules/xmlbeans/test-resources/simple-doc-literal.wsdl (original)
+++ webservices/axis2/trunk/java/modules/xmlbeans/test-resources/simple-doc-literal.wsdl Mon Dec 18 00:34:15 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