This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting body from Soap

 
Patricia Samuel
Ranch Hand
Posts: 300
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI All,

Can any one please help me to know how to get the result -
I wan to fetch <m:GetStockPrice> part from the Soap Body

Expected result - <m:GetStockPrice>
<m:StockName>IBM</m:StockName>
</m:GetStockPrice>

Would any one help me to achieve this?
Thanks
Patricia


 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have this XML document in a string, and if you know that you'll always want to retrieve That specific part, and if you're certain that the structure won't change substantially, then some string operations (using indexOf and substring) should do the trick.

Otherwise, you can use an XML parser.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
If you want to use SAAJ read and process the XML, then I have some examples in section 5.7 of my SCDJWS 5 Study Notes.
You can download the document in the SCDJWS Links section here or at http://www.javaforum.se/jforum/posts/list/549.page
Best wishes!
 
M Mehta
Ranch Hand
Posts: 92
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had a similar requirement of getting body from Soap. I wrote the following code which is working for me. Hope it helps you solving the problem.



Thanks,
Me
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic