diff options
Diffstat (limited to 'sca-java-1.x/trunk/modules/binding-jsonp-runtime/src')
5 files changed, 34 insertions, 6 deletions
diff --git a/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServlet.java b/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServlet.java index a86446c734..99879eb145 100644 --- a/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServlet.java +++ b/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServlet.java @@ -70,9 +70,12 @@ public class JSONPServlet extends GenericServlet { @Override
public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
Object[] args = getJSONRequestStringArray(servletRequest);
- Object response = invokeService(args);
- String jsonResponse = getJSONResponseAsString(servletRequest, response);
- servletResponse.getOutputStream().println(jsonResponse);
+ Object response = invokeService(args);
+
+ if (response != null){
+ String jsonResponse = getJSONResponseAsString(servletRequest, response);
+ servletResponse.getOutputStream().println(jsonResponse);
+ }
}
/**
diff --git a/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldClient.java b/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldClient.java index b1f81cb499..aca47c3d5f 100644 --- a/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldClient.java +++ b/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldClient.java @@ -53,5 +53,9 @@ public class HelloWorldClient implements HelloWorldService { public void sayHello7() {
ref.sayHello7();
- }
+ }
+
+ public void sayHello8(String name) {
+ ref.sayHello8(name);
+ }
}
diff --git a/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldImpl.java b/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldImpl.java index e3159a0274..01d67757f9 100644 --- a/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldImpl.java +++ b/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldImpl.java @@ -68,4 +68,8 @@ public class HelloWorldImpl implements HelloWorldService { public void sayHello7() {
System.out.println("Hello void Fred");
}
+
+ public void sayHello8(String name) {
+ System.out.println("Hello void " + name);
+ }
}
diff --git a/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldService.java b/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldService.java index 2b0208d143..79cc293b97 100644 --- a/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldService.java +++ b/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldService.java @@ -37,5 +37,7 @@ public interface HelloWorldService { String[] sayHello6(BeanA[] beans, String[] names, String anotherName);
void sayHello7();
+
+ void sayHello8(String name);
}
diff --git a/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java b/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java index cec8c05039..bafd6ecd21 100644 --- a/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java +++ b/sca-java-1.x/trunk/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java @@ -144,8 +144,23 @@ public class BindingTestCase { public void testVoid() throws MalformedURLException, IOException {
HelloWorldService client = ((SCAClient)node).getService(HelloWorldService.class, "HelloWorldClient");
- client.sayHello7();
- }
+ try {
+ client.sayHello7();
+ } catch (Exception ex){
+ Assert.fail();
+ }
+ }
+
+ @Test
+ public void testVoidOut() throws MalformedURLException, IOException {
+ HelloWorldService client = ((SCAClient)node).getService(HelloWorldService.class, "HelloWorldClient");
+
+ try {
+ client.sayHello8("Fred");
+ } catch (Exception ex){
+ Assert.fail();
+ }
+ }
@Test
@Ignore
|