IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

queryXMLNode problem

webMethods Community Member

webMethods Community MemberThu October 16, 2008 11:44 AM

  • 1.  queryXMLNode problem

    Posted Mon October 13, 2008 04:13 AM

    Here is my xml

    good

    I need to get back Result tag’s namespace, which is http://www.test.com

    I did the following, convert xml to node, and then using queryXMLNode, but failed. Could someone help me out with this?

    Thanks in advance


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: queryXMLNode problem

    Posted Mon October 13, 2008 04:44 PM

    With that XML, I can get it with /Result/@*, but that seems to be the only way to retrieve it.

    I tried namespace() and prefix(), which should work, but did not. Also, I got different results with your XML depending on whether I sent it as a file or as a string.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: queryXMLNode problem

    Posted Mon October 13, 2008 05:28 PM

    Thanks, but /Result/@*did not work for me either.

    I am using IS6.5 SP1.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: queryXMLNode problem

    Posted Mon October 13, 2008 06:12 PM

    Verify this thread. It may throw some light on your problem …

    [url]wmusers.com


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 5.  RE: queryXMLNode problem

    Posted Tue October 14, 2008 03:55 AM

    thanks for reply.

    Still no luck. Is there a way to get back this namespace using IS SP1?


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: queryXMLNode problem

    Posted Tue October 14, 2008 12:53 PM

    HI,
    Make sure you select XQL from the drop down list when you put the query /Result/@* for getting the namespace. If you use WQL you will not get the correct result.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 7.  RE: queryXMLNode problem

    Posted Tue October 14, 2008 07:13 PM

    I am using XQL, the queries tried and failed so far

    /Root/Result/@xmlns:test
    /Root/Result/namespace()
    /Root/Result/prefix()
    /Result/@*
    /Result/namespace()
    /Result/prefix()


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 8.  RE: queryXMLNode problem

    Posted Tue October 14, 2008 07:18 PM

    How are you sending/testing? HTTP post from outside, Test → Send XML, string input, document input, etc?


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 9.  RE: queryXMLNode problem

    Posted Tue October 14, 2008 07:21 PM

    when I testing, I set the xmlData in XmlToXMLNode and also set isXML to be true


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 10.  RE: queryXMLNode problem

    Posted Tue October 14, 2008 07:42 PM

    Ok - I took your XML…

    And put it in a sample flow…

    pub.xml:xmlStringToXMLNode (with your XML as the xmldata input, and isXML=true)
    pub.xml:queryXMLNode (with a variable query set to //Result/@xmlns:test)

    And of course it did not work. Nothing works using your XML. As a matter of fact, I keep getting null on every test, even simpler ones.

    However, if I make one small change:

    It works like a champ.

    //Result/@xmlns:test results in http://www.test.com.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 11.  RE: queryXMLNode problem

    Posted Tue October 14, 2008 07:52 PM

    Thanks.

    This XML

    good

    is the modified xml. It is a valid xml, isn’t it?

    I am dealing with the xml coming from one client, they are using one default namespace at root level and another namespace at child level. I have a need to get back child namespace.

    Looks like that webMethods has issue with dealing default namespace with the regular namespace, right?


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 12.  RE: queryXMLNode problem

    Posted Tue October 14, 2008 08:27 PM

    Certainly seems so in this case, since the quick fix is to not use a default.

    However, I remember a fix for default namespaces going all the way back to 4.6.

    Anyone with recent experience who can weigh in on this to help foresteverwm?

    (There are a number of threads on this forum dealing with default namespaces, most of which seem to be related to SOAP and WSDL.)


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 13.  RE: queryXMLNode problem

    Posted Thu October 16, 2008 03:38 AM


  • 14.  RE: queryXMLNode problem

    Posted Thu October 16, 2008 11:44 AM


  • 15.  RE: queryXMLNode problem

    Posted Thu October 16, 2008 11:46 AM

    Hello foresteverwm

    You can use XQL
    The Query is RESULT[0]/@*

    BR
    UEE


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 16.  RE: queryXMLNode problem

    Posted Thu October 16, 2008 12:24 PM

    Hi

    You can use xmlNodeToDocument to get a document
    Then get the %document/RESULT/@XMLNS:TEST%

    BR
    UEE


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB