My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 19: Problem parsing JSON request
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Aug 2011


 
Reported by mbreuer....@googlemail.com, Aug 26, 2011
What steps will reproduce the problem?
1. Sending JSON Object
{"result":{"request":{"Instrument":"instrument1","Results":[{"ID":"08970001","MethodID":"08970001","OperationNo":1,"OrderID":"000000052","ReplicationNo":1,"SampleNo":1,"Unit":"","Value":"farblos"},{"ID":"08970002","MethodID":"08970001","OperationNo":1,"OrderID":"000000052","ReplicationNo":1,"SampleNo":1,"Unit":"","Value":"ohne Geruch"},{"ID":"08970021","MethodID":"08970001","OperationNo":1,"OrderID":"000000052","ReplicationNo":1,"SampleNo":1,"Unit":"","Value":"10.150000"},{"ID":"08970022","MethodID":"08970001","OperationNo":1,"OrderID":"000000052","ReplicationNo":1,"SampleNo":1,"Unit":"°C","Value":"42.000000"},{"ID":"08970023","MethodID":"08970001","OperationNo":1,"OrderID":"000000052","ReplicationNo":1,"SampleNo":1,"Unit":"%","Value":"9.900000"},{"ID":"08970091","MethodID":"08970001","OperationNo":1,"OrderID":"000000052","ReplicationNo":1,"SampleNo":1,"Unit":"","Value":"n.b."}],"SessionID":"6db17089b6f44deaf6fd8508b3748b7c"}}}

2. getting 500 ERROR
{"statusFlag":false,"fault":{"code":"CLIENT","detail":{},"localizedMessage":"Couldn't create SOAP message due to exception: com.jaxws.json.codec.JSONFault: Failed to create message body.null","message":"Couldn't create SOAP message due to exception: com.jaxws.json.codec.JSONFault: Failed to create message body.null"}}

3. the problem might be that "Results" and "Instrument" are mapped to the same HashValue

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?

version 0.7, Windows XP


Please provide any additional information below.

The Exception is thrown in JSONDecoder line 196
jsonwebservice-problem.bmp
3.7 MB   Download
Aug 26, 2011
Project Member #1 sundaram...@gmail.com
Hi,
 Can you please provider java files, you deserialize using json, or can you give XSD one you use to create java objects.


Aug 26, 2011
#2 mbreuer....@googlemail.com
Hi,
You do a great job with json transporting jax-ws webservices, Thanx a lot. 
Attached you will find the wsdl and xsd file used to generate the Java 
Objects with ws-import.
Aug 26, 2011
#3 mbreuer....@googlemail.com
some more information:

all the other four methods work fine, only the result method gets a null 
pointer Exception in MessageBodyBuilder line 139.

The other methods have a simple list of parameters, but this method has one 
parameter ("Results") that is an Array of Objects. I attach you the JSON 
objects exchanged with all the methods. By the way - the soap junit test 
works fine
Aug 26, 2011
Project Member #4 sundaram...@gmail.com
Can you please attach the xsd or add the extract from xsd. I don't find it in previous reply.

Thanks for reporting and helping to improve the project.

Aug 28, 2011
#6 mbreuer....@googlemail.com
sorry, the e-mail attached files did not find their way into this issue. Here they are

tabletws.wsdl
5.0 KB   Download
tabletws.xsd
11.0 KB   Download
jsonwebservice-problem.log
33.8 KB   View   Download
Aug 29, 2011
Project Member #7 sundaram...@gmail.com
Caused by using camelCase xml element with list. Bug accepted. 
Aug 29, 2011
Project Member #8 sundaram...@gmail.com
(No comment was entered for this change.)
Status: Accepted
Aug 29, 2011
Project Member #9 sundaram...@gmail.com
Fixed in revision 280.

Included in revision 0.8.0
Status: Fixed
Aug 29, 2011
Project Member #10 sundaram...@gmail.com
unitTest 53 added.

Powered by Google Project Hosting