You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ke...@apache.org on 2006/11/30 06:14:41 UTC

svn commit: r480839 - in /webservices/axis2/branches/java/WSDL_2_0/modules: codegen/src/org/apache/axis2/wsdl/codegen/emitter/ kernel/src/org/apache/axis2/description/ kernel/src/org/apache/axis2/wsdl/

Author: keithc
Date: Wed Nov 29 21:14:40 2006
New Revision: 480839

URL: http://svn.apache.org/viewvc?view=rev&rev=480839
Log:
added the utilyty method getBindingPropertyFromMessage

Modified:
    webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
    webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
    webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/wsdl/WSDLConstants.java

Modified: webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?view=diff&rev=480839&r1=480838&r2=480839
==============================================================================
--- webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java (original)
+++ webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java Wed Nov 29 21:14:40 2006
@@ -179,7 +179,7 @@
         this.mapper = mapper;
     }
 
-    private Object getAxisBindingProperty(String name, QName qName) {
+    private Object getBindingPropertyFromOperation(String name, QName qName) {
 
         // Get the correct AxisBindingOperation coresponding to the AxisOperation
         AxisBindingOperation axisBindingOperation = (AxisBindingOperation) axisBinding.getChild(qName);
@@ -196,6 +196,28 @@
         return property;
     }
 
+    private Object getBindingPropertyFromMessage(String name, QName qName, String key) {
+
+        // Get the correct AxisBindingOperation coresponding to the AxisOperation
+        AxisBindingOperation axisBindingOperation = (AxisBindingOperation) axisBinding.getChild(qName);
+        AxisBindingMessage axisBindingMessage = (AxisBindingMessage) axisBindingOperation.getChild(key);
+        Object property = axisBindingMessage.getProperty(name);
+
+        if (property == null) {
+            property = axisBindingOperation.getProperty(name);
+        }
+
+        if (property == null) {
+            property = axisBinding.getProperty(name);
+        }
+
+        if (property == null) {
+            property = WSDL20DefaultValueHolder.getDefaultValue(name);
+        }
+
+        return property;
+    }
+
 
     /**
      * Update mapper for the stub
@@ -1680,7 +1702,7 @@
             // message receiver to use, etc.,
 
 
-            String messageExchangePattern = (String) getAxisBindingProperty(WSDL2Constants.ATTR_WSOAP_MEP, axisOperation.getName());
+            String messageExchangePattern = (String) getBindingPropertyFromOperation(WSDL2Constants.ATTR_WSOAP_MEP, axisOperation.getName());
             if (infoHolder.get(messageExchangePattern) == null) {
                 infoHolder.put(messageExchangePattern, Boolean.TRUE);
             }
@@ -1728,7 +1750,7 @@
         addAttribute(doc, "style", axisOperation.getStyle(), methodElement);
         addAttribute(doc, "dbsupportname", endpointName + localPart + DATABINDING_SUPPORTER_NAME_SUFFIX,
                 methodElement);
-        String messageExchangePattern = (String) getAxisBindingProperty(WSDL2Constants.ATTR_WSOAP_MEP, axisOperation.getName());
+        String messageExchangePattern = (String) getBindingPropertyFromOperation(WSDL2Constants.ATTR_WSOAP_MEP, axisOperation.getName());
         addAttribute(doc, "mep", Utils.getAxisSpecifMEPConstant(messageExchangePattern) + "", methodElement);
         addAttribute(doc, "mepURI", messageExchangePattern, methodElement);
 
@@ -1901,7 +1923,7 @@
      * @param qName
      */
     protected void addSOAPAction(Document doc, Element rootElement, QName qName) {
-        addAttribute(doc, "soapaction", (String) getAxisBindingProperty(WSDL2Constants.ATTR_WSOAP_ACTION, qName), rootElement);
+        addAttribute(doc, "soapaction", (String) getBindingPropertyFromOperation(WSDL2Constants.ATTR_WSOAP_ACTION, qName), rootElement);
     }
 
     /**
@@ -1940,15 +1962,18 @@
     protected void addHeaderOperations(List soapHeaderParameterQNameList, AxisOperation axisOperation,
                                        boolean input) {
         ArrayList headerparamList = new ArrayList();
-        String MEP = axisOperation.getMessageExchangePattern();
+        String MEP = (String)getBindingPropertyFromOperation(WSDL2Constants.ATTR_WSOAP_MEP,axisOperation.getName());
         if (input) {
             if (WSDLUtil.isInputPresentForMEP(MEP)) {
-                AxisMessage inaxisMessage = axisOperation
-                        .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
-                if (inaxisMessage != null) {
-                    headerparamList = inaxisMessage.getSoapHeaders();
 
-                }
+                Object header = getBindingPropertyFromMessage(WSDL2Constants.ATTR_WHTTP_HEADER,axisOperation.getName(),WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+//                AxisMessage inaxisMessage = axisOperation
+//                        .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+//                if (inaxisMessage != null) {
+//                    headerparamList = inaxisMessage.getSoapHeaders();
+//
+//                }
+                System.out.println("ok");
             }
         } else {
             if (WSDLUtil.isOutputPresentForMEP(MEP)) {
@@ -1976,7 +2001,7 @@
      */
     protected Element getInputElement(Document doc, AxisOperation operation, List headerParameterQNameList) {
         Element inputElt = doc.createElement("input");
-        String mep = (String) getAxisBindingProperty(WSDL2Constants.ATTR_WSOAP_MEP, operation.getName());
+        String mep = (String) getBindingPropertyFromOperation(WSDL2Constants.ATTR_WSOAP_MEP, operation.getName());
 
         if (WSDLUtil.isInputPresentForMEP(mep)) {
 
@@ -2041,7 +2066,7 @@
      */
     protected Element getOutputElement(Document doc, AxisOperation operation, List headerParameterQNameList) {
         Element outputElt = doc.createElement("output");
-        String mep = (String) getAxisBindingProperty(WSDL2Constants.ATTR_WSOAP_MEP, operation.getName());
+        String mep = (String) getBindingPropertyFromOperation(WSDL2Constants.ATTR_WSOAP_MEP, operation.getName());
 
 
         if (WSDLUtil.isOutputPresentForMEP(mep)) {

Modified: webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java?view=diff&rev=480839&r1=480838&r2=480839
==============================================================================
--- webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java (original)
+++ webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java Wed Nov 29 21:14:40 2006
@@ -563,7 +563,7 @@
 //                            }
 //                        }
 
-                axisBindingOperation.addChild(axisBindingMessage.getName(),axisBindingMessage);
+                axisBindingOperation.addChild(axisMessage.getKey(), axisBindingMessage);
 
 
             }

Modified: webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/wsdl/WSDLConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/wsdl/WSDLConstants.java?view=diff&rev=480839&r1=480838&r2=480839
==============================================================================
--- webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/wsdl/WSDLConstants.java (original)
+++ webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/wsdl/WSDLConstants.java Wed Nov 29 21:14:40 2006
@@ -131,7 +131,7 @@
 
 
 
-    public static interface WSDL20_2006Constants {
+    public static interface WSDL20_2006Constants {                                  
 
         // http://www.w3.org/TR/2006/CR-wsdl20-adjuncts-20060327/#in-only
         String MEP_URI_IN_ONLY = "http://www.w3.org/2006/01/wsdl/in-only";



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