Get xml representation of the object. @return: The root node. @rtype: L{Element}
(self)
| 159 | self.created = dt |
| 160 | |
| 161 | def xml(self): |
| 162 | """ |
| 163 | Get xml representation of the object. |
| 164 | @return: The root node. |
| 165 | @rtype: L{Element} |
| 166 | """ |
| 167 | root = Element('UsernameToken', ns=wssens) |
| 168 | u = Element('Username', ns=wssens) |
| 169 | u.setText(self.username) |
| 170 | root.append(u) |
| 171 | p = Element('Password', ns=wssens) |
| 172 | p.setText(self.password) |
| 173 | root.append(p) |
| 174 | if self.nonce is not None: |
| 175 | n = Element('Nonce', ns=wssens) |
| 176 | n.setText(self.nonce) |
| 177 | root.append(n) |
| 178 | if self.created is not None: |
| 179 | n = Element('Created', ns=wsuns) |
| 180 | n.setText(str(DateTime(self.created))) |
| 181 | root.append(n) |
| 182 | return root |
| 183 | |
| 184 | |
| 185 | class Timestamp(Token): |