axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kei...@apache.org
Subject svn commit: r480887 - 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/
Date Thu, 30 Nov 2006 10:57:14 GMT
Author: keithc
Date: Thu Nov 30 02:57:10 2006
New Revision: 480887

URL: http://svn.apache.org/viewvc?view=rev&rev=480887
Log:
modified addHeaderOperations to use new binding structure

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=480887&r1=480886&r2=480887
==============================================================================
--- 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
Thu Nov 30 02:57:10 2006
@@ -1979,23 +1979,13 @@
         if (input) {
             if (WSDLUtil.isInputPresentForMEP(MEP)) {
 
-                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");
-            }
+                headerparamList = (ArrayList) getBindingPropertyFromMessage(WSDL2Constants.ATTR_WSOAP_HEADER,axisOperation.getName(),
WSDLConstants.WSDL_MESSAGE_DIRECTION_IN);
+
+        }
         } else {
             if (WSDLUtil.isOutputPresentForMEP(MEP)) {
-                AxisMessage outAxisMessage = axisOperation
-                        .getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
-                if (outAxisMessage != null) {
-                    headerparamList = outAxisMessage.getSoapHeaders();
-                }
-            }
+                headerparamList = (ArrayList)getBindingPropertyFromMessage(WSDL2Constants.ATTR_WSOAP_HEADER,axisOperation.getName(),WSDLConstants.WSDL_MESSAGE_DIRECTION_OUT);
+          }
         }
 
         for (Iterator iterator = headerparamList.iterator(); iterator.hasNext();) {

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=480887&r1=480886&r2=480887
==============================================================================
--- 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
Thu Nov 30 02:57:10 2006
@@ -5,9 +5,11 @@
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.namespace.Constants;
 import org.apache.axis2.wsdl.WSDLConstants;
+import org.apache.axis2.wsdl.SOAPHeaderMessage;
 import org.apache.woden.*;
 import org.apache.woden.internal.DOMWSDLFactory;
 import org.apache.woden.internal.wsdl20.extensions.soap.SOAPBindingExtensionsImpl;
+import org.apache.woden.internal.wsdl20.extensions.soap.SOAPHeaderBlockImpl;
 import org.apache.woden.internal.wsdl20.extensions.http.HTTPBindingExtensionsImpl;
 import org.apache.woden.schema.Schema;
 import org.apache.woden.wsdl20.*;
@@ -465,7 +467,7 @@
             axisBindingFault.setProperty(WSDL2Constants.ATTR_WSOAP_SUBCODES,
                     soapBindingFaultExtensions.getSoapFaultSubcodes());
             axisBindingFault.setProperty(WSDL2Constants.ATTR_WSOAP_HEADER,
-                    soapBindingFaultExtensions.getSoapHeaders());
+                    createSoapHeaders(soapBindingFaultExtensions.getSoapHeaders()));
             axisBindingFault.setProperty(WSDL2Constants.ATTR_WSOAP_MODULE,
                     soapBindingFaultExtensions.getSoapModules());
 
@@ -553,7 +555,7 @@
                 axisBindingMessage.setProperty(WSDL2Constants.ATTR_WHTTP_TRANSFER_CODING,
                         soapBindingMessageReferenceExtensions.getHttpTransferCoding());
                 axisBindingMessage.setProperty(WSDL2Constants.ATTR_WSOAP_HEADER,
-                        soapBindingMessageReferenceExtensions.getSoapHeaders());
+                        createSoapHeaders(soapBindingMessageReferenceExtensions.getSoapHeaders()));
                 axisBindingMessage.setProperty(WSDL2Constants.ATTR_WSOAP_MODULE,
                         soapBindingMessageReferenceExtensions.getSoapModules());
 
@@ -572,7 +574,7 @@
 //                            }
 //                        }
 
-                axisBindingOperation.addChild(axisMessage.getKey(), axisBindingMessage);
+                axisBindingOperation.addChild(axisMessage.getDirection(), axisBindingMessage);
 
 
             }
@@ -738,7 +740,7 @@
 //                            }
 //                        }
 
-                axisBindingOperation.addChild(axisBindingMessage.getName(),axisBindingMessage);
+                axisBindingOperation.addChild(axisMessage.getDirection(),axisBindingMessage);
 
 
             }
@@ -1254,5 +1256,26 @@
 //        reader.setFeature(WSDLReader.FEATURE_VERBOSE, false);
         return reader.readWSDL(wsdlURI);
     }
+
+    private ArrayList createSoapHeaders(SOAPHeaderBlock soapHeaderBlocks[]) {
+
+        ArrayList soapHeaderMessages = new ArrayList();
+
+        for (int i = 0; i < soapHeaderBlocks.length; i++) {
+            SOAPHeaderBlock soapHeaderBlock = soapHeaderBlocks[i];
+            ElementDeclaration elementDeclaration = soapHeaderBlock.getElementDeclaration();
+
+            if (elementDeclaration != null) {
+                QName name = elementDeclaration.getName();
+                SOAPHeaderMessage soapHeaderMessage = new SOAPHeaderMessage(name);
+                soapHeaderMessage.setRequired(soapHeaderBlock.isRequired().booleanValue());
+                soapHeaderMessages.add(soapHeaderMessage);
+            }
+        }
+
+        return soapHeaderMessages;
+    }
+
+
 
 }

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=480887&r1=480886&r2=480887
==============================================================================
--- 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
Thu Nov 30 02:57:10 2006
@@ -45,6 +45,11 @@
      */
     public static final String WSDL_MESSAGE_DIRECTION_IN = "in";
 
+    public static final String WSDL_MESSAGE_IN_MESSAGE = "inMessage";
+
+    public static final String WSDL_MESSAGE_OUT_MESSAGE = "outMessage";
+
+
 
     /**
      * Field WSDL_MESSAGE_DIRECTION_OUT
@@ -131,7 +136,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


Mime
View raw message