public function anulaFactura($registro, $motivo)
 {
     $sc = new WSSESoapClient($this->_wsdl, array('trace' => TRUE, 'cache_wsdl' => WSDL_CACHE_NONE));
     try {
         $sc->setCert($this->_cert);
         $sc->setPass($this->_password);
         $out = $sc->anularFactura($registro, $motivo);
         file_put_contents('request.xml', $sc->getRawrequests());
         file_put_contents('requestSigner.xml', $sc->getRawrequestsigned());
         file_put_contents('response.xml', $sc->getRawresponse());
     } catch (SoapFault $fault) {
         print_r($fault->getMessage());
     }
 }
 public function ConsultarUnidadesPorAdministracion($codigo_dir)
 {
     $sc = new WSSESoapClient($this->_wsdl, array('trace' => TRUE, 'cache_wsdl' => WSDL_CACHE_NONE));
     try {
         $sc->setCert($this->_cert);
         $sc->setPass($this->_password);
         $out = $sc->ConsultarUnidadesPorAdministracion($codigo_dir);
         file_put_contents('request.xml', $sc->getRawrequests());
         file_put_contents('requestSigner.xml', $sc->getRawrequestsigned());
         file_put_contents('response.xml', $sc->getRawresponse());
     } catch (SoapFault $fault) {
         print_r($fault->getMessage());
     }
 }
 public function enviarFactura($correo, $ficheroFactura, $ficheros_anexos)
 {
     $sc = new WSSESoapClient($this->_wsdl, array('trace' => TRUE, 'cache_wsdl' => WSDL_CACHE_NONE));
     try {
         $sc->setCert($this->_cert);
         $sc->setPass($this->_password);
         $facturaSSPP = new \stdClass();
         $facturaSSPP->correo = $correo;
         $facturaSSPP->fichero_factura = new \stdClass();
         $facturaSSPP->fichero_factura->factura = base64_encode($ficheroFactura['factura']);
         $facturaSSPP->fichero_factura->nombre = $ficheroFactura['nombre'];
         $facturaSSPP->fichero_factura->mime = $ficheroFactura['mime'];
         $facturaSSPP->ficheros_anexos = array();
         $out = $sc->enviarFactura($facturaSSPP);
         file_put_contents('request.xml', $sc->getRawrequests());
         file_put_contents('requestSigner.xml', $sc->getRawrequestsigned());
         file_put_contents('response.xml', $sc->getRawresponse());
     } catch (SoapFault $fault) {
         print_r($fault->getMessage());
     }
 }