예제 #1
0
파일: WSDL.php 프로젝트: ahumadamob/siris
 public static function connect()
 {
     $soap = new Client(self::URL);
     $soap->setHttpLogin(self::HTTP_USER);
     $soap->setHttpPassword(self::HTTP_PASSWORD);
     return $soap;
 }
예제 #2
0
 public function testObjectResponse()
 {
     $wsdl = $this->baseuri . "/server2.php?wsdl";
     $client = new Client($wsdl);
     $ret = $client->request("test", "test");
     $this->assertTrue($ret instanceof \stdClass);
     $this->assertEquals("test", $ret->foo);
     $this->assertEquals("test", $ret->bar);
 }
예제 #3
0
 /**
  * Manually check the available methods on the backend service, so we see when
  * backend engineers introduce new methods. We need to know this, so that the
  * Zend Framework components can be updated to reflect the changes.
  */
 public function testGetSoapFunctions()
 {
     $expectedResults = array('CreateDocumentResponse CreateDocument(CreateDocument $parameters)', 'DeleteImageResponse DeleteImage(DeleteImage $parameters)', 'DeleteTemplateResponse DeleteTemplate(DeleteTemplate $parameters)', 'DownloadImageResponse DownloadImage(DownloadImage $parameters)', 'DownloadTemplateResponse DownloadTemplate(DownloadTemplate $parameters)', 'GetAllBitmapsResponse GetAllBitmaps(GetAllBitmaps $parameters)', 'GetAllMetafilesResponse GetAllMetafiles(GetAllMetafiles $parameters)', 'GetBitmapsResponse GetBitmaps(GetBitmaps $parameters)', 'GetBlockFieldNamesResponse GetBlockFieldNames(GetBlockFieldNames $parameters)', 'GetBlockNamesResponse GetBlockNames(GetBlockNames $parameters)', 'GetDocumentAccessOptionsResponse GetDocumentAccessOptions(GetDocumentAccessOptions $parameters)', 'GetDocumentFormatsResponse GetDocumentFormats(GetDocumentFormats $parameters)', 'GetFieldNamesResponse GetFieldNames(GetFieldNames $parameters)', 'GetFontNamesResponse GetFontNames(GetFontNames $parameters)', 'GetImageExportFormatsResponse GetImageExportFormats(GetImageExportFormats $parameters)', 'GetImageImportFormatsResponse GetImageImportFormats(GetImageImportFormats $parameters)', 'GetMetafilesResponse GetMetafiles(GetMetafiles $parameters)', 'GetTemplateFormatsResponse GetTemplateFormats(GetTemplateFormats $parameters)', 'ImageExistsResponse ImageExists(ImageExists $parameters)', 'ListImagesResponse ListImages(ListImages $parameters)', 'ListTemplatesResponse ListTemplates(ListTemplates $parameters)', 'LogInResponse LogIn(LogIn $parameters)', 'LogOutResponse LogOut(LogOut $parameters)', 'RetrieveDocumentResponse RetrieveDocument(RetrieveDocument $parameters)', 'SetBlockFieldValuesResponse SetBlockFieldValues(SetBlockFieldValues $parameters)', 'SetDocumentAccessPermissionsResponse SetDocumentAccessPermissions(SetDocumentAccessPermissions $parameters)', 'SetDocumentPasswordResponse SetDocumentPassword(SetDocumentPassword $parameters)', 'SetFieldValuesResponse SetFieldValues(SetFieldValues $parameters)', 'SetIgnoreSubTemplatesResponse SetIgnoreSubTemplates(SetIgnoreSubTemplates $parameters)', 'SetLocalTemplateResponse SetLocalTemplate(SetLocalTemplate $parameters)', 'SetRemoteTemplateResponse SetRemoteTemplate(SetRemoteTemplate $parameters)', 'SetSubTemplateIgnoreListResponse SetSubTemplateIgnoreList(SetSubTemplateIgnoreList $parameters)', 'TemplateExistsResponse TemplateExists(TemplateExists $parameters)', 'UploadImageResponse UploadImage(UploadImage $parameters)', 'UploadTemplateResponse UploadTemplate(UploadTemplate $parameters)');
     $expectedResults = array_unique($expectedResults);
     sort($expectedResults);
     $soapClient = new \SoapClient($this->mailMerge->getWsdl());
     $actualResults = array_unique($soapClient->__getFunctions());
     sort($actualResults);
     $this->assertEquals($expectedResults, $actualResults);
     unset($soapClient);
 }
예제 #4
0
 public function abrircajaAction()
 {
     $soap = new Client(Constants::WSDL_URI_SIRIS . '/soap/siris?wsdl');
     $soap->setHttpLogin("siris");
     $soap->setHttpPassword("cvN_37X");
     $request = new ERequestHeader();
     $request->serieEquipo = "DES99985";
     $request->trxEquipo = "1";
     $request->usuario = "cajero";
     $request->password = "******";
     $res = $soap->openTerminal($request);
     var_dump($res);
     exit;
 }
