This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Web Services and the fly likes WS error in saving objects/printing results Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "WS error in saving objects/printing results" Watch "WS error in saving objects/printing results" New topic
Author

WS error in saving objects/printing results

Vito Czz
Greenhorn

Joined: Mar 21, 2011
Posts: 6
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

Joined: Mar 21, 2011
Posts: 6
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?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: WS error in saving objects/printing results
 
Similar Threads
Creating Service and Client using AXIOM
javax.xml.stream.XMLStreamException: Undeclared prefix 'soapenv' for element <soapenv:Envelope>
Axis2 Rampart client configuration
Parsing nested elements with DOM
Trying to create a java web service client using axis2