WSO2.如何获取编码转义字符的标记xml的值



您好!

客户端向代理服务器发送SOAP消息Xml编码的转义字符。如何从Xml中获取值?

示例。SOAP请求

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <GetPhone xmlns="http://ProxyService">
      <xml>&lt;xml&gt;&lt;phone&gt;8888888888&lt;/phone&gt;&lt;/xml&gt;</xml>
    </GetPhone>
  </s:Body>
</s:Envelope>

我需要获得一个电话号码并将其发送给XSLT中介。

这是我的代理服务:

<inSequence>
  <script language="js">mc.setPayloadXML(new XML(mc.getPayloadXML()..*::xml.toXMLString()));</script>
  <property xmlns:ns="http://ProxyService"
            name="phoneValue"
            expression="//ns:xml/ns:phone"
            scope="default"
            type="STRING"/>
  <log level="custom">
    <property name="logValue" expression="get-property('phoneValue')"/>
  </log>
  <xslt key="in_xslt">
    <property name="phone" expression="get-property('phoneValue')"/>
  </xslt>
  <log level="full"/>
  <send>
    <endpoint>
      <address uri="http://localhost:322/"/>
    </endpoint>
  </send>
</inSequence>

我做错了什么?

将toXMLString替换为toString:

<script language="js">mc.setPayloadXML(new XML(mc.getPayloadXML()..*::xml.toString()));</script>

最新更新