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 ke...@apache.org on 2007/05/08 08:11:22 UTC

svn commit: r536076 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2: deployment/repository/util/ description/ engine/ transport/http/util/ util/

Author: keithc
Date: Mon May  7 23:11:21 2007
New Revision: 536076

URL: http://svn.apache.org/viewvc?view=rev&rev=536076
Log:
Applying fixes in branch to trunk.
Fixing serialization issue in ?wsdl2. Qualifying all top level elements with wsdl namespace.
Fixing nullpointer in AxisService2WSDL2.
REST was not working due to bug in URLTemplating. Fixing it.


Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBinding.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingOperation.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisEndpoint.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisOperation.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL2.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/HTTPLocationBasedDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/URLTemplatingUtil.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java?view=diff&rev=536076&r1=536075&r2=536076
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java Mon May  7 23:11:21 2007
@@ -219,7 +219,7 @@
                     // trying to use the jar scheme as the base URI. I think this can be used to handle
                     // wsdl 1.1 as well without using a custome URI resolver. Need to look at it later.
                     axisServiceBuilder.setBaseUri(
-                            "jar:file://" + serviceArchiveFile.getAbsolutePath() + "!/" + baseURI);
+                            "jar:file://" + serviceArchiveFile.toURI() + "!/" + baseURI);
                 }
             } else {
                 if (serviceArchiveFile != null) {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBinding.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBinding.java?view=diff&rev=536076&r1=536075&r2=536076
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBinding.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBinding.java Mon May  7 23:11:21 2007
@@ -114,12 +114,12 @@
      * @param nameSpaceMap - The namespacemap of the service
      * @return The generated binding element
      */
-    public OMElement toWSDL20(OMNamespace tns, OMNamespace wsoap, OMNamespace whttp,
-                              String interfaceName,  Map nameSpaceMap, String addressingFlag) {
+public OMElement toWSDL20(OMNamespace wsdl, OMNamespace tns, OMNamespace wsoap, OMNamespace whttp,
+                          String interfaceName,  Map nameSpaceMap, String addressingFlag) {
         String property;
         OMFactory omFactory = OMAbstractFactory.getOMFactory();
         OMElement bindingElement;
-        bindingElement = omFactory.createOMElement(WSDL2Constants.BINDING_LOCAL_NAME, null);
+        bindingElement = omFactory.createOMElement(WSDL2Constants.BINDING_LOCAL_NAME, wsdl);
         bindingElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_NAME, null,
                                                                 this.name.getLocalPart()));
         bindingElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.INTERFACE_LOCAL_NAME, null,
@@ -188,7 +188,7 @@
             Iterator iterator = faults.values().iterator();
             while (iterator.hasNext()) {
                 AxisBindingMessage axisBindingFault = (AxisBindingMessage) iterator.next();
-                bindingElement.addChild(axisBindingFault.toWSDL20(tns, wsoap, whttp, nameSpaceMap));
+                bindingElement.addChild(axisBindingFault.toWSDL20(wsdl, tns, wsoap, whttp, nameSpaceMap));
             }
         }
 
@@ -196,7 +196,7 @@
         Iterator iterator = this.getChildren();
         while (iterator.hasNext()) {
             AxisBindingOperation axisBindingOperation = (AxisBindingOperation) iterator.next();
-            bindingElement.addChild(axisBindingOperation.toWSDL20(tns, wsoap, whttp, type, nameSpaceMap));
+            bindingElement.addChild(axisBindingOperation.toWSDL20(wsdl, tns, wsoap, whttp, type, nameSpaceMap));
         }
         return bindingElement;
     }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java?view=diff&rev=536076&r1=536075&r2=536076
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java Mon May  7 23:11:21 2007
@@ -119,7 +119,7 @@
      * @param nameSpaceMap - The namespacemap of the service
      * @return The generated bindingMessage element
      */