예제 #5
0
 /**
  * Local client constructor
  *
  * @param SOAPServer $server
  * @param string $wsdl
  * @param array $options
  */
 public function __construct(SOAPServer $server, $wsdl, $options = null)
 {
     $this->server = $server;
     // Use Server specified SOAP version as default
     $this->setSoapVersion($server->getSoapVersion());
     parent::__construct($wsdl, $options);
 }
예제 #6
0
    /**
     * Constructor
     *
     * @param string $wsdl
     * @param array $options
     */
    public function __construct($wsdl = null, $options = null)
    {
        // Use SOAP 1.1 as default
        $this->setSoapVersion(SOAP_1_1);

        parent::__construct($wsdl, $options);
    }
예제 #7
0
 /**
  * Send a message to the Verifone WS.
  *
  * @param RequestInterface $request
  * @return Response
  */
 protected function send(RequestInterface $request)
 {
     $rawResponse = $this->client->ProcessMsg($request->getMessage());
     $response = new Response($rawResponse, $this->client);
     if (isset($this->logger) && $this->logger instanceof LoggerInterface) {
         $this->logger->info($this->maskCreditCardNumber($response->getDebugInfo()));
     }
     return $response;
 }
예제 #8
0
 public function infoRecaudacionTerminalesAction()
 {
     $soap = new Client(Constants::WSDL_URI_TESORERIA . '/soap/siris?wsdl');
     $soap->setHttpLogin("siris");
     $soap->setHttpPassword("cvN_37X");
     $requestHeader = new ERequestHeader();
     $requestHeader->serieEquipo = "DES99985";
     $requestHeader->usuario = "cajero";
     $requestHeader->password = "******";
     $request = new ERequest();
     $request->header = $requestHeader;
     //$result = ExpTerminal::infoRecaudacionTerminales($this->_serviceLocator, $request);
     $result = $soap->infoRecaudacionTerminales($request);
     echo "<pre>";
     var_dump($result);
     echo "</pre>";
     //        echo json_encode($result);
     exit;
 }
예제 #9
0
 public function removeSignature($sessionId, $signatureId)
 {
     try {
         $result = $this->soap->removeSignature($sessionId, $signatureId);
         if ($result['Status'] === 'OK') {
             return $result['SignedDocInfo'];
         } else {
             throw new SigningException($result['Status']);
         }
     } catch (\SoapFault $e) {
         $this->catchSoapError($e);
     }
 }
예제 #10
0
 /**
  * Init Soap client - connect to SOAP service
  *
  * @param  string $endpoint
  * @throws Zend\Service\LiveDocx\Exception
  * @return void
  * @since  LiveDocx 1.2
  */
 protected function _initSoapClient($endpoint)
 {
     $this->_soapClient = new SoapClient();
     $this->_soapClient->setWSDL($endpoint);
 }
예제 #11
0
 /**
  *
  * Class Constructor
  *
  * @param string $environment
  */
 public function __construct($environment = self::ENV_PRODUCTION)
 {
     $context = stream_context_create(array('ssl' => array('ciphers' => 'RC4-SHA')));
     parent::__construct($this->wsdls[$environment], array('soap_version' => SOAP_1_1, 'stream_context' => $context));
 }
예제 #12
0
파일: DotNet.php 프로젝트: Flesh192/magento
 /**
  * Sets options.
  *
  * Allows setting options as an associative array of option => value pairs.
  *
  * @param  array|\Traversable $options Options.
  * @throws \InvalidArgumentException If an unsupported option is passed.
  * @return self
  */
 public function setOptions($options)
 {
     if (isset($options['authentication']) && $options['authentication'] === 'ntlm') {
         $this->useNtlm = true;
         unset($options['authentication']);
     }
     $this->options = $options;
     return parent::setOptions($options);
 }
예제 #13
0
 /**
  * Instantiate SOAP client.
  *
  * @param  string $endpoint
  * @return void
  * @since  LiveDocx 1.2
  */
 protected function initSoapClient($endpoint)
 {
     $this->soapClient = new SoapClient();
     $this->soapClient->setWsdl($endpoint);
 }
예제 #14
0
 public function getusuariosAction()
 {
     /*$query = $this->getEm()->createQueryBuilder();
       $query->select("e")->from('MyClasses\Entities\AclPerfil', 'e')->orderBy('e.perfil', 'ASC');
       return new ViewModel(array('equipes' => $query->getQuery()->getResult(\Doctrine\ORM\AbstractQuery::HYDRATE_ARRAY)));*/
     $cliente = new SoapClient($this->_WSDL_URI . '/wsdl');
     $response = $this->getResponse();
     $response->getHeaders()->addHeaders(array('Content-type' => 'text/xml'));
     $xml = $response->setContent($cliente->getUsuarios("2015/01/01 09:00:00"));
     return $xml;
 }
