Java Web Services/DOM question

F

frank

I was wondering if any one had an example of how to take an existing
Document (web services org.wc3.DOM) object that is populated with a XML
doc and get just a section of it (i.e. between some tags) and place it
into another document object? Been trying to do it unsuccessfully.

Example: (just want what between book tags)
<results>
<book>
<author>
<last>Abiteboul</last>
<first>Serge</first>
</author>
<title>Data on the Web</title>
</book>
<otherdata>
......
<\otherdata>
</results>




Thanks,

Frank
 
I

iksrazal

You're talking about a SOAP Message ala body, headers etc, right? Since
that is created "on the fly", you typically would place a Handler in
between the call - on the client side, server side or both. This is
often done for security reasons, such as encrypting a node, etc. So my
advice is to take a look at the Handler interface, supported by both
Axis and Sun JWSDP. In Axis you have the SOAPMonitor applet that shows
what you have.

HTH,
iksrazal
http://www.braziloutsource.com/
 
F

frank

Nope already stripped that off just a plain old. But that does not
matter. Already looked at all that stuff not a lot of help. All
examples have you loading it up but getting a portion of it AND loading
it into another Document obj, can't find it. Read in doc simple.
Getting a value in doc simple, placing some section of the doc into
another doc, a big problem.

Thanks,

Frank
 
I

iksrazal

That's a pretty good problem. Not sure why you can't just send an xml
doc/node as a String and manipulate that in the web service itself.
Furthermore, you could

1) Get the node you want as you describe in the Handler.
2) Create the new DOC in the Handler.
3) Attach via SAAJ in the Handler, or embed the XML doc as a String
into the Body inside a Handler.

Or use HanderConfig and place your nodes/Strings/Objects in HashMap and
send that. Or use SAAJ and skip the Handlers altogether.

In short I'm having a hard time imagining how the above scenerios could
be too inflexible.

iksrazal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top