ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r202379 - in /webservices/axis/trunk/java/modules/wsdl/src/org/apache: axis/wsdl/codegen/emitter/MultiLanguageClientEmitter.java axis/wsdl/codegen/extension/XMLBeansExtension.java wsdl/WSDLConstants.java
Date Wed, 29 Jun 2005 14:14:13 GMT
Author: ajith
Date: Wed Jun 29 07:14:12 2005
New Revision: 202379

URL: http://svn.apache.org/viewcvs?rev=202379&view=rev
Log:
Added a use='encoded' check.For now the code generated does not support 'encoded' and the
codegenerator now throws an exception if encoded is used anywhere as the style

Modified:
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/MultiLanguageClientEmitter.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/extension/XMLBeansExtension.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/WSDLConstants.java

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/MultiLanguageClientEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/MultiLanguageClientEmitter.java?rev=202379&r1=202378&r2=202379&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/MultiLanguageClientEmitter.java
(original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/MultiLanguageClientEmitter.java
Wed Jun 29 07:14:12 2005
@@ -8,6 +8,7 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.Enumeration;
 
 import org.apache.axis.wsdl.codegen.CodeGenConfiguration;
 import org.apache.axis.wsdl.codegen.CodeGenerationException;
@@ -37,8 +38,10 @@
 import org.apache.wsdl.WSDLOperation;
 import org.apache.wsdl.WSDLService;
 import org.apache.wsdl.WSDLTypes;
+import org.apache.wsdl.WSDLConstants;
 import org.apache.wsdl.extensions.ExtensionConstants;
 import org.apache.wsdl.extensions.SOAPOperation;
+import org.apache.wsdl.extensions.SOAPBody;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
 import org.w3c.dom.Text;
@@ -131,7 +134,9 @@
                     throw new UnsupportedOperationException("Single service WSDL files only");
                 }
             }
-
+            //
+            testCompatibiltyAll(axisBinding);
+            //
             writeInterface(axisBinding);
             //write interface implementations
             writeInterfaceImplementation(axisBinding,axisService);
@@ -356,6 +361,8 @@
         try {
             //get the binding
             WSDLBinding axisBinding = this.configuration.getWom().getBinding(AxisBindingBuilder.AXIS_BINDING_QNAME);
+            //
+            testCompatibiltyAll(axisBinding);
             //write interfaces
             writeSkeleton(axisBinding);
             //write interface implementations
@@ -561,15 +568,20 @@
             addAttribute(doc,"namespace",operation.getName().getNamespaceURI(),methodElement);
             addAttribute(doc,"style",operation.getStyle(),methodElement);
             addAttribute(doc,"dbsupportname",localPart+DATABINDING_SUPPORTER_NAME_SUFFIX,methodElement);
-            if(null != binding)
-            	addSOAPAction(doc,methodElement,binding.getBindingOperation(operation.getName()));
-            addAttribute(doc, "mep",operation.getMessageExchangePattern(), methodElement);
-             methodElement.appendChild(getInputElement(doc,operation));
+            if(null != binding){
+                WSDLBindingOperation bindingOperation = binding.getBindingOperation(operation.getName());
+                addSOAPAction(doc,methodElement,bindingOperation);
+                testCompatibilityInput(bindingOperation);
+                testCompatibilityOutput(bindingOperation);
+            }
+            addAttribute(doc,"mep",operation.getMessageExchangePattern(), methodElement);
+            methodElement.appendChild(getInputElement(doc,operation));
             methodElement.appendChild(getOutputElement(doc,operation));
             rootElement.appendChild(methodElement);
         }
     }
 
+
    private void addSOAPAction(XmlDocument doc,Element rootElement,WSDLBindingOperation binding){
     		Iterator extIterator = binding.getExtensibilityElements().iterator();
             boolean actionAdded = false;
@@ -716,5 +728,42 @@
         return word.replaceAll("\\W","_");
     }
 
+    private void testCompatibiltyAll(WSDLBinding binding){
+         HashMap map = binding.getBindingOperations();
+         WSDLBindingOperation bindingOp;
+         Collection col = map.values();
+         for (Iterator iterator = col.iterator(); iterator.hasNext();) {
+             bindingOp =  (WSDLBindingOperation)iterator.next();
+             testCompatibilityInput(bindingOp);
+             testCompatibilityOutput(bindingOp);
+         }
+
+
+    }
+    private void testCompatibilityInput(WSDLBindingOperation binding){
+
+    		Iterator extIterator = binding.getInput().getExtensibilityElements().iterator();
+           while(extIterator.hasNext()){
+    			WSDLExtensibilityElement element = (WSDLExtensibilityElement)extIterator.next();
+    			if(element.getType().equals(ExtensionConstants.SOAP_BODY)){
+                    if(WSDLConstants.WSDL_USE_ENCODED.equals(((SOAPBody)element).getUse())){
+                        throw new RuntimeException("The use 'encoded' is not supported!");
+                    }
+    			}
+    		}
+    }
+
+     private void testCompatibilityOutput(WSDLBindingOperation binding){
+
+    		Iterator extIterator = binding.getOutput().getExtensibilityElements().iterator();
+           while(extIterator.hasNext()){
+    			WSDLExtensibilityElement element = (WSDLExtensibilityElement)extIterator.next();
+    			if(element.getType().equals(ExtensionConstants.SOAP_BODY)){
+                    if(WSDLConstants.WSDL_USE_ENCODED.equals(((SOAPBody)element).getUse())){
+                        throw new RuntimeException("The use 'encoded' is not supported!");
+                    }
+    			}
+    		}
+    }
 }
 

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/extension/XMLBeansExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/extension/XMLBeansExtension.java?rev=202379&r1=202378&r2=202379&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/extension/XMLBeansExtension.java
(original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/extension/XMLBeansExtension.java
Wed Jun 29 07:14:12 2005
@@ -14,6 +14,7 @@
 import org.apache.wsdl.extensions.ExtensionConstants;
 import org.apache.wsdl.extensions.Schema;
 import org.apache.wsdl.WSDLExtensibilityElement;
+import org.apache.wsdl.WSDLTypes;
 import org.w3c.dom.Element;
 
 import javax.wsdl.extensions.ExtensibilityElement;
@@ -51,7 +52,12 @@
     }
 
     public void engage() {
-        List typesArray = configuration.getWom().getTypes().getExtensibilityElements();
+        WSDLTypes typesList = configuration.getWom().getTypes();
+        if (typesList==null){
+            //there are no types to be code generated
+            return;
+        }
+        List typesArray = typesList.getExtensibilityElements();
         WSDLExtensibilityElement extensiblityElt = null;
         XmlObject[] xmlObjects=new XmlObject[typesArray.size()];
 
@@ -108,10 +114,10 @@
             configuration.setTypeMapper(mapper);
 
         } catch (XmlException e) {
-           throw new RuntimeException(e);
+            throw new RuntimeException(e);
         }
-
     }
+
 
 
 }

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/WSDLConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/WSDLConstants.java?rev=202379&r1=202378&r2=202379&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/WSDLConstants.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/WSDLConstants.java Wed Jun
29 07:14:12 2005
@@ -127,5 +127,13 @@
 	public static final int MESSAGE_LABEL_OUT = 1;
 	
 	public static final String MESSAGE_LABEL_OUT_VALUE = "Out";
-	
+
+    /**
+     *
+     */
+    public static final String WSDL_USE_LITERAL="literal";
+    public static final String WSDL_USE_ENCODED="encoded";
+
+
+
 }



Mime
View raw message