apigee - How to extract variable from SOAP request in Edge policy? -
here's policy:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <extractvariables async="false" continueonerror="false" enabled="true" name="extract-operation"> <displayname>extract-operation</displayname> <ignoreunresolvedvariables>false</ignoreunresolvedvariables> <source clearpayload="true">request.content</source> <variableprefix>apigee</variableprefix> <xmlpayload stoppayloadprocessing="false"> <namespaces> <namespace prefix="soapenv">http://schemas.xmlsoap.org/soap/envelope/</namespace> </namespaces> <variable name="operation" type="string"> <xpath>/soapenv:envelope/soapenv:body</xpath> </variable> </xmlpayload> </extractvariables>
in trace tool see request.content resolves fine , shows content, expecting apigee.operation populated contents of . doing wrong?
fixed policy:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <extractvariables async="false" continueonerror="false" enabled="true" name="extract-operation"> <displayname>extract-operation</displayname> <ignoreunresolvedvariables>false</ignoreunresolvedvariables> <source clearpayload="true">request.content</source> <xmlpayload stoppayloadprocessing="false"> <namespaces> <namespace prefix="soapenv">http://schemas.xmlsoap.org/soap/envelope/</namespace> </namespaces> <variable name="operation" type="nodeset"> <xpath>/soapenv:envelope/soapenv:body</xpath> </variable> </xmlpayload> </extractvariables>
if know xpath don't need scema , take on more variable out of equation (ie whether schema valid). reference //body (or wherever in xml)
Comments
Post a Comment