• Post Reply Bookmark Topic Watch Topic
  • New Topic

returning XML without DOM object  RSS feed

 
jesse harris
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing a service with axis, this service makes a call to a url which returns XML, I want to return this xml without parsing or processing as the body of teh soap message. I have gotten this to work by returning a Document object (dom) but this puppy's gotta scale and I really dont see the need to create parsers and documents and such. I tried returning a string but of course all the XML chars get escaped.

This seems simple.
any tips appreciated
Jesse Harris
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried returning a string but of course all the XML chars get escaped.

You should be able to write a valid XML outputstream with Java write or print type statements - I do it all the time.
Bill
 
jesse harris
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
normaly that is true, but as axis does a lot of the work for me it appears to handle the returned text differently based on type, if my service class returns a String the xml gets escaped, if I return a Document it doesnt, but it seems like a waste to create document object.

am i missing something?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah - I see what you mean. I thought you were talking about writing the output directly. SOAP just naturally does a whole lot of DOM building and XML manipulation that is bound to be time consuming.

If you are going to use a toolkit such as AXIS you will have to play by AXIS rules. Unfortunately it has been years since I looked seriously at AXIS.

You might be able to avoid building a DOM out of the return from the URL call, with the attendent DOM creation, by parsing it with a SAX parser and grabbing the useful bits on the fly.

Bill
 
jesse harris
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks bill,
actually I dont even need to parse it, I just need to return the xml returned from the URL, I don't even need to process it. I know this probably seems silly, why don't i just hit the other darn server, well, its all mod_perl.....nuff said??? lol just kidding, kind of...I already have a SOAP env setup with axis and am a bit weary of writing the soap stuff using perl.

thanks for the thoughts
Jesse
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!