Wednesday, June 17, 2009

WebService and XML parsing error

While consuming webservice, we need to be very cautious and ensure that the data what we pass is absolutely in the right format. i.e the webservice must be able to parse.
Say for example, you have some query and it returns perfect while testing in the backend. But when you consume the same data in the front end application through the webservice you will get a parse error something like this.

Error in XML Node(5,20)


The reason is either the object returned from Webservice is not serializable, or the data returned from the backend has values which couldn't be parsed by the webservice.
Eg: Consider connecting to DB2 for data. If the fields are not properly intialized at the backend, it will fill in the remaining space by low values which are not parsed by webservice and hence the error.So trace it at the backend before jump starting on debugging the front end application.

No comments: