public static function createWsSecuritySoapHeader(
        $username,
        $password,
        $passwordDigest = false,
        $addCreated = 0,
        $addExpires = 0,
        $returnSoapHeader = true,
        $mustunderstand = false,
        $actor = null,
        $usernameId = null,
        $addNonce = true,
        $envelopeNamespace = Security::ENV_NAMESPACE
    ) {
        $self = new WsSecurity($username, $password, $passwordDigest, $addCreated, $addExpires, $mustunderstand, $actor, $usernameId, $addNonce, $envelopeNamespace);
        if ($returnSoapHeader) {
            if (!empty($actor)) {
                return new \SoapHeader(Element::NS_WSSE, 'Security', new \SoapVar($self->getSecurity()->toSend(), XSD_ANYXML), $mustunderstand, $actor);
            }

            return new \SoapHeader(Element::NS_WSSE, 'Security', new \SoapVar($self->getSecurity()->toSend(), XSD_ANYXML), $mustunderstand);
        }

        return new \SoapVar($self->getSecurity()->toSend(), XSD_ANYXML);
    }
public static function createWsSecuritySoapHeader(
        $username,
        $password,
        $passwordDigest = false,
        $addCreated = 0,
        $addExpires = 0,
        $returnSoapHeader = true,
        $mustunderstand = false,
        $actor = null,
        $usernameId = null,
        $addNonce = true,
        $envelopeNamespace = Security::ENV_NAMESPACE
    ) {
        $self = new WsSecurity($username, $password, $passwordDigest, $addCreated, $addExpires, $mustunderstand, $actor, $usernameId, $addNonce, $envelopeNamespace);
        if ($returnSoapHeader) {
            if (!empty($actor)) {
                return new \SoapHeader(Element::NS_WSSE, 'Security', new \SoapVar($self->getSecurity()->toSend(), XSD_ANYXML), $mustunderstand, $actor);
            }

            return new \SoapHeader(Element::NS_WSSE, 'Security', new \SoapVar($self->getSecurity()->toSend(), XSD_ANYXML), $mustunderstand);
        }

        return new \SoapVar($self->getSecurity()->toSend(), XSD_ANYXML);
    }
public static function createWsSecuritySoapHeader ( $ username , $ password , $ passwordDigest = false , $ addCreated = 0 , $ addExpires = 0 , $ returnSoapHeader = true , $ mustunderstand = false , $ actor = null , $ usernameId = null , $ addNonce = true , $ envelopeNamespace = Security :: ENV_NAMESPACE ) { $ self = new WsSecurity ( $ username , $ password , $ passwordDigest , $ addCreated , $ addExpires , $ mustunderstand , $ actor , $ usernameId , $ addNonce , $ envelopeNamespace ) ; if ( $ returnSoapHeader ) { if ( ! empty ( $ actor ) ) { return new \ SoapHeader ( Element :: NS_WSSE , 'Security' , new \ SoapVar ( $ self -> getSecurity ( ) -> toSend ( ) , XSD_ANYXML ) , $ mustunderstand , $ actor ) ; } return new \ SoapHeader ( Element :: NS_WSSE , 'Security' , new \ SoapVar ( $ self -> getSecurity ( ) -> toSend ( ) , XSD_ANYXML ) , $ mustunderstand ) ; } return new \ SoapVar ( $ self -> getSecurity ( ) -> toSend ( ) , XSD_ANYXML ) ; }
Create the SoapHeader object to send as SoapHeader in the SOAP request.

@param string $username
@param string $password
@param bool   $passwordDigest
@param int    $addCreated
@param int    $addExpires
@param bool   $returnSoapHeader
@param bool   $mustunderstand
@param string $actor
@param string $usernameId
@param bool   $addNonce
@param string $envelopeNamespace

@return \SoapHeader|\SoapVar
Create the SoapHeader object to send as SoapHeader in the SOAP request .