...
Info | ||||
---|---|---|---|---|
| ||||
Here the servlet might notify that some imports are not resolved. We need to add two external jar files to resolve these errors. |
- Let us walkthrough the code of ConverterHandler servlet.
- We will create a HttpClient object and GetMethod object for our requestquery. Then we will execute the method on our client object.
- The response after executing the method will be taken as a stream so as to parse the XML elements in response message sent by the Web Service.
- Here we used XPath to process XML response messages sent by web service.
Info title XPath Processing XPath (XML Path Language) is a language for selecting nodes from an XML document with very advanced features.
Our response message sent by web service may look like this:
Code Block title response.xml <return> <dollarToRupeesResponse>933.34</dollarToRupeesResponse> <rupeesToEuroResponse>933.34</rupeesToEuroResponse> </return>
We will first try to get the NodeList present between <return> elements, Then we evaluate each child node to get the results.
This concludes the development section of our web based client.
...