-    public OMElement toWSDL20(OMNamespace tns, OMNamespace wsoap, OMNamespace whttp,
+    public OMElement toWSDL20(OMNamespace wsdl, OMNamespace tns, OMNamespace wsoap, OMNamespace whttp,
                               Map nameSpaceMap) {
         String property;
         ArrayList list;
@@ -131,13 +131,13 @@
 
             if (this.getParent() instanceof AxisBinding) {
                 bindingMessageElement =
-                        omFactory.createOMElement(WSDL2Constants.FAULT_LOCAL_NAME, null);
+                        omFactory.createOMElement(WSDL2Constants.FAULT_LOCAL_NAME, wsdl);
             } else if (WSDLConstants.WSDL_MESSAGE_DIRECTION_IN.equals(this.getDirection())) {
                 bindingMessageElement =
-                        omFactory.createOMElement(WSDL2Constants.IN_FAULT_LOCAL_NAME, null);
+                        omFactory.createOMElement(WSDL2Constants.IN_FAULT_LOCAL_NAME, wsdl);
             } else {
                 bindingMessageElement =
-                        omFactory.createOMElement(WSDL2Constants.OUT_FAULT_LOCAL_NAME, null);
+                        omFactory.createOMElement(WSDL2Constants.OUT_FAULT_LOCAL_NAME, wsdl);
             }
             bindingMessageElement.addAttribute(omFactory.createOMAttribute(
                     WSDL2Constants.ATTRIBUTE_REF, null, tns.getPrefix() + ":" + this.name));
@@ -161,12 +161,12 @@
             //Checks whether the message is an input message
         } else if (WSDLConstants.WSDL_MESSAGE_DIRECTION_IN.equals(this.getDirection())) {
             bindingMessageElement =
-                    omFactory.createOMElement(WSDL2Constants.IN_PUT_LOCAL_NAME, null);
+                    omFactory.createOMElement(WSDL2Constants.IN_PUT_LOCAL_NAME, wsdl);
 
             //Message should be an output message
         } else {
             bindingMessageElement =
-                    omFactory.createOMElement(WSDL2Constants.OUT_PUT_LOCAL_NAME, null);
+                    omFactory.createOMElement(WSDL2Constants.OUT_PUT_LOCAL_NAME, wsdl);
         }
 
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingOperation.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingOperation.java?view=diff&rev=536076&r1=536075&r2=536076
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingOperation.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingOperation.java Mon May  7 23:11:21 2007
@@ -114,12 +114,12 @@
      * @param nameSpaceMap - The namespacemap of the service
      * @return The generated binding element
      */
-    public OMElement toWSDL20(OMNamespace tns, OMNamespace wsoap, OMNamespace whttp,
+    public OMElement toWSDL20(OMNamespace wsdl, OMNamespace tns, OMNamespace wsoap, OMNamespace whttp,
                               String type,  Map nameSpaceMap) {
         String property;
         OMFactory omFactory = OMAbstractFactory.getOMFactory();
         OMElement bindingOpElement =
-                omFactory.createOMElement(WSDL2Constants.OPERATION_LOCAL_NAME, null);
+                omFactory.createOMElement(WSDL2Constants.OPERATION_LOCAL_NAME, wsdl);
         bindingOpElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_REF,
                                                                   null, tns.getPrefix() + ":" +
                 this.name.getLocalPart()));
@@ -192,14 +192,14 @@
         AxisBindingMessage inMessage =
                 (AxisBindingMessage) this.getChild(WSDLConstants.WSDL_MESSAGE_DIRECTION_IN);
         if (inMessage != null) {
-            bindingOpElement.addChild(inMessage.toWSDL20(tns, wsoap, whttp, nameSpaceMap));
+            bindingOpElement.addChild(inMessage.toWSDL20(wsdl, tns, wsoap, whttp, nameSpaceMap));
         }
 
         // Add the output element
         AxisBindingMessage outMessage =
                 (AxisBindingMessage) this.getChild(WSDLConstants.WSDL_MESSAGE_DIRECTION_OUT);
         if (outMessage != null) {
-            bindingOpElement.addChild(outMessage.toWSDL20(tns, wsoap, whttp, nameSpaceMap));
+            bindingOpElement.addChild(outMessage.toWSDL20(wsdl, tns, wsoap, whttp, nameSpaceMap));
         }
 
         // Add any fault elements
@@ -208,7 +208,7 @@
             Iterator iterator = faultValues.iterator();
             while (iterator.hasNext()) {
                 AxisBindingMessage faultMessage = (AxisBindingMessage) iterator.next();
-                bindingOpElement.addChild(faultMessage.toWSDL20(tns, wsoap, whttp, nameSpaceMap));
+                bindingOpElement.addChild(faultMessage.toWSDL20(wsdl, tns, wsoap, whttp, nameSpaceMap));
             }
         }
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisEndpoint.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisEndpoint.java?view=diff&rev=536076&r1=536075&r2=536076
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisEndpoint.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisEndpoint.java Mon May  7 23:11:21 2007
@@ -111,10 +111,10 @@
 
     }
 
