Everyone was tearing their hair out back in 2006 about how to supply attributes to Zimbra SOAP function-name elements when Corey Scott saved the day:
Quote:
Originally Posted by Corey Scott Its a bit of a kludge (then again what about PHP SOAP isnt  ) but I found a solution that works.
Klude 2 (GetApptSummariesRequest): Code: Intead of defining the function name:
$strFunctionName = 'GetApptSummariesRequest';
Sadly you need this instead:
$strFunctionName = 'GetApptSummariesRequest s="' . $intTsStart . '" e="' . $intTsEnd . '"'; You get the output you need. |
I've tried this trick for calling the SearchRequest function, which takes a 'type' attribute, but Corey's solution doesn't work for me.
I have this for my __soapCall():
Code:
$result = $client2->__soapCall(
'SearchRequest type="contact"', // function name
$params, // arguments
null, // options
$soapHeader); // input headers But the XML that's produced dumbly repeats the attributes for the closing tag:
Code:
<ns1:SearchRequest type="contact">
<account>item:all</account>
</ns1:SearchRequest type="contact"> Corey, anyone, how did you get this to work? How can one use PHP SOAP and attach XML attributes to the function-name element?
Using Corey's SoapVar trick to attach attributes to *parameter* elements works fine. But I can't see how to do the same for the actual Zimbra functions which themselves require attributes.
Many thanks for any tips!