tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r831523 - /tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java
Date Sat, 31 Oct 2009 09:00:37 GMT
Author: antelder
Date: Sat Oct 31 09:00:37 2009
New Revision: 831523

URL: http://svn.apache.org/viewvc?rev=831523&view=rev
Log:
Fix WS binding to include any webapp context path in the wsdl endpoint

Modified:
    tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java

Modified: tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java?rev=831523&r1=831522&r2=831523&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java
(original)
+++ tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java
Sat Oct 31 09:00:37 2009
@@ -96,6 +96,7 @@
                     for (Object p : ((Service)s).getPorts().values()) {
                         String endpointURL = Axis2ServiceProvider.getPortAddress((Port)p);
                         String modifiedURL = setIPAddress(endpointURL, url);
+                        modifiedURL = addContextRoot(modifiedURL, serviceName);
                         Axis2ServiceProvider.setPortAddress((Port)p, modifiedURL);
                     }
                 }
@@ -136,6 +137,18 @@
         super.processListService(req, res);
     }
 
+    private String addContextRoot(String modifiedURL, String serviceName) {
+        if (!"/".equals(configContext.getContextRoot())) {
+            if (modifiedURL.endsWith(serviceName)) {
+                URI uri = URI.create(modifiedURL);
+                if (!uri.getPath().startsWith(configContext.getContextRoot())) {
+                    modifiedURL = modifiedURL.substring(0, modifiedURL.length() - serviceName.length())
+ configContext.getContextRoot() + serviceName;
+                }
+            }
+        }
+        return modifiedURL;
+    }
+
     private XmlSchema getSchema(XmlSchema parentSchema, String name) {
         for (Iterator iter = parentSchema.getIncludes().getIterator(); iter.hasNext();) {
             Object obj = iter.next();



Mime
View raw message