2012-03-06 13 views
2

私はSOとMuleのフォーラムで苦労していますが、うまくいく解決策を見つけることができません。 esbは、idを含む単一の要求を受け取り、関連するIDのリストで構成されるXMLペイロードを作成します。このXMLペイロードは分割され、それぞれの関連するIDを取得してメタデータを取得するトランスフォーマに送信されます。結果は、XMLレスポンスを作成するために一緒に結合されることになっています。私が抱えている問題は、最終結果セットをどのように変換しても、常にカプセル化文字列 "?? sr)java.util.concurrent.CopyOnWriteArrayListx]を持つドキュメントを返すということです。" "xMule Esb 3.2.1:スプリッタの結果を集めて結果をXMLとして出力

任意のアイデア/コメントをいただければ幸いです。ここ

は、私が使用していますラバ-configです:。


<http:connector name="HttpConnector" doc:name="HTTP\HTTPS"/> 
<expression-transformer name="ExtractId" doc:name="Expression"> 
    <return-argument evaluator="xpath" expression="//string[1]"/> 
</expression-transformer> 
<flow name="myFlow1" doc:name="myFlow1"> 
    <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="incoming/path/" connector-ref="HttpConnector" doc:name="HTTP"/> 
    <custom-transformer encoding="UTF-8" class="mycomponents.transformers.SubscriberRequestTransformer" doc:name="Create Hub Id Requests"/> 
    <mulexml:object-to-xml-transformer doc:name="Object to XML"/> 

    <splitter evaluator="xpath" expression="//entry/list/string" enableCorrelation="ALWAYS" doc:name="Splitter"/> 
    <transformer ref="ExtractId" doc:name="Transformer Reference"/> 
    <logger message="#[payload:]" level="INFO" doc:name="Logger"/> 
    <custom-transformer encoding="UTF-8" class="mycomponents.transformers.HubQueryProcessor" doc:name="Create Hub Id Requests"/> 
    <collection-aggregator /> 
    <component class="mycomponents.TopicResponseAggregatorComponent" doc:name="Collect requests" /> 
    <logger message="Aggregated Content (#[groovy:payload.size()] elements): \n#[payload:]" level="INFO" doc:name="Logger"/>   
    <logger message="#[payload:]" level="INFO" doc:name="Logger"/> 

</flow> 

を、私は問題を解決してきた私はかなりのものではないが。それが違う理由を理解する私はそれがミュール "マジック"のいくつかと関係していると仮定しています。私は流れを複数の流れに分割しました。それは、私が最終的にやり遂げようとしていたものです。しかし、これを行うことで問題は解決しました。 FYI

:ここで更新の流れです:デフォルトでは

<flow name="myFlow1" doc:name="myFlow1"> 
    <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="url/for/service/" connector-ref="HttpConnector" doc:name="HTTP"/> 
    <flow-ref name="createHubIdRequestsFlow" doc:name="Map To Hub Ids" doc:description="Takes in the situation id passed in by the client. Does the query lookup versus the content mapping tables. creates the correspondng requests for meta data information to the provider(s)"/> 
    <flow-ref name="getTopicRequests" doc:name="Process Provider Reponses" doc:description="For each JSON response returned from the provider, transform it into an XML representation of that data"/> 
    <flow-ref name="buildResponseFlow" doc:name="Build final response" doc:description="piece all the messages together into a single object as a string"/> 

    <response> 
     <message-properties-transformer> 
      <add-message-property value="text/xml" key="Content-Type" /> 
     </message-properties-transformer> 
    </response> 
</flow> 

答えて

3

は、メッセージ・プロパティトランスは「呼び出し」スコープで新しいプロパティを格納します。アウトバウンドスコープでコンテンツタイプを設定する必要があります。そのため、レスポンスフェーズでインバウンドHTTPエンドポイントが使用します。動作しません

<response> 
     <message-properties-transformer scope="outbound"> 
      <add-message-property value="text/xml" key="Content-Type" /> 
     </message-properties-transformer> 
    </response> 
+0

なし:

はこれを試してみてください。すべてのタグをエスケープするだけです。ワークフローが終了する前にペイロードをコンソールに出力すると、すべてがうまく見えます。私は望むXMLを返します。しかしその直後に、XML(ペイロード)が ** ?? sr)の前に付加されて返されます。java.util.concurrent.CopyOnWriteArrayListx]?F ?? xpwt? x ** –

+0

あなたの提案は、 "の中のすべてのタグをエスケープするようにその出力を変えます。 –

+0

myFlow1とのやり取りの質問を編集してログの内容を投稿できますか?プライバシーを理由にXMLを使用する –

関連する問題