-    public OMElement toWSDL20(OMNamespace tns, OMNamespace whttp, String epr) {
+    public OMElement toWSDL20(OMNamespace wsdl, OMNamespace tns, OMNamespace whttp, String epr) {
         String property;
         OMFactory omFactory = OMAbstractFactory.getOMFactory();
-        OMElement endpointElement = omFactory.createOMElement(WSDL2Constants.ENDPOINT_LOCAL_NAME, null);
+        OMElement endpointElement = omFactory.createOMElement(WSDL2Constants.ENDPOINT_LOCAL_NAME, wsdl);
         endpointElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_NAME, null, this.getName()));
         endpointElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.BINDING_LOCAL_NAME, null, tns.getPrefix() + ":" + getBinding().getName().getLocalPart()));
         endpointElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_ADDRESS, null, epr));

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisOperation.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisOperation.java?view=diff&rev=536076&r1=536075&r2=536076
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisOperation.java Mon May  7 23:11:21 2007
@@ -642,10 +642,10 @@
      * @param wsdlx - The WSDL extentions namespace (WSDL 2.0)
      * @return The generated binding element
      */
-    public OMElement toWSDL20(OMNamespace tns, OMNamespace wsdlx) {
+    public OMElement toWSDL20(OMNamespace wsdl, OMNamespace tns, OMNamespace wsdlx) {
         OMFactory omFactory = OMAbstractFactory.getOMFactory();
         OMElement axisOperationElement =
-                omFactory.createOMElement(WSDL2Constants.OPERATION_LOCAL_NAME, null);
+                omFactory.createOMElement(WSDL2Constants.OPERATION_LOCAL_NAME, wsdl);
         axisOperationElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_NAME,
                                                                       null,
                                                                       this.getName().getLocalPart()));
@@ -662,7 +662,7 @@
         // Add the input element
         AxisMessage inMessage = (AxisMessage) getChild(WSDLConstants.WSDL_MESSAGE_IN_MESSAGE);
         if (inMessage != null) {
-            OMElement inMessageElement = omFactory.createOMElement(WSDL2Constants.IN_PUT_LOCAL_NAME, null);
+            OMElement inMessageElement = omFactory.createOMElement(WSDL2Constants.IN_PUT_LOCAL_NAME, wsdl);
             inMessageElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_ELEMENT, null, WSDLSerializationUtil.getElementName(inMessage, nameSpaceMap)));
             WSDLSerializationUtil.addWSAWActionAttribute(inMessageElement, getInputAction());
             axisOperationElement.addChild(inMessageElement);
@@ -671,7 +671,7 @@
         // Add the output element
         AxisMessage outMessage = (AxisMessage) getChild(WSDLConstants.WSDL_MESSAGE_OUT_MESSAGE);
         if (outMessage != null) {
-            OMElement outMessageElement = omFactory.createOMElement(WSDL2Constants.OUT_PUT_LOCAL_NAME, null);
+            OMElement outMessageElement = omFactory.createOMElement(WSDL2Constants.OUT_PUT_LOCAL_NAME, wsdl);
             outMessageElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_ELEMENT, null, WSDLSerializationUtil.getElementName(outMessage, nameSpaceMap)));
             WSDLSerializationUtil.addWSAWActionAttribute(outMessageElement, getOutputAction());
             axisOperationElement.addChild(outMessageElement);
