Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Server {
- public function getUsers( ) {
- $retorno = file_get_contents('php://input');
- return $retorno;
- }
- $oSoapServer = new SoapServer(NULL, array( 'uri' => 'http://local.com.br/soap/' ) );
- $oSoapServer->setClass("Server");
- $oSoapServer->handle();
- ini_set("soap.wsdl_cache_enabled", "0");
- $options = array(
- 'location' => 'http://local.com.br/soap/server.php?wsdl',
- 'uri' => 'http://local.com.br/soap/'
- );
- $oSoapClient = new SoapClient(NULL,$options);
- $Auth = new stdClass();
- $Auth->SystemId = "DATA";
- $Auth->UserName = "USERNAME";
- $Auth->Password = "PASSWORD";
- $auth_object = new SoapVar($Auth, SOAP_ENC_OBJECT);
- $header = new SoapHeader('http://local.com.br/soap/', 'Authorization', $auth_object);
- $oSoapClient->__setSoapHeaders($header);
- echo "<pre>";
- /* Executing a fuction, for example isAlive method */
- $response = $oSoapClient->__soapCall("getUsers", array($auth_object));
- // $xml = simplexml_load_string($response);
- var_dump($response);
- echo "</pre>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement