Advertisement
joris

tiketapi

Sep 5th, 2019
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.09 KB | None | 0 0
  1. public function tiketapi()
  2.     {
  3.         $client = new nusoap_client('http://10.35.65.11:8080/arsys/WSDL/public/55.25.70.1/BRI:INC:GetInfoFromIPAddress', 'wsdl');
  4.         $header = "<AuthenticationInfo><userName>int_nominal</userName><password>123456</password></AuthenticationInfo>";
  5.         $client->setHeaders($header);
  6.         $err = $client->getError();
  7.         if ($err) {
  8.             echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
  9.         }
  10.         $result = $client->call("Get_ticket_info");
  11.         if(!empty($result)) {
  12.             $jsonOutput = json_encode([
  13.                 'incident_number' => $result['IncidentNumber'],
  14.                 'description' => $result['Description'],
  15.                 'notes' => $result['Notes'],
  16.                 'status' => $result['Status'],
  17.                 'code' => 200
  18.             ]);
  19.         } else {
  20.             $jsonOutput = json_encode([
  21.                 'incident_number' => '-',
  22.                 'description' => '-',
  23.                 'notes' => '-',
  24.                 'status' => '-',
  25.                 'code' => 404
  26.             ]);
  27.         }
  28.         echo $jsonOutput;
  29.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement