2014-01-22 50 views
1

我試圖將SOAP/XML後端服務的響應轉換爲csv。 我這樣做是使用XSLT回來的失序,並通過將MessageType屬性爲「text/plain的」,例如:WSO2 ESB 4.8.0 - 將XML轉換爲CSV時的空白純文本/文本響應

<log level="full"> 
<property name="sequence" value="outSequence - transforming newhires xml to csv"></property> 
</log> 
<fastXSLT key="transform/newhires-to-csv.xslt"></fastXSLT> 
<log level="full"> 
<property name="sequence" value="outSequence - returning response to client"></property> 
</log> 
<property name="messageType" value="text/plain" scope="axis2"></property> 
<send></send> 

如果我把瀏覽器的代理服務,我收到一個空的200響應,與ContentType:text/plain。日誌顯示:

To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:abe469ee-a0e4-4a59-9afb-c4ad513c500f, Direction: response, sequence = outSequence - returning response to client, Envelope: <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><text xmlns="http://ws.apache.org/commons/ns/payload"><?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body>Michael,Peter,Simpson,Michael,1 Test Street,,TEST,0001,,1 Test Street,,TEST,0001,,,,MR,Male,2014-01-20Z,LTEBA,7098,EBA,G4,0,,24.58,1820,222301,MISS,A,A,Friend,A,,,,,1,1,b,1,2014-02-08Z,223173708 Wayne,G,Irwin,Wayne,1 Test Way,,TESTVILLE,0231,ACT,1 Test Way,,TESTVILLE,0231,ACT,61278963254,61412985672,MR,Male,1976-07-07Z,CSEBA,7098,EBA,G1C,1,,24.21,0,222301,MR,Snoopy,Dog,pet,kennel,022 596 3654,,,,733397,123456789,Wayne Irwin,0,2014-01-27Z,223193022 </soapenv:Body></soapenv:Envelope></text></soapenv:Body></soapenv:Envelope>

這顯然是一個SOAP信封轉換的消息。我已經取消註釋短信建設者和消息轉換器,所以這應該工作。

還有什麼我需要做的,讓代理服務正確地返回文本/平原響應?感謝

+0

您可以請在esb中啓用肥皂示蹤劑(http://docs.wso2.org/display/ESB460/SOAP+Tracer)並用響應消息更新問題。 – DarRay

回答

0

標準XSLT中介。由於某些原因,標準介體不包含soap信封,但fastXSLT的確。

0

與你的改造,你應該產生這樣的文本節點:

<text xmlns="http://ws.apache.org/commons/ns/payload">Michael,Peter,Simpson,Michael,1 Test Street,,TEST,0001,,1 Test Street,,TEST,0001,,,,MR,Male,2014-01-20Z,LTEBA,7098,EBA,G4,0,,24.58,1820,222301,MISS,A,A,Friend,A,,,,,1,1,b,1,2014-02-08Z,223173708 Wayne,G,Irwin,Wayne,1 Test Way,,TESTVILLE,0231,ACT,1 Test Way,,TESTVILLE,0231,ACT,61278963254,61412985672,MR,Male,1976-07-07Z,CSEBA,7098,EBA,G1C,1,,24.21,0,222301,MR,Snoopy,Dog,pet,kennel,022 596 3654,,,,733397,123456789,Wayne Irwin,0,2014-01-27Z,223193022</text> 

- >通過交換fastXSLT調解員的刪除管理來解決這個問題<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">和相應的結束標記