org.apache.axis2.AxisFault:传输错误:415错误:不支持的媒体类型

时间:2015-09-22 11:52:57

标签: rest soap wso2 wso2esb esb

我在wso2中创建了代理服务,尝试访问代理服务时显示错误为不支持的媒体类型,但我设置了Content-Type:application / xml .payload是xml格式,所以我将其设置为应用程序/ 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>

1 个答案:

答案 0 :(得分:0)

当您需要选择适当的messageFormatter(用于格式化从ESB发出的消息)时,您使用属性“messageType”:<property name="messageType" value="application/xml" scope="axis2" />