【问题标题】:org.apache.axis2.AxisFault: Transport error: 415 Error: Unsupported Media Typeorg.apache.axis2.AxisFault:传输错误:415 错误:不支持的媒体类型
【发布时间】:2015-09-22 11:52:56
【问题描述】:

我在 wso2 中创建了一个代理服务,在尝试访问代理服务时它显示错误为 Unsupported Media Type,但我设置了 Content-Type: application/xml .payload is in xml format,所以我将其设置为 application /xml 在源代码视图中,仍然出现相同的错误,请帮助我解决此问题

**Proxy Service:**
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="test"
       transports="http,https"
       statistics="enable"
       trace="enable"
       startOnLoad="true">
   <target>
      <outSequence>
         <property name="Content-Type" value="application/xml"/>
         <send/>
      </outSequence>
      <endpoint>
         <address uri="http://192.35.72.369:8080/ESB_Services/DRAM/service/CreateCustomer"/>
      </endpoint>
   </target>
   <description/>
</proxy>

**Payload:**
<customer>
    <name>admin</name>
    <email>admin@gmail.com</email>
    <mobile_number>9904324234</mobile_number>
    <address>Bangalore</address>
    <zipcode>574515</zipcode>
</customer>

**ERROR:**
<TryitProxyError h:status="SOAP envelope error" xmlns:h="http://wso2.org/ns/TryitProxy">org.apache.axis2.AxisFault: Transport error: 415 Error: Unsupported Media Type</TryitProxyError>

【问题讨论】:

    标签: rest soap wso2 wso2esb esb


    【解决方案1】:

    当您需要选择合适的 messageFormatter 来格式化从 ESB 发出的消息时,您可以使用属性 'messageType' :&lt;property name="messageType" value="application/xml" scope="axis2" /&gt;

    【讨论】:

      猜你喜欢
      • 2018-10-13
      • 2018-07-25
      • 2016-09-09
      • 2017-08-28
      • 2015-06-18
      • 2021-10-12
      • 2017-10-23
      • 2014-10-02
      • 2014-06-21
      相关资源
      最近更新 更多