Вопрос

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