[英]WSO2 missing value when logging property
我目前坚持以下内容。
目标一:获取日志中的URL
目标 2 在发送调解器中使用它
你们能帮我两个吗?
XML 档案:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<meta:MetaDataType xmlns:meta="http://teswt.nl/xmlschemas/meeeeta/0.1">
<meta:Version>6.3</meta:Version>
<meta:FixLevel>0.0</meta:FixLevel>
<meta:Endpoint>http://555.555.555.55:8088/sal</meta:Endpoint>
</meta:MetaDataType>
</soap:Header>
到目前为止代理序列中的代码:
<property xmlns:meta="http://teswt.nl/xmlschemas/meeeeta/0.1" expression="$header//meta:MetaDataType/meta:Endpoint" name="URL" scope="default" type="STRING"/>
<log level="custom">
<property xmlns:meta="http://teswt.nl/xmlschemas/meeeeta/0.1" expression="get-property('URL')" name="URL"/>
</log>
<send>
<endpoint>
<address format="soap11" uri="http://555.555.555.55:8088/sal"/>
</endpoint>
</send>
它打印以下内容:
INFO {org.apache.synapse.mediators.builtin.LogMediator} - URL =
我已经在 EI 6.6.0 服务器中测试了给定的请求和 XPath 表达式,我可以观察到 XPath 按预期工作并记录 URL。
要求
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<meta:MetaDataType xmlns:meta="http://teswt.nl/xmlschemas/meeeeta/0.1">
<meta:Version>6.3</meta:Version>
<meta:FixLevel>0.0</meta:FixLevel>
<meta:Endpoint>http://555.555.555.55:8088/sal</meta:Endpoint>
</meta:MetaDataType>
</soap:Header>
<soap:Body/>
</soap:Envelope>
代理服务
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="test"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="http,https">
<target>
<inSequence>
<property xmlns:meta="http://teswt.nl/xmlschemas/meeeeta/0.1"
expression="$header//meta:MetaDataType/meta:Endpoint"
name="URL"
scope="default"
type="STRING"/>
<log level="custom">
<property xmlns:meta="http://teswt.nl/xmlschemas/meeeeta/0.1"
expression="get-property('URL')"
name="URL"/>
</log>
</inSequence>
</target>
<description/>
</proxy>
您能否启用电汇日志并检查该服务是否收到了所需的请求。 您还可以在提取 URL 之前添加<log level="full"/>
以检查收到的有效负载。 除此之外,您使用的EI版本是多少
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.