@@ -685,9 +685,9 @@
                 AxisMessage faultMessage = (AxisMessage) iterator.next();
                 OMElement faultElement;
                 if (WSDLConstants.WSDL_MESSAGE_DIRECTION_IN.equals(faultMessage.getDirection())) {
-                    faultElement = omFactory.createOMElement(WSDL2Constants.IN_FAULT_LOCAL_NAME, null);
+                    faultElement = omFactory.createOMElement(WSDL2Constants.IN_FAULT_LOCAL_NAME, wsdl);
                 } else {
-                    faultElement = omFactory.createOMElement(WSDL2Constants.OUT_FAULT_LOCAL_NAME, null);
+                    faultElement = omFactory.createOMElement(WSDL2Constants.OUT_FAULT_LOCAL_NAME, wsdl);
                 }
                 faultElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_REF, null, tns.getPrefix() + ":" + faultMessage.getName()));
                 WSDLSerializationUtil.addWSAWActionAttribute(faultElement, getFaultAction(faultMessage.getName()));

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL2.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL2.java?view=diff&rev=536076&r1=536075&r2=536076
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL2.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL2.java Mon May  7 23:11:21 2007
@@ -40,7 +40,20 @@
 
         Map nameSpacesMap = axisService.getNameSpacesMap();
         OMFactory omFactory = OMAbstractFactory.getOMFactory();
-        OMElement descriptionElement = omFactory.createOMElement(WSDL2Constants.DESCRIPTION, null);
+        OMNamespace wsdl;
+
+        if (nameSpacesMap != null && nameSpacesMap.containsValue(WSDL2Constants.WSDL_NAMESPACE)) {
+            wsdl = omFactory
+                    .createOMNamespace(WSDL2Constants.WSDL_NAMESPACE,
+                                       WSDLSerializationUtil.getPrefix(
+                                               WSDL2Constants.WSDL_NAMESPACE, nameSpacesMap));
+        } else {
+            wsdl = omFactory
+                    .createOMNamespace(WSDL2Constants.WSDL_NAMESPACE,
+                                       WSDL2Constants.DEFAULT_WSDL_NAMESPACE_PREFIX);
+        }
+
+        OMElement descriptionElement = omFactory.createOMElement(WSDL2Constants.DESCRIPTION, wsdl);
 
         // Declare all the defined namespaces in the document
         WSDLSerializationUtil.populateNamespaces(descriptionElement, nameSpacesMap);
@@ -62,10 +75,10 @@
         OMNamespace tns = omFactory
                 .createOMNamespace(axisService.getTargetNamespace(),
                                    axisService.getTargetNamespacePrefix());
