如何将text / xml响应转换为application / json wso2 EI

阿努什卡·埃卡纳纳克

我有一个肥皂服务,我需要将此服务公开为Wso2 EI中的rest api,内容类型为text / xml,我尝试了

<property name="messageType" value="application/json" scope="axis2"/>

乱序,但它不会将我的响应转换为json。您能帮我做一下吗。

我试过了

    <resource methods="POST">
      <inSequence>
         <send>
            <endpoint>
               <address uri="http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL"/>
            </endpoint>
         </send>
      </inSequence>
      <outSequence>
         <property name="messageType" value="application/json" scope="axis2"/>
         <send/>
      </outSequence>
   </resource>
阿鲁南·苏古纳库玛(Arunan Sugunakumar)

它应该工作完美。下面提供了示例REST API配置。

<api xmlns="http://ws.apache.org/ns/synapse" name="CheckREST" context="/samplerest">
   <resource methods="GET">
      <inSequence>
         <send>
            <endpoint>
               <http uri-template="http://localhost:8280/services/sampleSOAPproxy"/>
            </endpoint>
         </send>
      </inSequence>
      <outSequence>
         <property name="messageType" value="application/json" scope="axis2" type="STRING"/>
         <send/>
      </outSequence>
   </resource>
</api>

如果不起作用,请提及您正在使用的EI版本。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章