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 aj...@apache.org on 2006/07/06 15:57:22 UTC

svn commit: r419555 [2/2] - in /webservices/axis2/trunk/java: etc/ modules/adb-codegen/src/org/apache/axis2/schema/ modules/adb-codegen/src/org/apache/axis2/schema/template/ modules/adb/src/org/apache/axis2/databinding/ modules/codegen/src/org/apache/a...

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java?rev=419555&r1=419554&r2=419555&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java Thu Jul  6 06:57:21 2006
@@ -310,12 +310,24 @@
             processPortType(portType, dif);
 
             List list = binding.getBindingOperations();
-
             for (int i = 0; i < list.size(); i++) {
                 BindingOperation wsdl4jBindingOperation = (BindingOperation) list
                         .get(i);
                 AxisOperation operation = axisService.getOperation(new QName(
                         wsdl4jBindingOperation.getName()));
+
+                // this should first check the style of the binding
+                // and then set the style in the axis operation
+                // if that is not present, then only the global style applies
+                // this style is either rpc or doc
+                
+                String style  = getSOAPStyle(wsdl4jBindingOperation);
+                if (style!= null){
+                   operation.setStyle(style);
+                }else if (this.style != null){
+                    operation.setStyle(this.style);
+                }
+
                 copyExtensibleElements(wsdl4jBindingOperation
                         .getExtensibilityElements(), dif, operation,
                         BINDING_OPERATION);
@@ -326,7 +338,7 @@
                         .getBindingOutput();
                 String MEP = operation.getMessageExchangePattern();
                 if (bindingInput != null) {
-                    if (WSDLUtil.isInputPresentForMEP(MEP)) {
+                    if (WSDLUtil.isInputPresentForMEP(MEP)){
                         AxisMessage inMessage = operation
                                 .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
                         copyExtensibleElements(bindingInput
@@ -349,6 +361,25 @@
     }
 
     /**
+     * A util method that returns the SOAP style
+     * included in the binding operation
+     * @param bindingOp
+     * @return
+     */
+    private String getSOAPStyle(BindingOperation bindingOp){
+        List extensibilityElements = bindingOp.getExtensibilityElements();
+        for (int i = 0; i < extensibilityElements.size(); i++) {
+            Object extElement =  extensibilityElements.get(i);
+            if (extElement instanceof SOAPOperation){
+                return ((SOAPOperation)extElement).getStyle();
+            }
+
+        }
+
+        return null;
+
+    }
+    /**
      * Simply Copy information.
      *
      * @param wsdl4jPortType
@@ -403,9 +434,6 @@
             pi.setPolicyRegistry(registry);
         }
 
-        if (style != null) {
-            axisOperation.setStyle(style);
-        }
         copyExtensibleElements(wsdl4jOperation.getExtensibilityElements(), dif,
                 axisOperation, PORT_TYPE_OPERATION);
 
@@ -1374,28 +1402,19 @@
                 binding.getBindingOperations().iterator();
              bindingOperationsIterator.hasNext();) {
             bindingOp = (BindingOperation) bindingOperationsIterator.next();
-            for (Iterator extElementsIterator =
-                    bindingOp.getExtensibilityElements().iterator();
-                 extElementsIterator.hasNext();) {
-                ExtensibilityElement extElt = (ExtensibilityElement)
-                        extElementsIterator.next();
-                if (extElt instanceof SOAPOperation) {
-                    SOAPOperation soapOperation = (SOAPOperation) extElt;
-                    if (RPC_STYLE.equals(soapOperation.getStyle())) {
-                        //add to the list
-                        returnList.add(bindingOp.getOperation());
-                    } else if (DOCUMENT_STYLE.equals(soapOperation.getStyle())) {
-                        //do nothing - just pass it through
-                    } else {
-                        //no style specified
-                        //use the global style to determine whether to put this one or not
-                        if (isRPC) {
-                            returnList.add(bindingOp.getOperation());
-                        }
-                    }
+            String style = getSOAPStyle(bindingOp) ;
 
-                }
+            if (style == null){
+                //no style specified
+                //use the global style to determine whether to put this one or not
+                if (isRPC){
+                    returnList.add(bindingOp.getOperation());
+                }
+            }else if (RPC_STYLE.equals(style)){
+                //add to the list
+                returnList.add(bindingOp.getOperation());
             }
+            // if not RPC we just leave it - default is doc
 
         }
 
@@ -1552,4 +1571,4 @@
         }
     }
 
-}
\ No newline at end of file
+}

Modified: webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java?rev=419555&r1=419554&r2=419555&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java (original)
+++ webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java Thu Jul  6 06:57:21 2006
@@ -382,6 +382,7 @@
     }
 
     /**
+     * Get an array of schema documents
      * @param vec
      * @return
      */
@@ -438,6 +439,7 @@
 
     /**
      * Implementation of the entity resolver
+     * A custom entity resolver for XMLBeans
      */
     private static class Axis2EntityResolver implements EntityResolver {
         private SchemaDocument[] schemas;
@@ -453,7 +455,6 @@
          * @see EntityResolver#resolveEntity(String, String)
          */
         public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
-            //System.out.println("Lookup:" + "[ " + publicId + "]" + "[" + systemId + "]");
             try {
                 for (int i = 0; i < schemas.length; i++){
                     SchemaDocument.Schema schema = schemas[i].getSchema();



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