输入不进入转换,Datapower

时间:2016-08-09 07:19:03

标签: xml web-services backend ibm-datapower

Good Mornning,

我通过cURL命令发送XML请求,用于我的带有Looback配置的服务XML防火墙。包含以下内容的规则的输入数据条目:

Rule client to server XML Firewall LoopBack Config

发送的输入数据是:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:dpconfig="http://www.datapower.com/param/config" xmlns:dp="http://www.datapower.com/extensions" extension-element-prefixes="dp" xmlns:regexp="http://exslt.org/regular-expressions">
    <xsl:output method="xml"/>
    <xsl:template match="/">

<xsl:variable name=”message”>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.ws.identify.com" xmlns:code="http://code.ws.identify.com">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:validaCode>
         <ser:obj>
            <code:code>2016</code:code>
            <code:mensaje></code:mensaje>
         </ser:obj>
      </ser:validaCode>
   </soapenv:Body>
</soapenv:Envelope>

<xsl:variable name=”result” select=’dp:soap-call(“http://localhost:8080/ValidaCodigo/services/ImplCode”, $message)’/>
</xsl:variable>

<xsl:variable name=”respuestaDato” select=”$result//*[namespace-uri()=’uri-servicio’ and local-name()=’code’]/code()”/>

 </xsl:template>
</xsl:stylesheet>

此数据适用于本地计算机中的Web服务。发送代码标签时,服务返回不同的代码标签。问题是,为什么输入数据不会传递给策略规则中的转换?当规则中的数据输入转换图标时,转换的输出数据为空。

1 个答案:

答案 0 :(得分:0)

如果这是您在XMLFW中运行的XSLT,那么您将始终发送相同的数据,即变量“message”的内容。

您将响应值转换为变量“respuestaDato”,但您永远不会将其写回OUTPUT。

您需要添加OUTPUT,例如:

<xsl:variable name=”respuestaDato” select=”$result//*[namespace-uri()=’uri-servicio’ and local-name()=’code’]/code()”/>
<xsl:value-of select=”respuestaDato” />

另外,您可以直接输出结果:

<xsl:value-of select=”$result//*[namespace-uri()=’uri-servicio’ and local-name()=’code’]/code()”/>