-        if (!nameSpacesMap.containsValue(WSDL2Constants.WSDL_NAMESPACE)) {
+        if (nameSpacesMap != null && !nameSpacesMap.containsValue(WSDL2Constants.WSDL_NAMESPACE)) {
             descriptionElement.declareDefaultNamespace(WSDL2Constants.WSDL_NAMESPACE);
         }
-        if (nameSpacesMap.containsValue(WSDL2Constants.URI_WSDL2_SOAP)) {
+        if (nameSpacesMap != null && nameSpacesMap.containsValue(WSDL2Constants.URI_WSDL2_SOAP)) {
             wsoap = omFactory
                     .createOMNamespace(WSDL2Constants.URI_WSDL2_SOAP,
                                        WSDLSerializationUtil.getPrefix(
@@ -74,7 +87,7 @@
             wsoap = descriptionElement
                     .declareNamespace(WSDL2Constants.URI_WSDL2_SOAP, WSDL2Constants.SOAP_PREFIX);
         }
-        if (nameSpacesMap.containsValue(WSDL2Constants.URI_WSDL2_HTTP)) {
+        if (nameSpacesMap != null && nameSpacesMap.containsValue(WSDL2Constants.URI_WSDL2_HTTP)) {
             whttp = omFactory
                     .createOMNamespace(WSDL2Constants.URI_WSDL2_HTTP,
                                        WSDLSerializationUtil.getPrefix(
@@ -83,7 +96,7 @@
             whttp = descriptionElement
                     .declareNamespace(WSDL2Constants.URI_WSDL2_HTTP, WSDL2Constants.HTTP_PREFIX);
         }
-        if (nameSpacesMap.containsValue(WSDL2Constants.URI_WSDL2_EXTENSIONS)) {
+        if (nameSpacesMap != null && nameSpacesMap.containsValue(WSDL2Constants.URI_WSDL2_EXTENSIONS)) {
             wsdlx = omFactory
                     .createOMNamespace(WSDL2Constants.URI_WSDL2_EXTENSIONS,
                                        WSDLSerializationUtil.getPrefix(
@@ -96,14 +109,14 @@
         // Add the documentation element
         String description;
         OMElement documentationElement =
-                omFactory.createOMElement(WSDL2Constants.DOCUMENTATION, null);
+                omFactory.createOMElement(WSDL2Constants.DOCUMENTATION, wsdl);
         if ((description = axisService.getServiceDescription()) != null) {
             documentationElement.setText(description);
         }
         descriptionElement.addChild(documentationElement);
 
         // Add types element
-        OMElement typesElement = omFactory.createOMElement(WSDL2Constants.TYPES_LOCAL_NALE, null);
+        OMElement typesElement = omFactory.createOMElement(WSDL2Constants.TYPES_LOCAL_NALE, wsdl);
         axisService.populateSchemaMappings();
         ArrayList schemas = axisService.getSchema();
         for (int i = 0; i < schemas.size(); i++) {
@@ -136,7 +149,7 @@
         }
 
         // Add the interface element
-        descriptionElement.addChild(getInterfaceEmelent(tns, wsdlx, omFactory, interfaceName));
+        descriptionElement.addChild(getInterfaceEmelent(wsdl, tns, wsdlx, omFactory, interfaceName));
 
         // Check whether the axisService has any endpoints. If they exists serialize them else
         // generate default endpoint elements.
@@ -146,13 +159,13 @@
             if (eprs == null) {
                 eprs = new String[]{axisService.getName()};
             }
-            OMElement serviceElement = getServiceElement(tns, omFactory, interfaceName);
+            OMElement serviceElement = getServiceElement(wsdl, tns, omFactory, interfaceName);
             Iterator iterator = endpointMap.values().iterator();
             while (iterator.hasNext()) {
                 AxisEndpoint axisEndpoint = (AxisEndpoint) iterator.next();
-                serviceElement.addChild(axisEndpoint.toWSDL20(tns, whttp, eprs[0]));
+                serviceElement.addChild(axisEndpoint.toWSDL20(wsdl, tns, whttp, eprs[0]));
 
-                descriptionElement.addChild(axisEndpoint.getBinding().toWSDL20(tns, wsoap, whttp,
+                descriptionElement.addChild(axisEndpoint.getBinding().toWSDL20(wsdl, tns, wsoap, whttp,
                                                                                interfaceName,
                                                                                axisService.getNameSpacesMap(),
                                                                                axisService.getWSAddressingFlag()));
@@ -163,15 +176,15 @@
 
             // There are no andpoints defined hence generate default bindings and endpoints
             descriptionElement.addChild(
-                    WSDLSerializationUtil.generateSOAP11Binding(omFactory, axisService, wsoap,
+                    WSDLSerializationUtil.generateSOAP11Binding(omFactory, axisService, wsdl, wsoap,
                                                                 tns));
             descriptionElement.addChild(
-                    WSDLSerializationUtil.generateSOAP12Binding(omFactory, axisService, wsoap,
+                    WSDLSerializationUtil.generateSOAP12Binding(omFactory, axisService, wsdl, wsoap,
                                                                 tns));
             descriptionElement.addChild(
-                    WSDLSerializationUtil.generateHTTPBinding(omFactory, axisService, whttp, tns));
+                    WSDLSerializationUtil.generateHTTPBinding(omFactory, axisService, wsdl, whttp, tns));
             descriptionElement
-                    .addChild(WSDLSerializationUtil.generateServiceElement(omFactory, tns,
+                    .addChild(WSDLSerializationUtil.generateServiceElement(omFactory, wsdl, tns,
                                                                            axisService));
         }
 
@@ -187,10 +200,10 @@
      * @param interfaceName - The name of the interface
      * @return - The generated interface element
      */
-    private OMElement getInterfaceEmelent(OMNamespace tns, OMNamespace wsdlx,
+    private OMElement getInterfaceEmelent(OMNamespace wsdl, OMNamespace tns, OMNamespace wsdlx,
                                           OMFactory fac, String interfaceName) {
 
-        OMElement interfaceElement = fac.createOMElement(WSDL2Constants.INTERFACE_LOCAL_NAME, null);
+        OMElement interfaceElement = fac.createOMElement(WSDL2Constants.INTERFACE_LOCAL_NAME, wsdl);
         interfaceElement.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_NAME, null,
                                                             interfaceName));
         Iterator iterator = axisService.getOperations();
@@ -199,7 +212,7 @@
         int i = 0;
         while (iterator.hasNext()) {
             AxisOperation axisOperation = (AxisOperation) iterator.next();
-            interfaceOperations.add(i, axisOperation.toWSDL20(tns, wsdlx));
+            interfaceOperations.add(i, axisOperation.toWSDL20(wsdl, tns, wsdlx));
             i++;
             Iterator faultsIterator = axisOperation.getFaultMessages().iterator();
             while (faultsIterator.hasNext()) {
@@ -207,7 +220,7 @@
                 String name = faultMessage.getName();
                 if (!interfaceFaults.contains(name)) {
                     OMElement faultElement =
-                            fac.createOMElement(WSDL2Constants.FAULT_LOCAL_NAME, null);
+                            fac.createOMElement(WSDL2Constants.FAULT_LOCAL_NAME, wsdl);
                     faultElement.addAttribute(
                             fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_NAME, null, name));
                     faultElement.addAttribute(fac.createOMAttribute(
@@ -233,10 +246,10 @@
      * @param interfaceName - The name of the interface
      * @return - The generated service element
      */
-    private OMElement getServiceElement(OMNamespace tns, OMFactory omFactory,
+    private OMElement getServiceElement(OMNamespace wsdl, OMNamespace tns, OMFactory omFactory,
                                         String interfaceName) {
         OMElement serviceElement =
-                omFactory.createOMElement(WSDL2Constants.SERVICE_LOCAL_NAME, null);
+                omFactory.createOMElement(WSDL2Constants.SERVICE_LOCAL_NAME, wsdl);
         serviceElement.addAttribute(
                 omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_NAME, null,
                                             axisService.getName()));

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java?view=diff&rev=536076&r1=536075&r2=536076
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java Mon May  7 23:11:21 2007
@@ -69,6 +69,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
+import java.util.Comparator;
 
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
@@ -420,7 +421,12 @@
 
         // Capture all the binding specific properties
 
-        Map httpLocationTable = new TreeMap();
+        // Set a comparator so tha httpLocations are stored in decending order
+        Map httpLocationTable = new TreeMap(new Comparator(){
+            public int compare(Object o1, Object o2) {
+                return (-1 * ((Comparable)o1).compareTo(o2));
+            }
+        });
         SOAPBindingExtensionsImpl soapBindingExtensions = null;
         try {
             soapBindingExtensions = (SOAPBindingExtensionsImpl) binding
@@ -640,7 +646,12 @@
             throws AxisFault {
 
 
-        Map httpLocationTable = new TreeMap();
+        // Set a comparator so tha httpLocations are stored in decending order
+        Map httpLocationTable = new TreeMap(new Comparator(){
+            public int compare(Object o1, Object o2) {
+                return (-1 * ((Comparable)o1).compareTo(o2));
+            }
+        });
         // Capture all the binding specific properties
 
         HTTPBindingExtensionsImpl httpBindingExtensions = null;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/HTTPLocationBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/HTTPLocationBasedDispatcher.java?view=diff&rev=536076&r1=536075&r2=536076
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/HTTPLocationBasedDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/HTTPLocationBasedDispatcher.java Mon May  7 23:11:21 2007
@@ -98,13 +98,13 @@
 
         if (service != null) {
             index = service.indexOf("/");
-        }
-        if (service != null && -1 != index) {
-            service = service.substring(index);
-        } else {
-            int queryIndex = path.indexOf("?");
-            if (queryIndex != -1) {
-                service = service.substring(queryIndex);
+            if (-1 != index) {
+                service = service.substring(index);
+            } else {
+                int queryIndex = path.indexOf("?");
+                if (queryIndex != -1) {
+                    service = service.substring(queryIndex);
+                }
             }
         }
         return service;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/URLTemplatingUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/URLTemplatingUtil.java?view=diff&rev=536076&r1=536075&r2=536076
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/URLTemplatingUtil.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/URLTemplatingUtil.java Mon May  7 23:11:21 2007
@@ -166,7 +166,17 @@
      */
     private static String getOMElementValue(String elementName, OMElement parentElement) {
 
-        OMElement httpURLParam = parentElement.getFirstChildWithName(new QName(elementName));
+        OMElement httpURLParam = null;
+        Iterator children = parentElement.getChildElements();
+
+        while (children.hasNext()) {
+            OMElement child = (OMElement) children.next();
+            QName qName = child.getQName();
+            if (elementName.equals(qName.getLocalPart())) {
+                httpURLParam = child;
+                break;
+            }
+        }
 
         if (httpURLParam != null) {
             httpURLParam.detach();
@@ -209,14 +219,15 @@
 
         }
                 URI targetURI;
+                URI appendedURI;
                 if (replacedQuery.charAt(0) == '?') {
-                    targetURI = new URI(targetURL.toString());
+                    appendedURI = new URI(targetURL.toString () + replacedQuery);
                 } else {
                     targetURI = new URI(targetURL.toString() + "/");
+                    appendedURI = targetURI.resolve(replacedQuery);
                 }
                 
-                URI appendedURI = targetURI.resolve(replacedQuery);
-                targetURL = appendedURI.toURL(); 
+                targetURL = appendedURI.toURL();
 
             } catch (MalformedURLException e) {
                 throw new AxisFault("An error occured while trying to create request URL");

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java?view=diff&rev=536076&r1=536075&r2=536076
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java Mon May  7 23:11:21 2007
@@ -163,8 +163,8 @@
      * @return - The generated SOAP11Binding element
      */
     public static OMElement generateSOAP11Binding(OMFactory fac, AxisService axisService,
-                                                  OMNamespace wsoap, OMNamespace tns) {
-        OMElement binding = fac.createOMElement(WSDL2Constants.BINDING_LOCAL_NAME, null);
+                                                  OMNamespace wsdl, OMNamespace wsoap, OMNamespace tns) {
+        OMElement binding = fac.createOMElement(WSDL2Constants.BINDING_LOCAL_NAME, wsdl);
         binding.addAttribute(
                 fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_NAME, null, axisService.getName() +
                         Java2WSDLConstants.BINDING_NAME_SUFFIX));
@@ -175,7 +175,7 @@
                                                    WSDL2Constants.URI_WSDL2_SOAP));
         binding.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_VERSION, wsoap,
                                                    WSDL2Constants.SOAP_VERSION_1_1));
-        generateDefaultSOAPBindingOperations(axisService, fac, binding, tns, wsoap);
+        generateDefaultSOAPBindingOperations(axisService, fac, binding, wsdl, tns, wsoap);
         return binding;
     }
 
@@ -188,8 +188,8 @@
      * @return - The generated SOAP12Binding element
      */
     public static OMElement generateSOAP12Binding(OMFactory fac, AxisService axisService,
-                                                  OMNamespace wsoap, OMNamespace tns) {
-        OMElement binding = fac.createOMElement(WSDL2Constants.BINDING_LOCAL_NAME, null);
+                                                  OMNamespace wsdl, OMNamespace wsoap, OMNamespace tns) {
+        OMElement binding = fac.createOMElement(WSDL2Constants.BINDING_LOCAL_NAME, wsdl);
         binding.addAttribute(
                 fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_NAME, null, axisService.getName() +
                         Java2WSDLConstants.SOAP12BINDING_NAME_SUFFIX));
@@ -200,7 +200,7 @@
                                                    WSDL2Constants.URI_WSDL2_SOAP));
         binding.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_VERSION, wsoap,
                                                    WSDL2Constants.SOAP_VERSION_1_2));
-        generateDefaultSOAPBindingOperations(axisService, fac, binding, tns, wsoap);
+        generateDefaultSOAPBindingOperations(axisService, fac, binding, wsdl, tns, wsoap);
         return binding;
     }
 
@@ -213,8 +213,8 @@
      * @return - The generated HTTPBinding element
      */
     public static OMElement generateHTTPBinding(OMFactory fac, AxisService axisService,
-                                                OMNamespace whttp, OMNamespace tns) {
-        OMElement binding = fac.createOMElement(WSDL2Constants.BINDING_LOCAL_NAME, null);
+                                                OMNamespace wsdl, OMNamespace whttp, OMNamespace tns) {
+        OMElement binding = fac.createOMElement(WSDL2Constants.BINDING_LOCAL_NAME, wsdl);
         binding.addAttribute(
                 fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_NAME, null, axisService.getName() +
                         Java2WSDLConstants.HTTP_BINDING));
@@ -226,7 +226,7 @@
         Iterator iterator = axisService.getChildren();
         while (iterator.hasNext()) {
             AxisOperation axisOperation = (AxisOperation) iterator.next();
-            OMElement opElement = fac.createOMElement(WSDL2Constants.OPERATION_LOCAL_NAME, null);
+            OMElement opElement = fac.createOMElement(WSDL2Constants.OPERATION_LOCAL_NAME, wsdl);
             binding.addChild(opElement);
             String name = axisOperation.getName().getLocalPart();
             opElement.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_REF, null,
@@ -237,11 +237,10 @@
         return binding;
     }
 
-    private static void generateDefaultSOAPBindingOperations(AxisService axisService, OMFactory omFactory, OMElement binding, OMNamespace tns, OMNamespace wsoap) {
-        Iterator iterator = axisService.getChildren();
+private static void generateDefaultSOAPBindingOperations(AxisService axisService, OMFactory omFactory, OMElement binding, OMNamespace wsdl, OMNamespace tns, OMNamespace wsoap) {        Iterator iterator = axisService.getChildren();
         while (iterator.hasNext()) {
             AxisOperation axisOperation = (AxisOperation) iterator.next();
-            OMElement opElement = omFactory.createOMElement(WSDL2Constants.OPERATION_LOCAL_NAME, null);
+            OMElement opElement = omFactory.createOMElement(WSDL2Constants.OPERATION_LOCAL_NAME, wsdl);
             binding.addChild(opElement);
             String name = axisOperation.getName().getLocalPart();
             opElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_REF, null,
@@ -259,7 +258,7 @@
      * @return - The generated service element
      * @throws AxisFault - Thrown in case an exception occurs
      */
-    public static OMElement generateServiceElement(OMFactory omFactory, OMNamespace tns,
+    public static OMElement generateServiceElement(OMFactory omFactory, OMNamespace wsdl, OMNamespace tns,
                                                    AxisService axisService)
             throws AxisFault {
         String[] eprs = axisService.getEPRs();
@@ -268,14 +267,14 @@
         }
         OMElement serviceElement = null;
         for (int i = 0; i < eprs.length; i++) {
-            serviceElement = omFactory.createOMElement(WSDL2Constants.SERVICE_LOCAL_NAME, null);
+            serviceElement = omFactory.createOMElement(WSDL2Constants.SERVICE_LOCAL_NAME, wsdl);
             serviceElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_NAME,
                                                                     null, axisService.getName()));
             serviceElement.addAttribute(omFactory.createOMAttribute(
                     WSDL2Constants.INTERFACE_LOCAL_NAME, null,
                     tns.getPrefix() + ":" + WSDL2Constants.DEFAULT_INTERFACE_NAME));
             OMElement soap11EndpointElement =
-                    omFactory.createOMElement(WSDL2Constants.ENDPOINT_LOCAL_NAME, null);
+                    omFactory.createOMElement(WSDL2Constants.ENDPOINT_LOCAL_NAME, wsdl);
             soap11EndpointElement.addAttribute(omFactory.createOMAttribute(
                     WSDL2Constants.ATTRIBUTE_NAME, null,
                     WSDL2Constants.DEFAULT_SOAP11_ENDPOINT_NAME));
@@ -287,7 +286,7 @@
                     omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_ADDRESS, null, eprs[i]));
             serviceElement.addChild(soap11EndpointElement);
             OMElement soap12EndpointElement =
-                    omFactory.createOMElement(WSDL2Constants.ENDPOINT_LOCAL_NAME, null);
+                    omFactory.createOMElement(WSDL2Constants.ENDPOINT_LOCAL_NAME, wsdl);
             soap12EndpointElement.addAttribute(omFactory.createOMAttribute(
                     WSDL2Constants.ATTRIBUTE_NAME, null,
                     WSDL2Constants.DEFAULT_SOAP12_ENDPOINT_NAME));
@@ -299,7 +298,7 @@
                     omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_ADDRESS, null, eprs[i]));
             serviceElement.addChild(soap12EndpointElement);
             OMElement httpEndpointElement =
-                    omFactory.createOMElement(WSDL2Constants.ENDPOINT_LOCAL_NAME, null);
+                    omFactory.createOMElement(WSDL2Constants.ENDPOINT_LOCAL_NAME, wsdl);
             httpEndpointElement.addAttribute(omFactory.createOMAttribute(
                     WSDL2Constants.ATTRIBUTE_NAME, null,
                     WSDL2Constants.DEFAULT_HTTP_ENDPOINT_NAME));



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