MGA
MGA

Reputation: 3

Consume Webservice JAX with JSP

Hello i have a little question, well i am new on webservice and i am trying to consume a webservice which returns an xml structure, but i only want the String result, this is the method for take the result

public JAXBElement<ResultLogin> getResultLogin() {
        return resultLogin;
    }

i return it on String parsing it with toString(); but only returns a strange code not the true result.

Any tips? or tutorials or something? Ty

Upvotes: 0

Views: 57

Answers (1)

David Liz&#225;rraga
David Liz&#225;rraga

Reputation: 1192

I guess the problem is that you are invoking the toString() method on the JAXBElement object returned. Instead, what you need to do is to get the value out of the JAXBElement, cast it to a ResultLogin object and invoke toString() on it:

((ResultLogin) getResultLogin().getValue()).toString();

Upvotes: 1

Related Questions