Java Web Services/DOM question

Discussion in 'Java' started by frank, Jun 13, 2005.

  1. frank

    frank Guest

    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
    frank, Jun 13, 2005
    #1
    1. Advertising

  2. frank

    Guest

    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/
    , Jun 14, 2005
    #2
    1. Advertising

  3. frank

    frank Guest

    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

    wrote:
    > 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/
    >
    frank, Jun 14, 2005
    #3
  4. frank

    Guest

    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
    , Jun 14, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nick
    Replies:
    1
    Views:
    6,120
    Alvin Bruney - ASP.NET MVP
    Sep 12, 2005
  2. Anup
    Replies:
    1
    Views:
    2,777
    Mark Rae
    May 9, 2006
  3. imlakhani

    Web Services Restful Services

    imlakhani, Dec 16, 2009, in forum: Java
    Replies:
    1
    Views:
    419
    Jeffrey H. Coffield
    Dec 16, 2009
  4. John
    Replies:
    4
    Views:
    441
  5. Ann
    Replies:
    0
    Views:
    194
Loading...

Share This Page