Take the 2-minute tour ×

I need to create a SOAP request which looks like this:


The operation expects this:

[209] => struct getItemsForProject {
 wsAuth token;
 long projectId;
 int start;
 int count;

I have tried the following but keep hitting PHP Fatal error: SOAP-ERROR: Encoding: object has no 'start' property

I know that the token object can be created like this, as I have used it for another operation:

$auth->token = new \stdClass;
$auth->token->user = $username;
$auth->token->password = $password;

However, doing something similar for the 'start' parameter is failing with the fatal error message. Here's part of the code:

$opts = new \StdClass;
$opts->projectId = 123;
$opts->start = 0;
$opts->count = 0;

$resp = $soap->getItemsForProject($auth, $opts);       

echo $soap->__getLastRequest() ."\n";

I am unable to print the full soap request using $soap->__getLastRequest() because it is returning the fatal error before issuing the request. Similarly, I cannot use var_dump() on the $resp because it dies before executing that line. How can I tell what is actually being sent?! If I know that, then I can debug this more easily.

Thanks, ns

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Try with something like that :

$myClass->token = new \stdClass;
$myClass->token->user = $username;
$myClass->token->password = $password;

$myClass->projectId = 123;
$myClass->start = 0;
$myClass->count = 0;

$resp = $soap->getItemsForProject($myClass);       
share|improve this answer
Thanks ssx!! Don't know why I didn't try that originally... –  nonshatter Aug 8 '12 at 15:00
Glad I could help ! –  Anas Aug 8 '12 at 15:06
add comment

Your Answer


