diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-07-23 20:15:45 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-07-23 20:15:45 +0000 |
commit | 62f02e8442861dab7bffcf62ae231e21e77b3387 (patch) | |
tree | 43c94d1d58f864e86584e08f1024a2fc08beb2f2 /sca-java-2.x/trunk | |
parent | c6eb46690f9463ba250f3c6dfcac5a8ab8df3d5c (diff) |
Update the JSONP binding to set the enpoint URI from the registered service servlet
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1150210 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk')
-rw-r--r-- | sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java b/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java index 991aeb3a21..03a3668dbe 100644 --- a/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java +++ b/sca-java-2.x/trunk/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java @@ -51,7 +51,10 @@ public class JSONPServiceBindingProvider implements ServiceBindingProvider { for (Operation op : serviceInterface.getOperations()) { JSONPServlet servlet = new JSONPServlet(endpoint, op); String path = endpoint.getBinding().getURI() + "/" + op.getName(); - servletHost.addServletMapping(path, servlet); + String mappedURI = servletHost.addServletMapping(path, servlet); + String endpointURI = mappedURI.substring(0, mappedURI.lastIndexOf("/" + op.getName())); + endpoint.setDeployedURI(endpointURI); + endpoint.getBinding().setURI(endpointURI); } } |