Hi I would like to have this header of this kind of nature. <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:rep="http://www.alfresco.org/ws/service/repository/1.0" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss- wssecurity-secext-1.0.xsd"> <soap:Header> <wsse:Security> <wsse:UsernameToken> <wsse:Username>admin</wsse:Username> <wsse:Password Type="wsse:PasswordText">admin</wsse:Password> <wsse:Nonce/> </wsse:UsernameToken> </wsse:Security> </soap:Header> <soap:Body> <rep:getStores/> </soap:Body> </soap:Envelope> But i can't work out how to create the header, I am trying (and failing) with this: $soap->method(SOAP::Header->name('Security\UsernameToken')); $soap->method(SOAP::Header->attr('Username'=>'admin')); $soap->method(SOAP::Header->attr('Password'=>$session->{ticket})); as Element 'Security\UsernameToken' can't be allowed in valid XML message. So I am unsure of how to create this nested structure in the header? Can anyone help? Please