ITSMChange via SOAP abfragen

English! place to talk about development, programming and coding
Post Reply
msdc
Znuny newbie
Posts: 3
Joined: 30 Jul 2010, 15:25
Znuny Version: 2.4.7

ITSMChange via SOAP abfragen

Post by msdc »

Hallo,

ich versuche via SOAP / PHP einen Change abzufragen. Mit Tickets geht es, aber nicht mit einen Change. Ich bin mir auch nicht sicher wie z.B. das Change Objekt heißt und wo ich dazu eine Doku finde.

Meine Versuche:

Code: Select all

$client = new SoapClient(null, array('location'  => $url,
                                     'uri'       => "Core",
                                     'trace'     => 1,
                                     'login'     => $user,
                                     'password'  => $pass,
                                     'style'     => SOAP_RPC,
                                     'use'       => SOAP_ENCODED));

$result = $client->__soapCall("Dispatch", array($user, $pass, "ITSMChangeObject", "ITSMChangeGet", "ITSMChangeID", 27));
oder
$result = $client->__soapCall("Dispatch", array($user, $pass, "ChangeObject", "ChangeGet", "ChangeID", 27));
liefern immer nur "No such Object ITSMChangeObject!" zurück.

Vorab Danke,
Marc
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: ITSMChange via SOAP abfragen

Post by jojo »

Hallo,

Du müsstest erstmal die rpc.pl patchen, damit sie überhaupt das entsprechende Objekt kennt. Doku erhälst Du via perldoc im CLI
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
msdc
Znuny newbie
Posts: 3
Joined: 30 Jul 2010, 15:25
Znuny Version: 2.4.7

Re: ITSMChange via SOAP abfragen

Post by msdc »

Hallo,

ich habe nun die rpc.pl um die Zeilen

Code: Select all

...
use Kernel::System::ITSMChange;
...
$CommonObject{ChangeObject}       = Kernel::System::ITSMChange->new(%CommonObject);
...
erweitert. Damit ist der Fehler weg, aber bei der Abfrage

Code: Select all

$result = $client->__soapCall("Dispatch", array($user, $pass, "ChangeObject", "ChangeGet", "ChangeID", 1));
bekommen ich immer nur "null" zurück, obwohl eine Change mit der ID existiert?

Marc
msdc
Znuny newbie
Posts: 3
Joined: 30 Jul 2010, 15:25
Znuny Version: 2.4.7

Re: ITSMChange via SOAP abfragen

Post by msdc »

Habe es selber gefunden:

Code: Select all

 
  $result = $client->__soapCall("Dispatch", array($user, $pass, "ChangeObject", "ChangeGet", "ChangeID", 1, "UserID", $user));
Post Reply