SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question PHP NuSoap Client and ArrayOfString complexType

    I'm a API newbie and I'm trying to use a nuSOAP call to a function (GetPartDetails) within an WSDL to acquire some data.

    Here's the WSDL: WSDL

    I'm able to properly format the parameters within my call to get all of the needed results back aside from this one
    Code XML:
    <s:element minOccurs="0" maxOccurs="1" name="Parts" type="tns:ArrayOfString"/>
    (the Parts type)

    Here's how I have it formatted in PHP:

    Code PHP:
    $params		   = array (
    				'StockCheckID'	=>	$stockcheckid, 
    				'Parts' 		=>	array('1-179228-2'),
    				'SearchType'	=>	$searchtype,
    				'Region'		=>	$region,
    			  );
     
    $result 	= $client->call('GetPartDetails',$params);

    Do I need to format this parameter differently, or am I missing something else?

  2. #2
    SitePoint Member
    Join Date
    Nov 2005
    Location
    Waco, TX
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Instead of this:
    Code:
    array('1-179228-2'),
    do this:
    Code:
    json_encode(array('1-179228-2'));
    Not sure why it works, but it does. I'm using the StockCheck API too.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •