我将尝试使用提供的文档(这里)和(这里)将我的Postman中的SOAP信封可视化为一个简单的表格。
我尝试的是根据“结果 > 属性 > 属性 > 名称”动态生成所有标题列,并使值行从“结果 > 属性 > 属性 > 值”中传播。是否可能实现?
以下是我的有效载荷:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<wsa:Action>RetrieveResponse</wsa:Action>
<wsa:MessageID>urn:uuid:e0817ed7-6575-4b05-8af4-0aa66bc3a428</wsa:MessageID>
<wsa:RelatesTo>urn:uuid:49866f4c-0c5f-4d8e-b11d-cc194878215b</wsa:RelatesTo>
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-a0a30316-f6c4-4a36-bb48-13af93f451c6">
<wsu:Created>2020-03-11T17:14:16Z</wsu:Created>
<wsu:Expires>2020-03-11T17:19:16Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</env:Header>
<soap:Body>
<RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
<OverallStatus>OK</OverallStatus>
<RequestID>83222ed5-75a0-4ac0-8bb3-e3f76fdf89f9</RequestID>
<Results xsi:type="DataExtensionObject">
<PartnerKey xsi:nil="true"/>
<ObjectID xsi:nil="true"/>
<Type>DataExtensionObject</Type>
<Properties>
<Property>
<Name>key</Name>
<Value>11223344</Value>
</Property>
<Property>
<Name>status</Name>
<Value>pending</Value>
</Property>
</Properties>
</Results>
<Results xsi:type="DataExtensionObject">
<PartnerKey xsi:nil="true"/>
<ObjectID xsi:nil="true"/>
<Type>DataExtensionObject</Type>
<Properties>
<Property>
<Name>subscriberkey</Name>
<Value>334455</Value>
</Property>
<Property>
<Name>status</Name>
<Value>sync_failure</Value>
</Property>
</Properties>
</Results>
</RetrieveResponseMsg>
</soap:Body>
</soap:Envelope>
这是我目前在测试脚本中编写的内容:
var template = `
<table bgcolor="#FFFFFF">
<tr>
{{#each}}
<td>{{header name}}</td>
{{/each}}
</tr>
{{#each}}
<tr>
<td>{{value}}</td>
</tr>
{{/each}}
</table>
`;
// Set visualizer
pm.visualizer.set(template, {
// Pass the response body parsed as JSON as `data`
response: pm.response.json()
});
我尝试的是根据“结果 > 属性 > 属性 > 名称”动态生成所有标题列,并使值行从“结果 > 属性 > 属性 > 值”中传播。是否可能实现?