webMethods

webMethods

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

Simple XPath amp Variable Substitution Problem

  • 1.  Simple XPath amp Variable Substitution Problem

    Posted Thu June 16, 2005 06:29 PM

    I have a reference number stored in StringA, and I wish to populate StringB with the value from another Document, using XPath.

    I have tried to set StringB to be:

    /Message/Body/Item[Ref=%StringA%]/Price

    (with the Perform Variable Substitution box ticked)

    but this doesn’t resolve the XPath, merely setting StringB to:

    “/Message/Body/Item[Ref=1234]/Price”

    I’ve also tried:

    %/Message/Body/Item[Ref=%StringA%]/Price%

    But this understandably confuses webMethods.

    Can anybody help?


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


  • 2.  RE: Simple XPath amp Variable Substitution Problem

    Posted Thu June 16, 2005 07:01 PM

    This is a limitation of the UI for building the parameter for the Query service, not a runtime limitation.

    Put your query string in a Flow Map step that is before your Invoke of QueryDocument/queryXMLNode call. You can then explicitly turn on variable substitution in the Flow Map Set dialog. Then map the query string into the “fields” parameter to the query service. It may be a bit tricky to figure out exactly where that query string goes and how to get it there. Check in the Built In Services documentation for a description of the parameters.

    Cheers,
    Fred


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


  • 3.  RE: Simple XPath amp Variable Substitution Problem

    Posted Thu June 16, 2005 08:43 PM

    Here’s a related post that discusses creating XQL query strings programatically(it’s about halfway down the page of responses).

    Mark


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