• Post Reply Bookmark Topic Watch Topic
  • New Topic

consuming xml and producing json

 
Magiri Mahdi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends
I'm developing a web app ,in the present sprint i have to consume a rest service (XML format) produced by QuickBuild server ,do some work and send the result to an angularjs client(Json format).
i need some help(no code , no implementation...) just steps the what to do things.

I'll be grateful
cheers
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Step 1 - learn how to use the Java standard library to handle XML documents:
a. parsing to a DOM - document object model
b. extracting desired element data from the DOM

Bill
 
Magiri Mahdi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Arun Kumarr I'm sorry i send a changing name request next time you will see my real name
@ William Brogden thanks for your help but i didn't goes well i couldn't get the xml content produced from the Rest service.
if it was an xml file that would be easy but from a URL i think that it needs a sort of XMLHTTPrequest or something like that , i have to consume the service i hope it's clear .
you will find a snapshot in the attachement
QuickBuild rest API.jpg
[Thumbnail for QuickBuild rest API.jpg]
xml Rest service
 
Arun Kumarr
Ranch Hand
Posts: 662
Eclipse IDE Java Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. You can consume the xml using the xmlhttp object and do a dom search and get the desired element as William mentioned.
One other thing, I would like you to place a request at the server side team to qualify the element, "com.pmease.quickbuild.model.Configuration" with a more meaningful element name like, "Configuration".
 
Magiri Mahdi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Arun Kumarr i'll try the technique a post a feedback later
 
Arun Kumarr
Ranch Hand
Posts: 662
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cheers for changing the name.
Yes. Do post your feedback. Get back, if you are stuck somewhere.
 
Magiri Mahdi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Arun Kumarr or @William Brogden or @any one else can help ,i need to
1) pass threw a proxy then
2)the server authentication(login and password) then==>how to pass the login and password to the server signin page???
3) get some xml tags and parse them to JSON
i hope it's clear by the way this is the server documentation link if you want to take a look QuickBuild Get all configurations in the system
Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!