How to parse SOAP response with PHP?

Parsing soap response document using java.?

  • Hello all, I have a soap response document like this --------------------------------------… <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/… soap:encodingStyle="http://www.w3.org/… <soap:Body xmlns:m="http://www.example.org/stock"> <m:GetStockPriceResponse> <m:Price>34.5</m:Price> </m:GetStockPriceResponse> </soap:Body> </soap:Envelope> --------------------------------------… Please let me know some data about how to parse the above document using java. i will be using java 1.1 thx

  • Answer:

    Use the documentbuilder class. ITs a built in xml parser in JAVA. Example: DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder parser; Document doc; try { parser = factory.newDocumentBuilder(); doc = parser.parse(theXMLInputStream); } catch(ParserConfigurationException e) { // problem with parser e.printStackTrace(); } catch(SAXException ex) { // problem parsing ex.printStackTrace(); }

thuruppu... at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.