Forum Moderators: open

Message Too Old, No Replies

NuSoap, Parameters problem

         

phpmattk

10:38 pm on Sep 7, 2005 (gmt 0)

10+ Year Member



hello,

Im trying to consume a ticket brokers webservice with nusoap and php, and im having a bit of trouble. I can call up certian functions, particularly the ones that only request one parameter. However, when the function im calling requests more than one parameter, i cant get the service to return any data i just get this generic message in response:

Server was unable to process request. --> Object reference not set to an instance of an object.

I figure im doing somthing wrong defining the parameters. Here is the code, and the wsdl for the function as well:

<?

// include class
include("nusoap.php"); //commented line 2143

// create a instance of the SOAP client object
$soapclient = new
soapclient("http://tnzzzzzz-test.tzzzzzftware.net/zzzzz/zzzzz?WSDL",
true);

// $soapclient->debug_flag = 1;

// create a proxy so that WSDL methods can be accessed directly
$proxy = $soapclient->getProxy();

// set up an array containing input parameters to be
// passed to the remote procedure
$params = array(
'websiteConfigIDIN' => 5555
,'parentCatIDIN'=> 2
);

echo "<pre>";
print_r($params);
echo "</pre>";

// invoke the method
$result = $proxy->GetEvents($params);

// print the results of the search
echo "<pre>";
print_r($result);
echo "</pre>";

?>

Here is the WSDL, im trying to pass just the 2 required paremeters for now.


<s:element name="GetEvents">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="websiteConfigIDIN" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="numberOfRecordsIN" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="eventIDIN" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="cityZipIN" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="eventNameIN" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="eventDateIN" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="beginDateIN" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="endDateIN" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="lowPriceIN" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="highPriceIN" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="venueIDIN" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="stateProvDescIN" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="stateProvIDIN" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="parentCatIDIN" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="childCatIDIN" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="grandChildCatIDIN" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="performerIDIN" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="sortColumnIN" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="sortDescendingIN" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="GetEventsResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetEventsResult" type="tns:ArrayOfEvent" />
</s:sequence>
</s:complexType>
</s:element>
- <s:complexType name="ArrayOfEvent">
- <s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="Event" type="tns:Event" />
</s:sequence>
</s:complexType>
- <s:complexType name="Event">
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="EventName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="DisplayDate" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Venue" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="City" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="State" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ParentCategoryID" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Map" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="EventID" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="VenueID" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="StateID" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="EventDate" type="s:dateTime" />
<s:element minOccurs="0" maxOccurs="1" name="VenueConfigurationID" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="Clicks" type="s:int" />
</s:sequence>
</s:complexType>

phpmattk

6:26 am on Sep 8, 2005 (gmt 0)

10+ Year Member



I figured it out. I needed to include all parameters in the array, even if i was not using them.

$params = array (
"websiteConfigIDIN"=>"5555",
"numberOfRecordsIN"=>"",
"eventIDIN"=>"",
"cityZipIN"=>"",
"eventNameIN"=>"",
"eventDateIN"=>"",
"beginDateIN"=>"",
"endDateIN"=>"",
"lowPriceIN"=>"",
"highPriceIN"=>"",
"venueIDIN"=>"",
"stateProvDescIN"=>"",
"stateProvIDIN"=>"",
"parentCatIDIN"=>"2",
"childCatIDIN"=>"22",
"grandChildCatIDIN"=>"",
"performerIDIN"=>"",
"sortColumnIN"=>"",
"sortDescendingIN"=>"");