You need to sign in to do that
Don't have an account?
How to set the password and its type in the header (WS-Security) when making a soap request
I am facing the exact problem being described here.
My header looks like this:
<env:Header>
<Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-ecext-1.0.xsd">
<UsernameToken><Username>username</Username>
<Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest" />
</UsernameToken>
<TimeStamp />
</Security>
</env:Header>
This is when the class is :
public class Password_element {
public String Type_x;
private String[] Type_x_att_info = new String[]{'Type'};
private String[] apex_schema_type_info = new String[]{'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','true','false'};
private String[] field_order_type_info = new String[]{};
public Password_element(String typeOfpwd)
{
this.Type_x = typeOfpwd;
}
}
If I add an extra element in the class: Like:
public String Password;
private String[] Password_type_info = new String[]{'Password','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
Then the header looks like :
<Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest" > <Password> Password </Password></Password>
How do I set the password without adding an additional tag?
Thanks,
Anand