summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-08-10 06:57:41 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-08-10 06:57:41 +0000
commit66ede8fe4172d18c8d21f37355a4d4adeb2cc434 (patch)
tree1f235042e0a622c083c429c3acab395bd32c45d3
parent30ad6b910325667083b713e22e671535ccfc4f55 (diff)
Update JSONP binding to use the URI from the binding in the endpoint to expose the service on
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@802665 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java2
-rw-r--r--java/sca/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java b/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java
index 2876db430a..72b8c1b8b7 100644
--- a/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java
+++ b/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java
@@ -45,7 +45,7 @@ public class JSONPServiceBindingProvider implements ServiceBindingProvider {
Interface serviceInterface = service.getInterfaceContract().getInterface();
for (Operation op : serviceInterface.getOperations()) {
JSONPServlet servlet = new JSONPServlet(wire, op);
- String path = service.getName() + "/" + op.getName();
+ String path = endpoint.getBinding().getURI() + "/" + op.getName();
servletHost.addServletMapping(path, servlet);
}
}
diff --git a/java/sca/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java b/java/sca/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java
index 622dbd4897..be46c1dee7 100644
--- a/java/sca/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java
+++ b/java/sca/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java
@@ -39,7 +39,7 @@ public class BindingTestCase {
@Test
public void testService() throws MalformedURLException, IOException {
- URL url = new URL("http://localhost:8085/HelloWorldService/sayHello?name=petra&callback=foo");
+ URL url = new URL("http://localhost:8085/HelloWorldComponent/HelloWorldService/sayHello?name=petra&callback=foo");
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
String response = br.readLine();
Assert.assertEquals("foo(\"Hello petra\");", response);
@@ -48,7 +48,7 @@ public class BindingTestCase {
@Test
public void testTwoArgs() throws MalformedURLException, IOException {
- URL url = new URL("http://localhost:8085/HelloWorldService/sayHello2?first=petra&last=arnold&callback=foo");
+ URL url = new URL("http://localhost:8085/HelloWorldComponent/HelloWorldService/sayHello2?first=petra&last=arnold&callback=foo");
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
String response = br.readLine();
Assert.assertEquals("foo(\"Hello petra arnold\");", response);