axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kei...@apache.org
Subject svn commit: r486566 - 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 Wed, 13 Dec 2006 09:44:05 GMT
Author: keithc
Date: Wed Dec 13 01:44:03 2006
New Revision: 486566

URL: http://svn.apache.org/viewvc?view=rev&rev=486566
Log:
added SOAPModuleMessage class to capture details of soap modules
added httpBinding specific properties to intermidiate XML

Added:
    webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/wsdl/SOAPModuleMessage.java
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

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=486566&r1=486565&r2=486566
==============================================================================
--- 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 Dec 13 01:44:03 2006
@@ -7,6 +7,7 @@
 import org.apache.axis2.wsdl.SOAPHeaderMessage;
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.axis2.wsdl.WSDLUtil;
+import org.apache.axis2.wsdl.SOAPModuleMessage;
 import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
 import org.apache.axis2.wsdl.codegen.CodeGenerationException;
 import org.apache.axis2.wsdl.codegen.writer.*;
@@ -209,6 +210,10 @@
 
     private Object getBindingPropertyFromMessage(String name, QName qName, String key) {
 
+        if (name.equalsIgnoreCase(WSDL2Constants.ATTR_WSOAP_MODULE) && qName.getLocalPart().equalsIgnoreCase("echostring")){
+            System.out.println("");
+        }
+
         Object property = null;
         // Get the correct AxisBindingOperation coresponding to the AxisOperation
         AxisBindingOperation axisBindingOperation =
@@ -605,7 +610,7 @@
         doc.appendChild(rootElement);
 
         //////////////////////////////////////////////////////////
-//        System.out.println(DOM2Writer.nodeToString(rootElement));
+        System.out.println(DOM2Writer.nodeToString(rootElement));
         ////////////////////////////////////////////////////////////
         return doc;
     }
@@ -1889,6 +1894,34 @@
                 axisOperation));
 
         setTransferCoding(axisOperation, methodElement, doc);
+        
+        if (axisBinding.getType().equals(WSDL2Constants.URI_WSDL2_HTTP)) {
+            
+            String property = (String) getBindingPropertyFromOperation(WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,
+                        axisOperation.getName());
+            if (property != null) {
+            methodElement.appendChild(generateOptionParamComponent(doc,"WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR",
"\"" + property + "\""));
+            }
+
+            property = (String) getBindingPropertyFromOperation(WSDL2Constants.ATTR_WHTTP_METHOD,
+                        axisOperation.getName());
+            if (property != null) {
+            methodElement.appendChild(generateOptionParamComponent(doc,"WSDL2Constants.ATTR_WHTTP_METHOD",
"\"" + property + "\""));
+            }
+
+            property = (String) getBindingPropertyFromOperation(WSDL2Constants.ATTR_WHTTP_CODE,
+                        axisOperation.getName());
+            if (property != null) {
+            methodElement.appendChild(generateOptionParamComponent(doc,"WSDL2Constants.ATTR_WHTTP_CODE",
"\"" + property + "\""));
+            }
+
+            property = (String) getBindingPropertyFromOperation(WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION,
+                        axisOperation.getName());
+            if (property != null) {
+            methodElement.appendChild(generateOptionParamComponent(doc,"WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION",
"\"" + property + "\""));
+            }
+
+        }
         return methodElement;
     }
 
@@ -2185,6 +2218,7 @@
 
             List parameterElementList = getParameterElementList(doc, headerParameterQNameList,
WSDLConstants.SOAP_HEADER);
             parameterElementList.addAll(getParameterElementListForHttpHeader(doc, (ArrayList)
getBindingPropertyFromMessage(WSDL2Constants.ATTR_WHTTP_HEADER, operation.getName(), WSDLConstants.WSDL_MESSAGE_DIRECTION_IN),
WSDLConstants.HTTP_HEADER));
+            parameterElementList.addAll(getParameterElementListForSOAPModules(doc, (ArrayList)getBindingPropertyFromMessage(WSDL2Constants.ATTR_WSOAP_MODULE,
operation.getName(), WSDLConstants.WSDL_MESSAGE_DIRECTION_IN)));
 
             for (int i = 0; i < parameterElementList.size(); i++) {
                 inputElt.appendChild((Element) parameterElementList.get(i));
@@ -2638,6 +2672,28 @@
 
                 addAttribute(doc, "type", typeMappingStr, param);
                 addAttribute(doc, "location", location, param);
+                parameterElementList.add(param);
+            }
+        }
+
+        return parameterElementList;
+    }
+
+    protected List getParameterElementListForSOAPModules(Document doc, List parameters) {
+
+        List parameterElementList = new ArrayList();
+
+        if ((parameters != null) && !parameters.isEmpty()) {
+            int count = parameters.size();
+
+            for (int i = 0; i < count; i++) {
+                Element param = doc.createElement("param");
+                SOAPModuleMessage soapModuleMessage = (SOAPModuleMessage) parameters.get(i);
+
+                // header name is to set the header value
+                addAttribute(doc, "uri", soapModuleMessage.getUri(), param);
+
+                addAttribute(doc, "location", "wsoap_module", param);
                 parameterElementList.add(param);
             }
         }

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=486566&r1=486565&r2=486566
==============================================================================
--- 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 Dec 13 01:44:03 2006
@@ -7,18 +7,15 @@
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.axis2.wsdl.SOAPHeaderMessage;
 import org.apache.axis2.wsdl.HTTPHeaderMessage;
+import org.apache.axis2.wsdl.SOAPModuleMessage;
 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.internal.wsdl20.extensions.http.HTTPHeaderImpl;
 import org.apache.woden.schema.Schema;
 import org.apache.woden.wsdl20.*;
 import org.apache.woden.wsdl20.enumeration.Direction;
 import org.apache.woden.wsdl20.enumeration.MessageLabel;
-import org.apache.woden.wsdl20.extensions.ExtensionElement;
-import org.apache.woden.wsdl20.extensions.UnknownExtensionElement;
 import org.apache.woden.wsdl20.extensions.http.HTTPBindingFaultExtensions;
 import org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions;
 import org.apache.woden.wsdl20.extensions.http.HTTPBindingMessageReferenceExtensions;
@@ -27,7 +24,6 @@
 import org.apache.woden.wsdl20.xml.*;
 import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.utils.NamespaceMap;
-import org.apache.http.Header;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
@@ -438,7 +434,7 @@
         axisBinding.setProperty(WSDL2Constants.ATTR_WHTTP_TRANSFER_CODING,
                 soapBindingExtensions.getHttpTransferCodingDefault());
         axisBinding.setProperty(WSDL2Constants.ATTR_WSOAP_MODULE,
-                soapBindingExtensions.getSoapModules());
+                createSoapModules(soapBindingExtensions.getSoapModules()));
 
         // Capture all the fault specific properties
 
