1

次のxpathを使用したい

/ユーザー/ユーザー/ユーザーID

ESB が XML の周りに SOAP エンベロープとボディを追加するため、これは機能しません。使用する正しい xpath は何ですか、または SOAP エンベロープとボディを削除するにはどうすればよいですか?

xml は次のとおりです。

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <Users xmlns="http://ws.wso2.org/dataservice">
         <User>
            <UserID>a</UserID>
            <Username>a</Username>
            <Email>a</Email>
            <Password>a</Password>
         </User>
         <User>
            <UserID>a</UserID>
            <Username>a</Username>
            <Email>a</Email>
            <Password>a</Password>
         </User>
         <User>
            <UserID>a</UserID>
            <Username>a</Username>
            <Email>a</Email>
            <Password>a</Password>
         </User>
      </Users>
   </soapenv:Body>
</soapenv:Envelope>

編集:

これは、反復メディエーターの外部でログに記録しようとすると機能します

//*[local-name() = 'Users']/*[local-name() = 'User']/*[local-name() = 'UserID']

しかし、反復メディエーター内でログに記録しようとすると、何も返されませんか?

4

3 に答える 3

1

以下を使用してこれを機能させました

<property xmlns:int="http://ws.wso2.org/dataservice" name="uri.var.ID" expression="$body/int:User/int:UserID/text()" scope="default" type="STRING"/>
于 2014-08-01T14:01:45.773 に答える
0

これを試して:

<property name="yourParamName" expression="$body/Users/User/UserID" scope="default" type="STRING"/>

定義済みの Synapse XPath 変数の詳細については、こちらを参照してください。

于 2014-07-31T15:54:10.073 に答える