2012-09-19 46 views
0

響應問題我具有由http請求觸發的路線(POST,Servlet的端點),使用速度到SOAP web服務請求轉換的數據,然後使用http它發佈到web服務。然後我試圖解析這個響應,但是我在響應中獲得了二進制數據。儘管SOAPUI顯示正確的數據。Apache的駱駝 - 分析來自HTTP端點

想法?

from("servlet:///cancelCode?servletName=CamelServlet") 
.to("velocity:classpath:cancelCode.vm") 
.setHeader(Exchange.HTTP_METHOD, constant("POST")) 
.to(inteleOrderServiceEndpoint) 

響應在控制檯:

2012-09-19 13:22:11 DEBUG [header:] << "HTTP/1.1 200 OK[\r][\n]" 
2012-09-19 13:22:11 DEBUG [header:] << "HTTP/1.1 200 OK[\r][\n]" 
2012-09-19 13:22:11 DEBUG [header:] << "Content-Type: text/xml; charset=utf-8[\r][\n]" 
2012-09-19 13:22:11 DEBUG [header:] << "Content-Encoding: gzip[\r][\n]" 
2012-09-19 13:22:11 DEBUG [header:] << "Transfer-Encoding: chunked[\r][\n]" 
2012-09-19 13:22:11 DEBUG [header:] << "Server: Jetty(6.1.x)[\r][\n]" 
2012-09-19 13:22:11 DEBUG [header:] << "[\r][\n]" 
2012-09-19 13:22:11 DEBUG [content:] << "1" 
2012-09-19 13:22:11 DEBUG [content:] << "0" 
2012-09-19 13:22:11 DEBUG [content:] << "0" 
2012-09-19 13:22:11 DEBUG [content:] << "[\r]" 
2012-09-19 13:22:11 DEBUG [content:] << "[\n]" 
2012-09-19 13:22:11 DEBUG [content:] << "[0x1f][0x8b][0x8][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x8d][0x92]]j[0xc3]0[0x10][0x84][0xdf]{[\n]" 
2012-09-19 13:22:11 DEBUG [content:] << "[0xe3][0x3]hq[0xff]k\A[0xeb][0x98][0xb6][0x10][0xf2][0x90][0x1b][0xa8][0xf2][0xd2][0x14]$[0xad][0xd1][0xca][0xa1][0xb9]}[0xe5]Dn[0xed]bJ[0xde][0xa4][0x99][0xf9][0x16][0xcd][0xa2][0x8a]Iu[0xe8][0xf6]e[0xe3][0xf6]h[0xa8][0xc3][0xec][0xcb][0x1a][0xc7]e[0x92][0x1f][0xf3]][0x8]][0x9][0xc0]z[0x87]V[0xb1][0x88][0xee]`[0x9][0xf2][0x1f]0[0x1c][0x0][0x13][0x7]y"[0xb5]r?[0x14][0xb6]Z8[0xc][0x9a][0xac][0x8]h[0xd0][0x91][0x17][0x8e] &4[0x1a]M-z[0xe4][0x8e][0x1c][0xe3][0x84]-[0xce][0x86]9[0xa8][0xd0]s./[0xb2],[0xab][0xc6][0x1a][0xaf][0xa8][0xe2]X[0x98][0x8b][0xcf][0xd4][0x1e][0x8e][0xca] [0xc6][0x1][0xe5]iH[0x1d][0x87]l[0xd3][0xb][0xb6]Da[0x8c],[0xa6]z3[0xf5]S[0xa4](u[0xcf][0x81],[0xfa][0xb7][0x95]|[0xa1][0x83]jU[0x5][0xf5][0x5][0x8a][0xd1]*[0xb3][0xe9][0xed];zY\^][0xdf][0xdc][0xde][0xdd]?$tf.[0xc1][0xc7][0xde][0xb2]~[0xda][0xd4][0xcd]z[0xdd][0xac]F[0xec]$O:[0xc0]%[0x16][0xdc][0xf9]"*[0x98][0xaf][0xef][0xf7]>~[0x15][0xf9][\r][0xd4][0xe9][0x80][0xdd]=[0x2][0x0][0x0]" 
2012-09-19 13:22:11 DEBUG [content:] << "[\r]" 
2012-09-19 13:22:11 DEBUG [content:] << "[\n]" 
2012-09-19 13:22:11 DEBUG [content:] << "0" 
2012-09-19 13:22:11 DEBUG [content:] << "[\r]" 
2012-09-19 13:22:11 DEBUG [content:] << "[\n]" 
2012-09-19 13:22:11 DEBUG [content:] << "[\r]" 
2012-09-19 13:22:11 DEBUG [content:] << "[\n]" 
2012-09-19 13:22:11 DEBUG [header:] << "[\r][\n]" 

回答

2

含量gzip的編碼(例如壓縮),因此爲什麼它顯示爲二進制數據。

您可以解壓縮以解析數據爲純文本。或者當你調用遠程http服務器時,你可以告訴你的http服務器而不是支持gzip,遠程服務器應該承認併發回純文本數據。

+0

嗯懷疑,嘗試unmarshal()。gzip() –

+0

成功,謝謝 –