2

I am trying to transform a JSON response from a target end point into soap message. I have 2 policies in the post flow.

  1. JSONTOXML - If I disable xsltransform I see the xml result so this work.
  2. xsltransform - this just point to my xsltransform file which has the template and dynamic content supposed to come from the xml from step 1.

Both source and output are set to "response" but it looks like it failed to cast in step 2. What should I make step 2 to pick up the xml and apply the xsl? How else can I do this? Thanks

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<JSONToXML async="false" continueOnError="false" enabled="true" name="jsontoxml-2">
    <DisplayName>JSONtoXML-2</DisplayName>
    <FaultRules/>
    <Properties/>
    <Options>
        <NullValue>NULL</NullValue>
        <NamespaceBlockName>#namespaces</NamespaceBlockName>
        <DefaultNamespaceNodeName>$default</DefaultNamespaceNodeName>
        <NamespaceSeparator>:</NamespaceSeparator>
        <TextNodeName>#text</TextNodeName>
        <AttributeBlockName>#attrs</AttributeBlockName>
        <AttributePrefix>@</AttributePrefix>
        <InvalidCharsReplacement>_</InvalidCharsReplacement>
        <ObjectRootElementName>Root</ObjectRootElementName>
        <ArrayRootElementName>Array</ArrayRootElementName>
        <ArrayItemElementName>Item</ArrayItemElementName>
    </Options>
    <OutputVariable>response</OutputVariable>
    <Source>response</Source>
</JSONToXML>

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XSL async="false" continueOnError="false" enabled="true" name="xsltransform-1">
    <DisplayName>XSLTransform-1</DisplayName>
    <FaultRules/>
    <Properties/>
    <Source>response</Source>
    <ResourceURL>xsl://xsltransform-1</ResourceURL>
    <Parameters ignoreUnresolvedVariables="true"/>
    <OutputVariable>response</OutputVariable>
</XSL>
4

2 回答 2

6

OutputVariable 不能设置为“响应”。

尝试删除“OutputVariable”行,或将其留空。删除它,应该会导致输出转到响应有效负载。

换句话说,试试这个:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XSL async="false" continueOnError="false" enabled="true" name="xsltransform-1">
    <DisplayName>XSLTransform-1</DisplayName>
    <FaultRules/>
    <Properties/>
    <Source>response</Source>
    <ResourceURL>xsl://xsltransform-1</ResourceURL>
    <Parameters ignoreUnresolvedVariables="true"/>
</XSL>
于 2014-01-19T19:42:22.063 回答
0

总是这样吗?OutputVariable 永远不能在响应时设置?

于 2014-02-20T15:28:48.930 回答