Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

WS error in saving objects/printing results

 
Vito Czz
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody, I'm trying to write a web service that take an XML file, read some information and then print that. The problem is that during the execution of the client I receive a null pointer exception, but I will explain that later, after showing you the code.

Here is a fragment of the XML file (just to gave you the idea of the structure)


First of all, I've created two beans to contain the info I need




Then I've created another class that parse the document and save the data from the tags <prodotto> and <confezione> into the respective objects.


The server must be something like this


The client instead is


Unfortunately, even if there isn't syntax error, the logic of ws is wrong, cause after the client is launched and the first operation (a simple listing of all elements with the respective data: "id", "nome", "categoria", and the various "tipo", "peso", "prezzo" of confezione) is selected, the output is


I think that the array "confezioni" isn't filled but I don't know why, and I hope that someone with more experience than me can gave a look to the code and help me finding out where the problem is (and by the way, my english is a little rust, sorry )
 
Vito Czz
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No ideas?
Can be a problem of BeanUtil.deserialize that doesn't know how to work with "confezione"'s objects? How can i handle this?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!