私は会社の 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>
リクエストを RESTful サービスに正常に送信できました。しかし、私の OUT シーケンスは "application/rdf+xml" 応答を処理できません。ログに次のエラーが表示されます。
INFO {org.apache.axis2.builder.BuilderUtil} - OMException in getSOAPBuilder {org.apache.axis2.builder.BuilderUtil}
org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope , but found RDF
2 つの質問:
1. Axis2 が SOAP 変換を適用する前に、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}
2. RDF+XML から SOAP フォーマットに変換するにはどうすればよいですか? このために OUT シーケンスで XSLT メディエーターを使用する必要がありますか?
あなたの助けに感謝!