I'm attempting to create an android app that makes a SOAP request. I've tried several different libraries (OkHTTP, kSoap2) to help me with this, and am currently trying to make classes generated through EasyWSDL work.
I'm able to create and send the request, but I can't seem to add the headers that I need. I'm adding them thusly, in the code:
HeaderProperty hProp1 = new HeaderProperty("Authorization", "Basic " +
org.kobjects.base64.Base64.encode("########:#######".getBytes()));
HeaderProperty hProp2 = new HeaderProperty("Username", "########");
HeaderProperty hProp3 = new HeaderProperty("Password", "########");
service.httpHeaders.add(hProp2);
service.httpHeaders.add(hProp3);
service.httpHeaders.add(hProp1);
But in the end, the request that's generated lacks these headers:
<v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:c="http://www.w3.org/2003/05/soap-encoding" xmlns:v="http://www.w3.org/2003/05/soap-envelope">
<v:Header />
<v:Body>
Can anyone tell me what I'm doing wrong? Happy to provide further detail if needed.