0

A QueryString normally allows name/value-pairs, where the same name can occur several times. When using WCF-WebHttp and BtsHttpUrlMapping, for caling a REST service, it maps from a property schema, which does not allow repeating element and that make the url mapping not allowing the same parameter being added more than once.

I need to add an array of parameters like: /query?param1=x&param1=y and so on.

Am I forced to use a dynamic port and set the url in the orchestration? Any other suggestions or samples would be much appropriated.

0

1 Answer 1

0

If it is a fixed number of repeating variable then just map them to a schema where they are name non repeating ones.

e.g.

<value>xvalue</value>
<value>yvalue</value>

maps to

<x>xvalue</x>
<y>yvalue</y>

URL Mapping

/query?param1={x}&amp;param1={y}

If it is a variable but a fixed maximum number of elements then use the above, but also set the BTS.Operation property and have

<BtsHttpUrlMapping>
      <Operation Name='Retrieve1' Method = 'GET' Url='/query?param1={x}' 
      <Operation Name='Retrieve2' Method = 'GET' Url='/query?param1={x}&amp;param1={y}' />
      <Operation Name='Retrieve3' Method = 'GET' Url='/query?param1={x}&amp;param1={y}&amp;param1={z}' />
      ... 
</BtsHttpUrlMapping>
Sign up to request clarification or add additional context in comments.

4 Comments

Thank you for answering and I will save you suggestion for the future. Unfortunately my variables are not fixed.
@MartinBring Then you may have to create the query parameter as a string and have that as the context property that you map
Yes, that seems to be the path ahead, thank you. I guess your suggestion use a dynamic port? I noticed that if you use an UrlMapping with parameters with the same name one gets validation error on a static port. I have not tested with a dynamic port yet, but will go on creating the whole Url/QueryString.
This led me to a solutions that worked, a dynamic port and Creation of the url in an orchestration.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.