Simple XPath amp Variable Substitution Problem

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?

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

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

Mark