@@ -471,7 +467,7 @@
             axisBindingFault.setProperty(WSDL2Constants.ATTR_WSOAP_HEADER,
                     createSoapHeaders(soapBindingFaultExtensions.getSoapHeaders()));
             axisBindingFault.setProperty(WSDL2Constants.ATTR_WSOAP_MODULE,
-                    soapBindingFaultExtensions.getSoapModules());
+                    createSoapModules(soapBindingFaultExtensions.getSoapModules()));
 
             axisBinding.addFault(axisBindingFault);
 
@@ -506,7 +502,7 @@
                         soapAction.toString());
             }
             axisBindingOperation.setProperty(WSDL2Constants.ATTR_WSOAP_MODULE,
-                    soapBindingOperationExtensions.getSoapModules());
+                    createSoapModules(soapBindingOperationExtensions.getSoapModules()));
             URI soapMep = soapBindingOperationExtensions.getSoapMep();
             if (soapMep != null) {
                 axisBindingOperation.setProperty(WSDL2Constants.ATTR_WSOAP_MEP,
@@ -554,7 +550,7 @@
                 axisBindingMessage.setProperty(WSDL2Constants.ATTR_WSOAP_HEADER,
                         createSoapHeaders(soapBindingMessageReferenceExtensions.getSoapHeaders()));
                 axisBindingMessage.setProperty(WSDL2Constants.ATTR_WSOAP_MODULE,
-                        soapBindingMessageReferenceExtensions.getSoapModules());
+                        createSoapModules(soapBindingMessageReferenceExtensions.getSoapModules()));
 
 //                    SOAPHeaderBlock[] soapHeaders = soapHeaderExt.getSoapHeaders();
 //
@@ -598,7 +594,7 @@
                 }
 
                 axisBindingMessageFault.setProperty(WSDL2Constants.ATTR_WSOAP_MODULE,
-                        soapBindingFaultReferenceExtensions.getSoapModules());
+                        createSoapModules(soapBindingFaultReferenceExtensions.getSoapModules()));
 
                 axisBindingOperation.addFault(axisBindingMessageFault);
 
@@ -1256,6 +1252,9 @@
      * @return ArrayList - An ArrayList of SOAPHeaderMessage objects
      */
     private ArrayList createSoapHeaders(SOAPHeaderBlock soapHeaderBlocks[]) {
+
+        if (soapHeaderBlocks.length ==0)
+        return null;
         ArrayList soapHeaderMessages = new ArrayList();
 
         for (int i = 0; i < soapHeaderBlocks.length; i++) {
@@ -1273,11 +1272,34 @@
     }
 
     /**
+     * Convert woden dependent SOAPHeaderBlock objects to SOAPHeaderMessage objects
+     * @param soapModules - An array of SOAPModule objects
+     * @return ArrayList - An ArrayList of SOAPHeaderMessage objects
+     */
+    private ArrayList createSoapModules(SOAPModule soapModules[]) {
+
+        if (soapModules.length ==0)
+        return null;
+        ArrayList soapModuleMessages = new ArrayList();
+
+        for (int i = 0; i < soapModules.length; i++) {
+            SOAPModule soapModule = soapModules[i];
+            SOAPModuleMessage soapModuleMessage = new SOAPModuleMessage();
+            soapModuleMessage.setUri(soapModule.getRef().toString());
+            soapModuleMessages.add(soapModuleMessage);
+        }
+        return soapModuleMessages;
+    }
+
+    /**
      * Convert woden dependent HTTPHeader objects to Header objects
      * @param httpHeaders - An array of HTTPHeader objects
      * @return ArrayList - An ArrayList of Header objects
      */
     private ArrayList createHttpHeaders(HTTPHeader httpHeaders[]) {
+
+        if (httpHeaders.length ==0)
+        return null;
         ArrayList httpHeaderMessages = new ArrayList();
 
         for (int i = 0; i < httpHeaders.length; i++) {

Added: webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/wsdl/SOAPModuleMessage.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/wsdl/SOAPModuleMessage.java?view=auto&rev=486566
==============================================================================
--- webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/wsdl/SOAPModuleMessage.java
(added)
+++ webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/wsdl/SOAPModuleMessage.java
Wed Dec 13 01:44:03 2006
@@ -0,0 +1,34 @@
+package org.apache.axis2.wsdl;
+
+
+/*
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*
+*/
+
+public class SOAPModuleMessage {
+
+    private String uri;
+
+
+    public String getUri() {
+        return uri;
+    }
+
+    public void setUri(String uri) {
+        this.uri = uri;
+    }
+}



---------------------------------------------------------------------
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