url - BizTalk WCF-WebHttp - How to add parameter to Url with same name
问题描述
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¶m1=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.
解决方案
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}&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}&param1={y}' />
<Operation Name='Retrieve3' Method = 'GET' Url='/query?param1={x}&param1={y}&param1={z}' />
...
</BtsHttpUrlMapping>
推荐阅读
- aws-lambda - 当 Lambda 是容器时在本地运行 AWS Lambda 和 SNS
- r - [R][r] 光栅操作,从缓冲区中提取值而不重叠
- c++ - 分形分辨率降低(片段着色器)
- google-cloud-platform - 申请更高的 Google Tasks API 配额?
- php - codeigniter 获取最近查询的 postgres 字段类型
- python - 来自 Heroku 上工作进程的 psycopg2.errors.UniqueViolation
- java - java - 如何在java springboot中实现集群设置的缓存?
- android - 为什么我无法从视图模型类中获取值?
- javascript - VueJS如何过滤分页列表中的搜索
- apache - SetEnvIfNoCase 未正确设置变量值