how to get Store JAXBelement to String?

4.9k Views Asked by At

Hello I want to Store JAXBelement value to String variable how to do this kindly tell me please. I have Following method .

public JAXBElement<String> getSessionId()
 {
    return sessionId;
}

above method is in sessiondata class. i have create object of sessiodata class like below.

 sessiondata result=new sessiondata();

i have call getsession method of sessiondata class like below.

result.getssionId();

now i want to store sessionid in to string variable. but its type is JAXBelment now tell me how to store in to String.

now i want to store sessionId to One String variable. and pass in to another method. kindly help me.

1

There are 1 best solutions below

3
On

String sID = (String)result.getSessionId().getValue();