我正在研究 WSO2 ESB 代理服务,该服务涉及通过 ESB 上的 SOAP 端点公开内部 RESTful 服务。我的 RESTful 服务需要 Content-type = "application/rdf+xml"。我尝试使用文档中提到的所有 3 个属性来设置它:messageType、ContentType 和 CONTENT_TYPE。但是,请求内容类型仍然是“application/xml”。
这是我调用 REST 服务的序列的摘录:
   <property xmlns:ns="http://org.apache.synapse/xsd" name="REST_URL_POSTFIX" value="/record/12345" scope="axis2" type="STRING"/>
   <property name="HTTP_METHOD" value="PUT" scope="axis2" type="STRING"/>
   <property name="messageType" value="application/rdf+xml" scope="axis2" type="STRING"/>
   <property name="ContentType" value="application/rdf+xml" scope="axis2" type="STRING"/>
   <property name="CONTENT_TYPE" value="application/rdf+xml" scope="axis2" type="STRING"/>
   <send>
      <endpoint name="CQ">
         <address uri="http://my_url" format="pox">
         </address>
         <property xmlns:ns="http://org.apache.synapse/xsd" name="Authorization" expression="fn:concat('Basic ', base64Encode('username:password'))" scope="transport"/>
         <property name="OSLC-Core-Version" value="2.0" scope="transport"/>
         <property name="Accept" value="application/rdf+xml" scope="transport"/>
      </endpoint>
   </send>
我用 TCPMon 对其进行了测试,无论我使用什么 Content-type 属性,请求仍然包含“application/xml”。
请指教。