I need to create a SOAP request which looks like this:
<soapenv:Body>
<getItemsForProject>
<token>
<user>?</user>
<password>?</password>
</token>
<projectId></projectId>
<start>0</start>
<count>0</count>
</getItemsForProject>
</soapenv:Body>
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
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With