cancel
Showing results for 
Search instead for 
Did you mean: 

Passing file location as URL parameter for xml query

Former Member
0 Kudos

Hi all,

A quick question regarding using a parameter to set the source URL in an XML query template.

When assigning the URL, the static text works perfectly eg:

//<servername>/<folder>/samplefile.xml . The xml is returned as required.

However, we wish to call this from a BLS txn and set the source URL dynamically.

To test this we assigned //<servername>/<folder>/samplefile.xml to Parameter no 1 and insert [Param.1] in the source URL field. No luck.

Any suggestions?

Cheers

Mark

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Mark I believe you have to double up the slashes..... i.e. ////<servername>//<folder>//samplefile.xml

I think I had this issue earlier today with an SVG when saving it

jcgood25
Active Contributor
0 Kudos

Mark,

In BLS, the double slashes (escaping the single /) are only necessary if you are building the full http url string in the link editor.

If your XMLQuery template is something like http://localhost/Folder/Subfolder/[Param.1]; then put in a default param value in the query template and make sure the query test works. Then configure (or reconfigure) this in your BLS transaction and generate the sample results. All you should have to do in BLS then is to assign your Transaction or Local property to the Param.1 link in your XMLQuery action block. All of the dynamic replacement and subsequent xml file retrieval should then be done by the XMLQuery itself.

If you can keep the majority of the URL in the XMLQuery itself and then just dynamically pass it the Param.1 piece it will be very easy to test and configure (also use localhost if the file lives on the xMII web server), but if you have to build the string external in BLS I would recommend using a combination of the expression editor and a Local property. If the Local string property contains the base of http://localhost/Folder/Subfolder/ (no quotes or character escaping needed for the default value of a string property) then just assign something like the following to your Param.1 property of the XMLQuery: Local.URLBase & "filename.xml" (a simple evaluate will confirm your efforts).

Regards,

Jeremy

Former Member
0 Kudos

Thanks Jeremy.

Unfortunately the full url is required in each case as the BLS will be passed it as a variable from a number of disparate locations, whose files will reside on different servers. Therefore we need to be able to specify the filepath and filename dynamically dependant upon the parameter passed to the BLS txn.

I have tried passing the full URL to the XMLQuery [Param.1] property as both a string literal and via assigning a local property (which in turn holds the string). Have tried both http:// and // prefixes (and no prefix).

In each case the message "[ERROR]: ACTION FAILED: End Action XmlQry_GetData : (XML Query)" occurs.

This is why I was trying tio debug from the query, on the assumption that if I can get it to execute at that level, the parameter detail becomes easy...

Thnaks again

Mark

jcgood25
Active Contributor
0 Kudos

Mark,

The XMLQuery action expects the results being returned by the URL property to already be in Rowsets/Rowset/Row format - is this the case (I am guessing no since you mentioned external locations)? The Transform property (rectangle below the URL in the query template editor) is there to provide the path to an XSL transform that would convert the non-xMII XML format into the expected format.

Have you tried the XMLLoader action block in your transaction instead of the XMLQuery? This action block will attempt to load the xml, irregardless of format, and might just do the trick for you.

You are approaching it properly, if you can't get it to work at the query template level, then adding the BLS layer only makes it more of a challenge to debug.

Regards,

Jeremy

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi all,

Problem solved. Rather than pass the required string to the Param.1 property, I passed it to the URL property an hey presto...

Thanks for your help though.

Cheers

Mark

Former Member
0 Kudos

Thanks for the reply Brian, but unfortunately not a solution..

BTW I also have tried a range of permutations including HTTP:// prefix, inserting string in quotes and inverted comma's.