Spring
과 CXF
을 사용하여 간단한 비누 웹 서비스를 만들었습니다. 이제 XML 요청에 대해 GZIP 압축을 사용하려고합니다. 다음은 압축 된 요청을 수락하지만 응답은 압축되지 않습니다. 왜? 이 SoapService에SOAP 응답에 GZIP 압축을 사용하려면 어떻게해야합니까?
@Component
@WebService
public class SoapService {
}
@Autowired
private SpringBus bus;
EndpointImpl end = new EndpointImpl(bus, new SoapService());
end.getFeatures().add(config.gzipFeature());
ep.publish("/SoapService");
요청 :
Encoding: UTF-8
Http-Method: POST
Content-Type: text/xml;charset=UTF-8
Headers: {accept-encoding=[gzip,deflate], content-encoding=[gzip], connection=[Keep-Alive], content-type=[text/xml;charset=UTF-8], ...}
응답 (빈 헤더 !!) :
Content-Type: text/xml
Headers:
Payload: ...
왜 응답은 gzip으로 압축되지 않는 이유는 무엇입니까?
비누 몸체에 xml 메시지를 압축 바이너리 데이터의 base64 인코딩 문자열로 보내고 클라이언트 클라이언트가이 인코딩 된 문자열을 압축 해제 할 것을 제안합니다. –