记录属性时WSO2缺少值

问题描述

我目前坚持以下条件。

  • 目标1:在日志中获取URL

  • 目标2在发送介体中使用它

你们能帮我两个吗?

XML文件:

 <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 = 

它打印以下内容:

$img = $img->mergeImageLayers(Imagick::LAYERMETHOD_FLATTEN);

解决方法

我已经在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版本

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...