ruby-on-rails - 从 Rails 发出 SOAP/XML 请求
问题描述
我有一个 xml 对象xml
:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<GetLocations xmlns="http://clients.mindbodyonline.com/api/0_5_1">
<Request>
<SourceCredentials>
<SourceName>{SourceName}</SourceName>
<Password>{Password}</Password>
<SiteIDs>
<int>{SiteID}</int>
</SiteIDs>
</SourceCredentials>
<XMLDetail>Bare</XMLDetail>
<PageSize>10</PageSize>
<CurrentPageIndex>0</CurrentPageIndex>
<Fields>
<string>Locations.Name</string>
<string>Locations.City</string>
</Fields>
</Request>
</GetLocations>
</soapenv:Body>
</soapenv:Envelope>
并试图复制我在示例中找到的这个请求:
POST https://clients.mindbodyonline.com/api/0_5_1/SiteService.asmx HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://clients.mindbodyonline.com/api/0_5_1/GetLocations"
Host: clients.mindbodyonline.com
Content-Length: 795
但我不知道如何SOAPAction
在我的请求中使用类似RestClient
.
您如何包含此类参数,或者是否有不同的方式来发出此类请求?
解决方案
推荐阅读
- python-3.x - 如何转换数据框
- java - Json转换java
- sql - MS SQL 新手,必须找出同一列第一行和第二行的小时数差异
- vb.net - 在 Visual Studio 2013 中打开 vb.net 解决方案后字符串的语法变形
- xcode - 在没有 Xcode 项目和其他应用程序的情况下,如何修改已编译 macOS 应用程序的样式?
- axapta - Dynamic AX 2012 R3 写入客户的空财务维度
- django - 无法在 UpdateView (Django) 中的 Queryset 中的对象中显示模板中新添加的属性
- javascript - 如果密码正确,则重定向
- python - 如何组合多个查询?
- javascript - 检查日期列表中是否存在月份和年份的有效方法