PHP SOAP, .NET Webservices and Datasets
Posted: Mon Jul 21, 2008 4:01 am
I'm currently trying to write a PHP SOAP client to consume a .NET webservice.
Some code:
Now this works fine and it returns a reference number I need to use in conjunction when calling other functions.
The stumbling block is where I have to pass in a parameter of type dataset. I've been looking at this problem for a week and still no luck.
This is the API documentation on this particular function:
I get an error saying Object reference not set to an instance of an object.
Any ideas?
Some code:
Code: Select all
$client = new SoapClient("http://www.anywheresg.co.uk/AnywhereDirectService/AnywhereDirectService.asmx?WSDL", array('trace' => 1
));
## Call the login function
$loginResult = $client->Login(array('Account' => 'XXXXX', 'Name' => 'XXXXX', 'Password' => 'XXXXX'));
The stumbling block is where I have to pass in a parameter of type dataset. I've been looking at this problem for a week and still no luck.
This is the API documentation on this particular function:
This is the code I used to attempt to use this function:GetFields Method
This method is used to get all available fields for a specified category. The GetCategories Method can be used to determine all the available entity categories. If no category is specified then this method will supply all fields for all categories.
Arguments
1. string Reference
2. DataSet RequestDataSet
Reference should contain the Reference returned by the Login Method and is used to identify the user of the Web Service.
RequestDataSet should contain a Parameters DataTable with zero or more rows and the following columns:
* Category
Name of Category
If no rows are specified then fields for all categries will be returned.
Code: Select all
$getFields = $client->GetFields(array('Reference' => 'XXXXX', 'RequestDataSet' => array('Category' => 'Contact')));
Any ideas?