summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-11-01 07:53:17 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-11-01 07:53:17 +0000
commit6fc6bd00f9c28b576013b1753a7c73cfca60662d (patch)
treeb8bb51999509ce43931f4b85088d8f5a6f222c2d
parentfad092b8a9cb880765f2b04e288c60e0583e0171 (diff)
Merge r831523 from trunk to m4 to fix WS binding to include any webapp context path in the wsdl endpoint
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@831651 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--branches/sca-java-2.0-M4/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/branches/sca-java-2.0-M4/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java b/branches/sca-java-2.0-M4/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java
index 3f8599b118..55f1592657 100644
--- a/branches/sca-java-2.0-M4/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java
+++ b/branches/sca-java-2.0-M4/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();