New to SOAP and PHP, hopefully simple question :)

[email protected] (Gale Allen Jr)
Newsgroups php.soap
Message-ID <[email protected]>
Hello,
   Here is my code.

<?php
$client = new SoapClient("https://gsx.apple.com/gsxws.wsdl");

Here is the Authenticate function that was returned on the __gettypes 
() call.:
SessionInfo Authenticate(string $userName, string $password, string  
$accountNo, string $language, string $timeZone)

$test = $client->Authenticate("[email protected]", "pass", "24521",  
"EN", "PST"); // This works
var_dump($test);
// code returned from var_dump = object(stdClass)#2 (2)  
{ ["instanceID"]=> string(1) "6" ["sessionID"]=> string(22)  
"z1AcbmuiCBF5FGKsekgTRM" }
$temp = array('', '', '661-3350', '', ''); // part array
$functions = $client->__getfunctions();
foreach ($functions as $func) {
   echo $func . '\n';
   }
print "<br>";

Here is the function I'm trying to use that was returned from the  
__getfunctions() call.:
ArrayOf_tns1_Part PartsLookup(SessionInfo $sessionInfo,  
PartLookupInfo $partLookupInfo)\n

$functions = $client->__gettypes();
foreach ($functions as $func) {
   echo $func . '\n';
   }

Here is the type I'm trying to use that was returned from __gettypes 
() call.:
PartLookupInfo { string description; string eeeCode; string  
partNumber; string productName; string serialNumber; }



Here is that code:

$temp = array('', '', '661-3350', '', ''); // array setup for type  
PartLookupInfo
$test = $client->PartsLookup('PartLookupinfo', $temp);

I get the following error:
Fatal error: Uncaught SoapFault exception: [ns1:at least one  
parameter required for parts lookup] at least one parameter required  
for parts lookup : in /Library/WebServer/Documents/shop/soap.php:10  
Stack trace: #0 [internal function]: SoapClient->__call 
('PartsLookup', Array) #1 /Library/WebServer/Documents/shop/soap.php 
(10): SoapClient->PartsLookup('PartLookupinfo', Array) #2 {main}  
thrown in /Library/WebServer/Documents/shop/soap.php on line 10

If I try this code:

$temp = array('', '', '661-3350', '', ''); // array setup for type  
PartLookupInfo
$test2 = $client->__call('PartsLookup', $temp);
var_dump($test2);

I get the following error:

Fatal error: Uncaught SoapFault exception: [ns1:Server.userException]  
GSX Server has encountered an exception at : 2007-08-15 18:24:21 Etc/ 
GMT, error reference tag is 6b8OYZ5NaAUzUeYZS4Gge0. If the issue  
persists, please report this to Apple. Details on how to report can  
be found at http://www.info.apple.com/gsx/gsxhelpform. in /Library/ 
WebServer/Documents/shop/soap.php:27 Stack trace: #0 /Library/ 
WebServer/Documents/shop/soap.php(27): SoapClient->__call 
('PartsLookup', Array) #1 {main} thrown in /Library/WebServer/ 
Documents/shop/soap.php on line 27


Again, I'm new to soap, so not sure why these errors are being  
generated. Any help to get me kick started would be greatly  
appreciated. :)

Aloha from Gale, Tammy and Jackie :)
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.