Set Pending Time through SOAP

English! place to talk about development, programming and coding
Post Reply
Andorim
Znuny newbie
Posts: 3
Joined: 13 Jan 2015, 10:22
Znuny Version: 4.0.3

Set Pending Time through SOAP

Post by Andorim »

Hi all,

i would like to Set the Pending Time on a ticket with PHP.
I tried this:

Code: Select all

$ticketPendingTime = $client->_soapCall("Dispatch",array($SOAP_user, $SOAP_pass, "TicketObject", "TicketPendingTimeSet",
            "Diff", ( 1 * 24 * 60 ), 
            "TicketID", $ticketid,
            "UserID", $bearbeiter,
            ));
But it throws a SOAP Exception:

Code: Select all

 Failed to access class (Core): Can't locate Core.pm in @INC (you may need to install the Core module) (@INC contains: /usr/Custom /usr/Kernel/cpan-lib /usr /opt/otrs_is/Custom /opt/otrs_is/Kernel/cpan-lib /opt/otrs_is/ /etc/perl /usr/local/lib/perl/5.18..2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl . /etc/apache2) at (eval 2124) line 2
But this code run in the same php file:

Code: Select all

$ticketstate = $client->__soapCall("Dispatch", array($SOAP_user, $SOAP_pass, "TicketObject", "TicketStateSet",
            "StateID", $status,
            "TicketID", $ticketid,
            "UserID", $bearbeiter
        ));
We use OTRS 4.0.3 on a Ubuntu 12.04 machine and Apache as Webserver.

I hope you can help me :)
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Set Pending Time through SOAP

Post by jojo »

don't use the rpc.pl webservice. Try the Generic Interface
"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
Andorim
Znuny newbie
Posts: 3
Joined: 13 Jan 2015, 10:22
Znuny Version: 4.0.3

Re: Set Pending Time through SOAP

Post by Andorim »

I tried to find out, how it works with the Generic Interface, But i can't find a solution that i understand.

for example: I tried this:

Code: Select all

$client = new SoapClient(null, array(
    'location' => "http://" . $otrs_server_ip.":".$otrs_port."/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnector/",
    'uri' => "http://www.otrs.org/TicketConnector/",
    'trace' => 1,
    'style' => SOAP_RPC,
    'use' => SOAP_ENCODED));

try {
    $ticketid = $client->__soapCall('TicketIDLookup', array(
    new SoapParam($SOAP_user, "UserLogin"),
    new SoapParam($SOAP_pass, "Password"),
    new SoapParam(array(
						'TicketNumber', $ticketnumber,
						)
				 ,"Ticket"),));
I get following Error: Error Fetching http headers

Can you tell me how it works, please?
Andorim
Znuny newbie
Posts: 3
Joined: 13 Jan 2015, 10:22
Znuny Version: 4.0.3

Re: Set Pending Time through SOAP

Post by Andorim »

I have now made it that the connection can be made to the Generic Interface.

But unfortunately I can not find the function with which I can reference to a ticket number, find out TicketID, or I put the PendingTime.

In the old interface, there were the functions "TicketIDLookup" and "TicketPendingTimeSet" where "TicketPendingTimeSet" throws an error described in the first post.
Post Reply