2012-09-19 4 views
0

HTTP 요청 (POST, 서블릿 끝점)에 의해 트리거 된 경로가 SOAP 웹 서비스 요청에 대한 속도로 변환 된 다음 http를 사용하여 WebService에 게시됩니다. 그런 다음 응답을 구문 분석하려고하지만 응답에서 이진 데이터를 얻습니다. SOAPUI는 올바른 데이터를 표시합니다.Apache Camel - 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을 지원한다고 말할 수 있습니다. 원격 서버는 gzip을 지원하고 일반 텍스트 데이터를 돌려 보내야합니다.

+0

hmm unmarshal(). gzip()을 시도하면 의심됩니다. –

+0

성공, 감사합니다. –

관련 문제