SOAP and __PHP_Incomplete_Class Object

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Sonya*
Forum Newbie
Posts: 2
Joined: Sat Oct 20, 2007 6:04 pm

SOAP and __PHP_Incomplete_Class Object

Post by Sonya* »

Hello,

I am trying to integrate login from a third part application into my site via SOAP. I've written a login function which logs me in if executed direct in browser. Afterwards I tryed to place it into soap function. There are some includes from the 3rd part application. With SOAP all included classes are incomplete:

__PHP_Incomplete_Class Object

I've read that it happens if session is started before classes are declared. But it cannot be a reason for fault in my case. I include all classes first of all and afterwards the session is started. I checked if session is being started before classes are included with echo session_id() and there was no printout. After session is started I can see the session_id.

My SOAP function is very simple:

Code: Select all

function login($userdata) {

require_once('firstclass.php');
require_once('secondclass.php');
require_once('thirdclass.php');

do login .....
...... ;

return;
}
The code placed in function works well if executed in browser. What can be the reason for the error?

Thank you,
Sonya
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Can you post the exact error message your are receiving.
Sonya*
Forum Newbie
Posts: 2
Joined: Sat Oct 20, 2007 6:04 pm

Post by Sonya* »

Everah wrote:Can you post the exact error message your are receiving.
Thank you for trying to help me. I did not give up :) and I figure out the issue now, but I am still not able to solve it.

My issue: cookie and session generated by soap server are not present in my client after I get response. I can always see that line:

Code: Select all

Set-Cookie: MyCookieName=value; path=/
in the ResponseHeader, but no cookies are set in browser window where client is executed.

The problem I have described above is due to the same issue. Server generates session with some objects in it. It's ok within server code but the session is not set in the client. I return a complete object as result generated by server and this object becomes __PHP_Incomplete_Class Object for the client.

If I copy the complete code from the soap function and paste it in a new php file and execute it in browser then I have no problems (cookies are set , session is generated and available and objects are complete).

My Environment:
Windows XP (only for development)
Apache 1.3
PHP 5.2.4

Is it possible to set sessions and cookies to the client through code executed within server? If not, is there any other solution for this?
Thank you.
Post Reply