Mule ESB将我的XML作为<string> xml </string>而不是正确的XML返回

时间:2014-04-24 17:44:46

标签: xml web service mule

我的Mule流程在使用我的网络浏览器作为客户端进行测试时,将我期望的XML结果作为一个类似XML的长字符串返回,其中包含&#34; string&#34;如果没有&#34; XML&#34;标记而不是格式正确的string标签。即我

  <string><?xml version="1.0" encoding="utf-8"?><scan><patient_fname>John</patient_fname><scan_id>41fc14e761024d65eb3f31e6f6ff9abb</scan_id><patient_lname>Smith</patient_lname><crtransform>0.3802383 -0.2290233 -0.8960843 68.6041674 0.8808550 0.3850588 0.2753618 -10.1133584 0.2819809 -0.8940235 0.3481504 23.7410466 0.0000000 0.0000000 0.0000000 1.0000000</crtransform><datetime>1393790925155012</datetime><cotransform></cotransform><ormco_id>1111121</ormco_id><patient_gender>M</patient_gender><uploads_complete>True</uploads_complete><doctor_email_id>abcde</doctor_email_id><patient_dob>1986-06-27</patient_dob></scan></string>
来自Mule的

而不是我需要的(当绕过Mule并直接在RESTful网络服务上请求时获取:

<scan>
  <patient_fname>John</patient_fname
  <scan_id>41fc14e761024d65eb3f31e6f6ff9abb</scan_id
  <patient_lname>Smith</patient_lname>
  <crtransform>0.3802383 -0.2290233 -0.8960843 68.6041674 0.8808550 0.3850588 0.2753618 -10.1133584 0.2819809 -0.8940235 0.3481504 23.7410466 0.0000000 0.0000000 0.0000000 1.0000000</crtransform>
  <datetime>1393790925155012</datetime>
  <cotransform/>
  <ormco_id>1111121</ormco_id>
  <patient_gender>M</patient_gender>
  <uploads_complete>True</uploads_complete>
  <doctor_email_id>abcde</doctor_email_id>
  <patient_dob>1986-06-27</patient_dob>
</scan>

这里是骡子流的相关部分:

...
<choice doc:name="Choice">
        <when expression="#[message.inboundProperties['format'] == 'xml']">
            <mulexml:object-to-xml-transformer mimeType="application/xml" doc:name="Object to XML"/>
            <set-property propertyName="Content-Type" value="text/xml" doc:name="text/xml content-type"/>
        </when>
        <otherwise>
            <json:object-to-json-transformer doc:name="Object to JSON"/>
        </otherwise>
    </choice>

任何建议都将不胜感激。

1 个答案:

答案 0 :(得分:0)

某处XML已转换为String <object-to-string-transformer>component或其他地方。