簡體   English   中英

WSO2 記錄屬性時缺少值

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM