PHP SOAP, .NET Webservices and Datasets

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Mezzair
Forum Newbie
Posts: 1
Joined: Mon Jul 21, 2008 3:53 am

PHP SOAP, .NET Webservices and Datasets

Post by Mezzair »

I'm currently trying to write a PHP SOAP client to consume a .NET webservice.

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'));
 
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:
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.
This is the code I used to attempt to use this function:

Code: Select all

 
$getFields = $client->GetFields(array('Reference' => 'XXXXX', 'RequestDataSet' => array('Category' => 'Contact')));
 
I get an error saying Object reference not set to an instance of an object.

Any ideas?
Post Reply