我有一个 SOAP 服务,在将请求发送到后端服务之前,我需要向 XML Body 添加一个属性。
我的邮递员请求如下:
<?xml version="1.0" encoding="utf-8"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<gprnEnquiry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.somedomain.com">
<gprn>123456</gprn>
<registrationstatus>registrationstatus1</registrationstatus>
</gprnEnquiry>
</Body>
</Envelope>
我传入 text/xml 的 Content-Type 标头
我的 APIM 入站策略如下:
<set-body template="liquid">
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<gprnEnquiry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.somedomain.com">
<gprn>{{body.gprnEnquiry.gprn}}</gprn>
<registrationstatus>{{body.gprnEnquiry.registrationstatus}}</registrationstatus>
<authKey>{{My-NamedValue}}</authKey>
</gprnEnquiry>
</Body>
</Envelope>
</set-body>
通过在 APIM 中启用请求和响应正文捕获,我可以看到来自请求的值正在输入,而响应输出时没有任何值。
后端请求
<Envelope
xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<gprnEnquiry
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.somedomain.com">
<gprn></gprn>
<registrationstatus></registrationstatus>
<authKey>xxxxxxxxxxx</authKey>
</gprnEnquiry>
</Body>
</Envelope>
任何人都知道为什么源请求中的值没有被映射到后端请求?