문제

I need to get a soap response using "webServiceTemplate". Currently in my existing architecture it's using function "public boolean sendSourceAndReceiveToResult(String uri, Source requestPayload, Result responseResult) { } " but this is returning only boolean value, but is there any way to capture the soap response?

I tried with "marshalSendAndReceive" functions but its not working.

Could you please suggest how can I get the soap response using webServiceTemplate functions, or will I have to write a customized function for this ?

Thank You !

도움이 되었습니까?

해결책

You could do something like that:

ByteArrayOutputStream  bytArrayOutputStream = new ByteArrayOutputStream();

StreamResult result = new StreamResult(bytArrayOutputStream);

wsTemplate.sendSourceAndReceiveToResult(defautUri, source, result); 

final String reply = new String(bytArrayOutputStream.toByteArray());
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top