[SOLVED] Problem with Session Object

Moderator: crythias

Locked
baldassare
Znuny newbie
Posts: 12
Joined: 19 Mar 2014, 12:09
Znuny Version: OTRS 3.2.10

[SOLVED] Problem with Session Object

Post by baldassare »

Hi, I'm trying to create a session with a SOAP call with the following method:

Code: Select all

	$SessionID = $client->__soapCall("Dispatch",
		array($otrs_soap_username, $otrs_soap_password,
		"SessionObject",     "CreateSessionID",
		"UserLogin",         $user,
		"UserEmail", 	     $email
	));
This method works like a charm in an earlier OTRS 3.2.10 installation but in the new installation OTRS 3.3.9 I receive the following error (in /var/log/messages):

Code: Select all

 OTRS-RPC-29[9494]: [Error][Core::Dispatch][Line:111]: No such Object SessionObject!
I think I miss some modules but I'm not sure or maybe a configuration matter...

Please Help a poor programmer :'(
Last edited by baldassare on 15 Oct 2014, 15:10, edited 1 time in total.
-BG-
  • programmer
    web developer
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Problem with Session Object

Post by jojo »

Yes, the rpc.pl does not have a Session Object (also not in 3.2)

Why are you not using the newer Generic Interface via SOAP?
"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
baldassare
Znuny newbie
Posts: 12
Joined: 19 Mar 2014, 12:09
Znuny Version: OTRS 3.2.10

Re: Problem with Session Object

Post by baldassare »

Hi,
first of all many thanks for your quick response!!!

Can you show me how to make a call using the generic interface?

The calls I make is the following (PHP):

Code: Select all

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

$SessionID = $client->__soapCall("Dispatch",
                array($otrs_soap_username, $otrs_soap_password,
                "SessionObject",     "CreateSessionID",
                "CustomerUserLogin",         $user,
                "UserEmail",         $email
        ));

I see that in the 3.2 I modified the rpc.pl adding:

Code: Select all

use Kernel::System::AuthSession;
use Kernel::System::Auth;

......

 $CommonObject{SessionObject}            = Kernel::System::AuthSession->new(%CommonObject);

and that's why my SOAP call works...but with I never try the Generic Interface can you please show me an example?

Thanks in advance
-BG-
  • programmer
    web developer
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Problem with Session Object

Post by jojo »

"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
baldassare
Znuny newbie
Posts: 12
Joined: 19 Mar 2014, 12:09
Znuny Version: OTRS 3.2.10

Re: Problem with Session Object

Post by baldassare »

Hi,
many thanks for your support I tryed, as you suggest, the generic interface but I need to create a session without passing the password. It is possible to create a web service that use the method in Kernel::System::AuthSession CreateSessionID()?

Thanks in advance
-BG-
  • programmer
    web developer
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Problem with Session Object

Post by jojo »

no
"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
baldassare
Znuny newbie
Posts: 12
Joined: 19 Mar 2014, 12:09
Znuny Version: OTRS 3.2.10

Re: Problem with Session Object

Post by baldassare »

:D :D ok thank you!
-BG-
  • programmer
    web developer
Locked