Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set header? #1

Open
VinitYadav opened this issue Mar 27, 2018 · 1 comment
Open

How to set header? #1

VinitYadav opened this issue Mar 27, 2018 · 1 comment

Comments

@VinitYadav
Copy link

VinitYadav commented Mar 27, 2018

Hello,

I want to set WS-Addressing in header how I set it?

@ankushpatel18
Copy link

ankushpatel18 commented Jun 19, 2018

Add the following code in your ksoap envelope:-
soapEnvelope.headerOut = new Element[1]; soapEnvelope.headerOut[0] = buildAuthHeader();

Add this function that will create header elements
private Element buildAuthHeader() {
Element h = new Element().createElement(NAMESPACE, "AuthHeader");
Element username = new Element().createElement(NAMESPACE, "user");
username.addChild(Node.TEXT, USERNAME);
h.addChild(Node.ELEMENT, username);
Element pass = new Element().createElement(NAMESPACE, "pass");
pass.addChild(Node.TEXT, PASSWORD);
h.addChild(Node.ELEMENT, pass);

return h;

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants