1
votes

I'm trying to publish a backend SOAP service as a REST service through Azure API Management. I already managed to publish it, but now I want to transform my backend POST operation to a GET. I use a liquid template to create my XML request message and I'm able to get my query parameters using

context.Request.MatchedParameters["parameter"]

One of my parameters is an array that is comma separated

http://myservice.com/service?arrayParam=value1,value2

A bit like this. But I can't find a way to split my string value. What I have already tried is

<% assign values=context.Request.MatchedParameters["arrayParam"] | split: "," %>
<% for item in values%>
<value>{{item}}</value>
<% endfor %>

But strangly, this is splitting my array in single characters. I also tried

<% assign values=context.Request.MatchedParameters["arrayParam"].Split(",")%>
<% for item in values%>
<value>{{item}}</value>
<% endfor %>

But no luck uptill now. Can somebody help me in the right direction please?

Kind Regards Tim

1

1 Answers

1
votes

Liquid Filters are using the C# naming convention, so you will need to use "Split" instead of "split".

This issue has tripped so many people up. Maybe it's time for a PR to dotLiquid to make filters case insensitive.