Guest User

ws_ticketget.php

a guest
Jul 7th, 2016
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. <?php
  2.  
  3. //First you need to create this webservice: http://pastebin.com/fSWiZ0Ay
  4.  
  5. $url = "https://myotrs.example.com/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnector/";
  6. $namespace = "generic";
  7. $username = "myotrsUser";
  8. $password = "myotrsSecret";
  9.  
  10. $client = new SoapClient(
  11.         null,
  12.         array(
  13.             'location' => $url,
  14.             'uri' => $namespace,
  15.             'trace' => 1,
  16.             'style' => SOAP_RPC,
  17.             'use' => SOAP_ENCODED,
  18.         )
  19.     );
  20.  
  21. echo "Connection:\n";
  22. var_dump($client);
  23.  
  24.  
  25. //OTRS web service parameters described here:
  26. //https://otrs.github.io/doc/manual/admin/3.3/en/html/genericinterface.html#genericinterface-bundled-connectors
  27. $TicketDetails = $client->__soapCall("TicketGet",
  28.         array(
  29.             new SoapParam($username, "UserLogin"),
  30.             new SoapParam($password, "Password"),
  31.             new SoapParam(12345678, "TicketID"),
  32.             new SoapParam(1, "DynamicFields"),
  33.             new SoapParam(1, "AllArticles"),
  34.         )
  35.     );
  36.  
  37. echo "\n\nOutput:\n";
  38. var_dump($TicketDetails);
Add Comment
Please, Sign In to add comment