Skip to content

Instantly share code, notes, and snippets.

@kapilraj2436
Last active April 14, 2017 11:43
Show Gist options
  • Save kapilraj2436/fbeed20d3b255396e2b8dbf4e85b0fd7 to your computer and use it in GitHub Desktop.
Save kapilraj2436/fbeed20d3b255396e2b8dbf4e85b0fd7 to your computer and use it in GitHub Desktop.
How to set or add HTTP Header in a SOAP Request. Simple create a Hashmap. Here it is an example.
when creating SOAP Request, in Stub class
for which method you want to add header, Under this method just add this hashmap and fill that hashmap with a key value pair if you want to send details in the form of key value. We can create a list also if we want to send List values in Header.
This is an example to send Headers in Http Request. Here I am sending client ID and Password to INDUSIND Bank at the time of sending SOAP Request.
Hashtable headers=new Hashtable();
headers.put("User-Id", "KapilrajChouhan");
headers.put("Password", "password");
_setProperty(HTTPConstants.REQUEST_HEADERS, headers);
Where
1.) User-Id --> Key and afcc0f96-165d-4dde-83f0-2ae505b0d6ae --> is key Value
2.) Password --> key and password --> is key Value
We can modify key/values accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment