WSO2 ESB:记录响应并将其从RDF REST服务转换回SOAP

WSO2 ESB:记录响应并将其从RDF REST服务转换回SOAP,rest,soap,wso2,wso2esb,Rest,Soap,Wso2,Wso2esb,我正在为我的公司开发WSO2 ESB POC,它涉及通过ESB上的SOAP端点公开内部RESTful服务。我已经阅读了所有与SOAP-REST中介相关的线程和博客文章,但仍然找不到答案。 我的RESTful服务返回“application/rdf+xml”消息格式。以下是我的顺序: <proxy xmlns="http://ws.apache.org/ns/synapse" name="CQProxy" transports="https,http" statistics="disable

我正在为我的公司开发WSO2 ESB POC,它涉及通过ESB上的SOAP端点公开内部RESTful服务。我已经阅读了所有与SOAP-REST中介相关的线程和博客文章,但仍然找不到答案。 我的RESTful服务返回“application/rdf+xml”消息格式。以下是我的顺序:

<proxy xmlns="http://ws.apache.org/ns/synapse" name="CQProxy" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
   <target>
      <inSequence>
         <send>
            <endpoint>
               <address uri="http://<MYURL>/cqweb/oslc/repo/eraprototype/db/CQT_T/simpleQuery/16783484?oslc.select=dcterms:title,cq:CM_Label,dcterms:type,cq:Assigned_To,oslc_cm:status,cq:AutoDeployment,cq:SentToEADS_By&oslc.where=oslc:shortTitle=CQT_T00000131" format="get"/>
               <property xmlns:ns="http://org.apache.synapse/xsd" name="Authorization" expression="fn:concat('Basic ', base64Encode('user:password'))" scope="transport"/>
               <property name="OSLC-Core-Version" value="2.0" scope="transport"/>
               <property name="Accept" value="application/rdf+xml" scope="transport"/>
            </endpoint>
         </send>
      </inSequence>
      <outSequence>
         <log level="full"/>
         <send/>
      </outSequence>
   </target>
   <publishWSDL key="gov:/services/cqproxy/CQProxy.wsdl">
      <resource location="CQProxy.xsd" key="gov:/services/cqproxy/CQProxy.xsd"/>
      <resource location="eads_ws.xsd" key="gov:/services/eads_ws/eads_ws.xsd"/>
   </publishWSDL>
   <description></description>
</proxy>

两个问题:
一,。在Axis2将SOAP转换应用于REST服务之前,如何记录从REST服务接收到的实际响应?我的日志中介器只生成空的SOAP信封

INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:4c06fcb9-4e45-4fb3-bc5a-4350e3d86533, Direction: response, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body/></soapenv:Envelope> {org.apache.synapse.mediators.builtin.LogMediator}
INFO{org.apache.synapse.mediators.builtin.LogMediator}-发送至:http://www.w3.org/2005/08/addressing/anonymous,WSAction:,SOAPAction:,MessageID:urn:uuid:4c06fcb9-4e45-4fb3-bc5a-4350e3d86533,方向:响应,信封:{org.apache.synapse.mediators.builtin.LogMediator}

2。如何将RDF+XML转换回SOAP格式?为此,我是否应该在输出序列中使用XSLT中介


谢谢你的帮助

我编写了一个简单的Nodejs服务,它发送RDF格式的消息。下面是我使用高级Rest客户端Chrome扩展调用它时的样子

然后,我在ESB4.5.1中创建了一个代理服务。这是我的代理服务配置

<proxy xmlns="http://ws.apache.org/ns/synapse" name="TestProxy" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
   <target>
      <inSequence>
         <log level="full"/>
         <send>
            <endpoint>
               <address uri="http://localhost:8080/" format="pox"/>
            </endpoint>
         </send>
         <log level="full"/>
         <drop/>
      </inSequence>
      <outSequence>
         <log level="full"/>
         <send/>
      </outSequence>
   </target>
   <description></description>
</proxy>

然后,我使用tryIt工具向这个代理服务发送一条XML消息。我正在使用日志中介来记录传入的XML消息

在out序列中,我再次使用日志中介,我可以看到RDF被记录在那里


您使用的ESB版本是什么?

我使用的是WSO2 ESB 4.6。您的代理配置与Chintana稍有不同:)1。我的REST服务需要“get”消息格式,它拒绝“pox”。2.我的代理发布WSDL。您能否修改配置以包含这两项内容,然后重试?进行了这两项更改。代理仍然有效。然后我尝试了4.6.0,我得到了和你一样的错误。在我看来,这似乎是新的直通传输4.6.0中的一个bug。我会多做一些调查。可能它需要一个额外的配置。对此的快速解决方案是注释掉
/repository/conf/axis2/axis2.xml
文件中的直通传输(transportSender位和transportReceiver位),然后切换到NIO传输。我检查过了,成功了,现在成功了!谢谢你,Chintana!我应该向WSO2 ESB 4.6提交缺陷吗。吉拉?
<proxy xmlns="http://ws.apache.org/ns/synapse" name="TestProxy" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
   <target>
      <inSequence>
         <log level="full"/>
         <send>
            <endpoint>
               <address uri="http://localhost:8080/" format="pox"/>
            </endpoint>
         </send>
         <log level="full"/>
         <drop/>
      </inSequence>
      <outSequence>
         <log level="full"/>
         <send/>
      </outSequence>
   </target>
   <description></description>
</proxy>