summaryrefslogtreecommitdiffstats
path: root/java/sca/modules
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-10-31 09:00:37 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-10-31 09:00:37 +0000
commit5e8bc64747e9bf9dadd2cc654e4477e2f7dc18de (patch)
treee791604329db2e6303418c5899d993d9a5a4843f /java/sca/modules
parent6971e1e526541f475e3a2adf5992f3486b4f6b70 (diff)
Fix WS binding to include any webapp context path in the wsdl endpoint
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@831523 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules')
-rw-r--r--java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java
index 3f8599b118..55f1592657 100644
--- a/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java
+++ b/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java
@@ -96,6 +96,7 @@ public class TuscanyListingAgent extends ListingAgent {
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 @@ public class TuscanyListingAgent extends ListingAgent {
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();