security static method
XmlDocumentFragment
security({})
XML for the SOAP security
Implementation
static XmlDocumentFragment security(
{required String username,
required String password,
required String nonce,
required String created}) {
builder.element('Security', nest: () {
builder.namespace('http://www.w3.org/2003/05/soap-envelope', 's');
builder.namespace(
'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd');
builder.attribute('mustUnderstand', 1,
namespace: 'http://www.w3.org/2003/05/soap-envelope');
builder.element('UsernameToken', nest: () {
builder.element('Username', nest: username);
builder.element('Password',
attributes: {
'Type':
'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest'
},
nest: password);
builder.element('Nonce',
attributes: {
'EncodingType':
'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary'
},
nest: nonce);
builder.element('Created', nest: () {
builder.namespace(
'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd');
builder.text(created);
});
});
});
return builder.buildFragment();
}