如何使用Apigee上的“提取变量”策略从没有名称空间的SOAP响应中提取变量。 这是SOAP响应:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ServiceCatalogResponse xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ServiceReply xsi:type="ns:ServiceReply" xmlns:ns="http://xmlns.telco.com/ServiceCatalog/ServiceReply" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/">
<ns:Header>
<ns1:ResponseCode xmlns:ns1="http://xmlns.telco.com/EAI/Common/ResponseCodes">0</ns1:ResponseCode>
<ns1:ResponseMsg xmlns:ns1="http://xmlns.telco.com/EAI/Common/ResponseCodes">Success</ns1:ResponseMsg>
<ns1:ErrorDescription xmlns:ns1="http://xmlns.telco.com/EAI/Common/ResponseCodes"/>
<ns1:RequestId xmlns:ns1="http://xmlns.telco.com/EAI/Common/ResponseCodes">41d17462</ns1:RequestId>
</ns:Header>
<ns:Body>
<ns1:Response xmlns:ns1="http://xmlns.telco.com/ServiceCatalog/Business/GetCRMCustomerData_v1">
<ns1:Customer>
<ns1:Id>89OVDT6</ns1:Id>
<ns1:AccountStatus>Customer</ns1:AccountStatus>
<ns1:AccountStatusDate>01/20/2015</ns1:AccountStatusDate>
<ns1:AccountTypeCode>Customer</ns1:AccountTypeCode>
<ns1:Name>9123</ns1:Name>
</ns1:Customer>
</ns1:Response>
</ns:Body>
</ServiceReply>
</ServiceCatalogResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
NB ServiceCatalogResponse和ServiceReply没有名称空间。
这是提取变量政策的一部分
<XMLPayload>
<Namespaces>
<Namespace prefix="SOAP-ENV">http://schemas.xmlsoap.org/soap/envelope/</Namespace>
<Namespace prefix="ns">http://xmlns.telco.com/ServiceCatalog/ServiceReply</Namespace>
<!--<Namespace prefix="ns1">http://xmlns.telco.com/EAI/Common/ResponseCodes</Namespace>-->
<Namespace prefix="xs">ServiceCatalogResponse</Namespace>
<Namespace prefix="type">ns:ServiceReply</Namespace>
<Namespace prefix="ns1">http://xmlns.telco.com/ServiceCatalog/Business/GetCRMCustomerData_v1</Namespace>
</Namespaces>
<Variable type="string" name="ResponseCode">
<XPath>/SOAP-ENV:Envelope/SOAP-ENV:Body/xs:ServiceCatalogResponse/type:ServiceReply/ns:Header/ns1:ResponseCode/text()</XPath>
</Variable>
<Variable type="string" name="ResponseMsg">
<XPath>/SOAP-ENV:Envelope/SOAP-ENV:Body/xs:ServiceCatalogResponse/type:ServiceReply/ns:Header/ns1:ResponseMsg/text()</XPath>
</Variable>
<Variable type="string" name="ErrorDescription">
<XPath>/SOAP-ENV:Envelope/SOAP-ENV:Body/xs:ServiceCatalogResponse/type:ServiceReply/ns:Header/ns1:ErrorDescription/text()</XPath>
</Variable>
<Variable type="string" name="RequestId">
<XPath>/SOAP-ENV:Envelope/SOAP-ENV:Body/xs:ServiceCatalogResponse/type:ServiceReply/ns:Header/ns1:RequestId/text()</XPath>
</Variable>
</XMLPayload>
我的挑战是 ServiceCatalogResponse 和 ServiceReply 。如何从SOAP响应中提取变量并将其映射到“提取变量”策略?