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
  • 1.  xql:result

    Posted Tue November 19, 2002 11:37 AM

    How can I check if node “xql:result” exists when tamino returned values from my query? I know that “xql:result” only exists when query returns at least one element from mydb tamino.

    thanks in advance!

    best regards,
    Dariusz Baumann


    #webMethods-Tamino-XML-Server-APIs
    #webMethods
    #API-Management


  • 2.  RE: xql:result

    Posted Tue November 19, 2002 12:07 PM

    You can use :
    public boolen hasQueryContent()

    true if the response of Tamino contained any result information, false otherwise.

    @nto


    #webMethods-Tamino-XML-Server-APIs
    #webMethods
    #API-Management


  • 3.  RE: xql:result

    Posted Tue November 19, 2002 12:26 PM

    yes, I found in documentation:

    -------------------------------------
    hasQueryContent

    public boolean hasQueryContent()

    Indicates if the response of Tamino contained any result information. Result information is only produced for queries, not for any other operations. Returns false if the query did not produce any results.
    Returns:
    true if the response of Tamino contained any result information, false otherwise.
    -------------------------------------

    Unfortunately, I don’t know how I should use this method “hasQueryContent()” of object “TResponse”.

    I need sample code.

    thanks in advance!

    best regards,
    Dariusz Baumann


    #webMethods
    #webMethods-Tamino-XML-Server-APIs
    #API-Management


  • 4.  RE: xql:result

    Posted Tue November 19, 2002 12:34 PM

    U can try with the following snipped of code:

    After u have done a connection and u have obtained an accessor u do:

    TResponse response = accessor.query(query);

    if(response.hasQueryContent()){

    //u got it

    }
    else
    //u don’t got it


    #webMethods-Tamino-XML-Server-APIs
    #API-Management
    #webMethods


  • 5.  RE: xql:result

    Posted Tue November 19, 2002 01:33 PM

    First of all, I need full sample code about “hasQueryContent()” method because I do not know what it is “accessor” object, and how I should initialize it.

    thanks in advance!

    best regards,
    Dariusz Baumann


    #API-Management
    #webMethods
    #webMethods-Tamino-XML-Server-APIs


  • 6.  RE: xql:result

    Posted Tue November 19, 2002 01:48 PM

    Hi Dariusz,

    The TResponse object comes from the TaminoAPI4J and not from the TaminoClient API. So the following snipet of code could be used to achieve what the hasQueryContent() method does:-

    TaminoResult tr = tc.query (DOCTYPE) ;
    boolean hasQueryContent = (tr.getDocument().getElementsByTagName(“xql:result”).getLength() > 0)? true : false ;

    Hope this helps.


    Stuart Fyffe-Collins
    Software AG (UK) Ltd.


    #webMethods
    #webMethods-Tamino-XML-Server-APIs
    #API-Management