summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/binding-http-runtime
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-08-31 12:29:46 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-08-31 12:29:46 +0000
commit49eeea3e9ce83c3e583c04a9bbc2b4ff307ec994 (patch)
treee589c67254b524c88e82667b1c4f982c23367f13 /sca-java-2.x/trunk/modules/binding-http-runtime
parent0f51f4dea747b37c56904f95f3cf7f3c2269849f (diff)
Correctly increment the type index, and handle null response
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@991170 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-http-runtime')
-rw-r--r--sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultWireFormatServiceInterceptor.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultWireFormatServiceInterceptor.java b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultWireFormatServiceInterceptor.java
index ccd4e03ca6..fcbf8015f8 100644
--- a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultWireFormatServiceInterceptor.java
+++ b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultWireFormatServiceInterceptor.java
@@ -154,7 +154,7 @@ public class HTTPDefaultWireFormatServiceInterceptor implements Interceptor {
for (String name : getOrderedParameterNames(servletRequest)) {
String jsonRequest = "";
// quote string parameters so clients work in the usual javascript way
- if (typesIndex < types.size() && String.class.equals(types.get(typesIndex).getGenericType())) {
+ if (typesIndex < types.size() && String.class.equals(types.get(typesIndex++).getGenericType())) {
String x = servletRequest.getParameter(name);
if (x.startsWith("\"") || x.startsWith("'")) {
jsonRequest += x;
@@ -219,7 +219,7 @@ public class HTTPDefaultWireFormatServiceInterceptor implements Interceptor {
* add wrap it for return.
*/
protected String getResponseAsString(HttpServletRequest servletRequest, HttpServletResponse servletResponse, Object response) {
- String jsonResponse = response.toString();
+ String jsonResponse = response == null ? "" : response.toString();
if ("GET".equals(servletRequest.getMethod())) {
// handle JSONP callback name padding