예제 #15
0
 /**
  * Implements JiraSoapAbstract::call().
  */
 public function call($method, array $args = array())
 {
     return $this->_soapClient->call($method, $args);
 }
예제 #16
0
 /**
  * @expectedException \Zend\Soap\Exception\UnexpectedValueException
  * @dataProvider dataProviderForInitSoapClientObjectException
  */
 public function testInitSoapClientObjectException($wsdl, $options)
 {
     $client = new Client($wsdl, $options);
     $client->getSoapClient();
 }
예제 #17
0
 public function testSetWsdlGetWsdlWithSoapClient()
 {
     $wsdl = 'http://example.com/somewhere.wsdl';
     $mailMerge = new MailMerge();
     $soapClient = new \Zend\Soap\Client();
     $soapClient->setWsdl($wsdl);
     $this->assertInstanceOf('Zend\\Service\\LiveDocx\\MailMerge', $mailMerge->setSoapClient($soapClient));
     $this->assertEquals($wsdl, $mailMerge->getWsdl());
     unset($mailMerge);
 }
예제 #18
0
 /**
  * Get the last request headers.
  *
  * @return string
  */
 public function getLastRequestHeaders()
 {
     return $this->client->getLastRequestHeaders();
 }
예제 #19
0
    /**
     * Manually check the available methods on the backend service, so we see when
     * backend engineers introduce new methods. We need to know this, so that the
     * Zend Framework components can be updated to reflect the changes.
     */
    public function testGetSoapFunctions()
    {
        $expectedResults = array(

            /*
                Legend:
                    1 = implemented
                    0 = not implemented

                Date: June 10, 2011
            */

            /* +---------+---------+---------------------------------------------------------------------------------------------------------------------------+ */
            /* | Library |  Tests  | Method name on backend server                                                                                             | */
            /* +---------+---------+---------------------------------------------------------------------------------------------------------------------------+ */
            /* |    1    |    1    | */   'CreateDocumentResponse CreateDocument(CreateDocument $parameters)',                                              /* | */
            /* |    1    |    1    | */   'DeleteImageResponse DeleteImage(DeleteImage $parameters)',                                                       /* | */
            /* |    1    |    1    | */   'DeleteTemplateResponse DeleteTemplate(DeleteTemplate $parameters)',                                              /* | */
            /* |    1    |    1    | */   'DownloadImageResponse DownloadImage(DownloadImage $parameters)',                                                 /* | */
            /* |    1    |    1    | */   'DownloadTemplateResponse DownloadTemplate(DownloadTemplate $parameters)',                                        /* | */
            /* |    1    |    1    | */   'GetAllBitmapsResponse GetAllBitmaps(GetAllBitmaps $parameters)',                                                 /* | */
            /* |    1    |    1    | */   'GetAllMetafilesResponse GetAllMetafiles(GetAllMetafiles $parameters)',                                           /* | */
            /* |    1    |    1    | */   'GetBitmapsResponse GetBitmaps(GetBitmaps $parameters)',                                                          /* | */
            /* |    1    |    1    | */   'GetBlockFieldNamesResponse GetBlockFieldNames(GetBlockFieldNames $parameters)',                                  /* | */
            /* |    1    |    1    | */   'GetBlockNamesResponse GetBlockNames(GetBlockNames $parameters)',                                                 /* | */
            /* |    1    |    1    | */   'GetDocumentAccessOptionsResponse GetDocumentAccessOptions(GetDocumentAccessOptions $parameters)',                /* | */
            /* |    1    |    1    | */   'GetDocumentFormatsResponse GetDocumentFormats(GetDocumentFormats $parameters)',                                  /* | */
            /* |    1    |    1    | */   'GetFieldNamesResponse GetFieldNames(GetFieldNames $parameters)',                                                 /* | */
            /* |    1    |    1    | */   'GetFontNamesResponse GetFontNames(GetFontNames $parameters)',                                                    /* | */
            /* |    1    |    1    | */   'GetImageExportFormatsResponse GetImageExportFormats(GetImageExportFormats $parameters)',                         /* | */
            /* |    1    |    1    | */   'GetImageImportFormatsResponse GetImageImportFormats(GetImageImportFormats $parameters)',                         /* | */
            /* |    1    |    1    | */   'GetMetafilesResponse GetMetafiles(GetMetafiles $parameters)',                                                    /* | */
            /* |    1    |    1    | */   'GetTemplateFormatsResponse GetTemplateFormats(GetTemplateFormats $parameters)',                                  /* | */
            /* |    1    |    1    | */   'ImageExistsResponse ImageExists(ImageExists $parameters)',                                                       /* | */
            /* |    1    |    1    | */   'ListImagesResponse ListImages(ListImages $parameters)',                                                          /* | */
            /* |    1    |    1    | */   'ListTemplatesResponse ListTemplates(ListTemplates $parameters)',                                                 /* | */
            /* |    1    |    1    | */   'LogInResponse LogIn(LogIn $parameters)',                                                                         /* | */
            /* |    1    |    1    | */   'LogOutResponse LogOut(LogOut $parameters)',                                                                      /* | */
            /* |    1    |    1    | */   'RetrieveDocumentResponse RetrieveDocument(RetrieveDocument $parameters)',                                        /* | */
            /* |    1    |    1    | */   'SetBlockFieldValuesResponse SetBlockFieldValues(SetBlockFieldValues $parameters)',                               /* | */
            /* |    1    |    1    | */   'SetDocumentAccessPermissionsResponse SetDocumentAccessPermissions(SetDocumentAccessPermissions $parameters)',    /* | */
            /* |    1    |    1    | */   'SetDocumentPasswordResponse SetDocumentPassword(SetDocumentPassword $parameters)',                               /* | */
            /* |    1    |    1    | */   'SetFieldValuesResponse SetFieldValues(SetFieldValues $parameters)',                                              /* | */
            /* |    1    |    1    | */   'SetIgnoreSubTemplatesResponse SetIgnoreSubTemplates(SetIgnoreSubTemplates $parameters)',                         /* | */
            /* |    1    |    1    | */   'SetLocalTemplateResponse SetLocalTemplate(SetLocalTemplate $parameters)',                                        /* | */
            /* |    1    |    1    | */   'SetRemoteTemplateResponse SetRemoteTemplate(SetRemoteTemplate $parameters)',                                     /* | */
            /* |    1    |    1    | */   'SetSubTemplateIgnoreListResponse SetSubTemplateIgnoreList(SetSubTemplateIgnoreList $parameters)',                /* | */
            /* |    1    |    1    | */   'TemplateExistsResponse TemplateExists(TemplateExists $parameters)',                                              /* | */
            /* |    1    |    1    | */   'UploadImageResponse UploadImage(UploadImage $parameters)',                                                       /* | */
            /* |    1    |    1    | */   'UploadTemplateResponse UploadTemplate(UploadTemplate $parameters)',                                              /* | */
            /* +---------+---------+---------------------------------------------------------------------------------------------------------------------------+ */

        );

        $expectedResults = array_unique($expectedResults);

        sort($expectedResults);

        $soapClient = new \SoapClient($this->mailMerge->getWsdl());

        $actualResults = array_unique($soapClient->__getFunctions());

        sort($actualResults);

        foreach ($actualResults as $key => $value) {
            $this->assertEquals($expectedResults[$key], $actualResults[$key]);
        }

        unset($soapClient);
    }
