A
A
Alex Fox2020-05-26 00:45:03
Java
Alex Fox, 2020-05-26 00:45:03

Is it possible to parse soap response?

Hello. I don't know what to think anymore. Maybe someone can help.
There is a soap webservice with a method String test1(in param); (Pay attention to the returned response).
in wsdl it is described so and here the problem is probably and in fact there is no way to fix it.
wsimport (Spring Boot application) generates :

@WebMethod(action = "urn:getTest1")
    @WebResult(name = "getTest1Response", targetNamespace = "http://test/", partName = "body")
    @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
    public String getTest1(
        @WebParam(name = "getTest1", targetNamespace = "http://test/", partName = "body")
        GetTest1InParams inParams);

But in fact getTest1(...) returns XML (example):
<getTest1Response>
    <tag1></tag1>
  //......
   <tagN></tagN>
</getTest1Response>

I want to drive all the contents into a string (SOAPBody) so that the method returns a string and then unmarshall to do it.
Played with SOAPHandler - nothing comes out.
Did a replacement of the answer (to try if the content is as plain text) with:
<getTest1Response>
   простой текст
</getTest1Response>

but even so, the answer is not parsed into String.
Is there any way to check this.
I checked the version with the finished wsdl - everything is ok (if there is no #text after the tags). - but I can't do that.
And yet. When SOAP response came before all my manipulations/attempts,
then String getTest1(...) got into the string the end-of-line character - '\n'. - maybe via #text/

Thanks for the advice/s and your time.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question