예제 #20
0
    public function testSetSoapClient()
    {
        $clientMock = $this->getMock('SoapClient', array('__setCookie'), array(null, array('uri' => 'http://www.zend.com', 'location' => 'http://www.zend.com')));

        $soap = new Client();
        $soap->setSoapClient($clientMock);

        $this->assertSame($clientMock, $soap->getSoapClient());
    }
예제 #21
0
 public function formSOAPClient()
 {
     ini_set("soap.wsdl_cache_enabled", "0");
     // Acessando o webservice definido no método SOAPServer (acima)
     $client = new Client();
     $client->setSoapVersion(SOAP_1_2);
     try {
         $uri = Manager::getAppURL('exemplos', 'zend/soapServer?wsdl', true);
         $client->setWSDL($uri);
         $this->data->response1 = $client->method1("Teste");
         $this->data->response2 = $client->method2(10, 'Framework Maestro + Zend');
     } catch (Exception $e) {
         mdump($e->getMessage());
         mdump($e->getTraceAsString());
     }
     // Acessando um webservice externo como exemplo
     $clientCountry = new Client();
     $clientCountry->setWSDL('http://www.webservicex.net/country.asmx?WSDL');
     $countries = simplexml_load_string($clientCountry->GetCountries()->GetCountriesResult);
     $this->data->country->name = $countries->Table[29]->Name;
     $Country->CountryCode = "BR";
     $code = simplexml_load_string($clientCountry->GetCountryByCountryCode($Country)->GetCountryByCountryCodeResult);
     $this->data->country->code = 'Code: ' . $code->Table[0]->countrycode;
     $this->data->country->country = 'Country: ' . $code->Table[0]->name;
     $this->render();
 }