Well, it looks like I have hit a problem before even reaching the problem I originally mentioned.
$client = new SoapClient($this->sushiURL);
Throws a fatal error due to a schema not being found. I looked into this a bit online and heard a lot of complaints about the ability of the native PHP SoapClient class to handle complex xml schemas. So, I tried the NuSOAP library and at least was able to initialize the soap client object. Here's my code:
$client = new nusoap_client($this->sushiURL);
$result = $client->call("GetReport",$params);//$params is a series of nested associative arrays
However, var_dump($result) results in bool(false). This is odd because var_dump($client) shows that it has definitely pulled _something_ back from the URL I supplied. And in my testing with SoapUI, even when the parameters you supply are wrong, you will at least get some response from the server.
I'm officially stumped, and I must say that the documentation available for this sort of thing really stinks. If/when I get this working, I plan on making some sort of tutorial for it.
Josh Welker
Electronic/Media Services Librarian
College Liaison
University Libraries
Southwest Baptist University
417.328.1624
-----Original Message-----
From: Code for Libraries [mailto:[log in to unmask]] On Behalf Of Walker, David
Sent: Tuesday, February 28, 2012 9:51 AM
To: [log in to unmask]
Subject: Re: [CODE4LIB] PHP SUSHI client
Hi Joshua,
What do you see if you do:
var_dump($client->__getFunctions());
That should show you the available methods and their parameters.
--Dave
-----------------
David Walker
Library Web Services Manager
California State University
-----Original Message-----
From: Code for Libraries [mailto:[log in to unmask]] On Behalf Of Joshua Welker
Sent: Tuesday, February 28, 2012 6:00 AM
To: [log in to unmask]
Subject: [CODE4LIB] PHP SUSHI client
Hi everyone, first post to this listserv.
I just started working on a SUSHI harvester client as an addition to a data management program I've built primarily with PHP/MySQL. There are a few projects I've seen listed by the NISO SUSHI organization for doing this, but they are all in Java or .NET. I am not very familiar with those languages and want my app to stay in the realm of PHP for continuity sake, so the roll-your-own approach is the only way to go.
I am having trouble understanding how WSDL and SOAP object methods interact with my code. I know from reading the SUSHI protocol standard that there is a method called GetReport that is used to retrieve the report. What I am having a hard time understanding is how I can pass data into the GetReport method.
For example, I have the following code in a class:
$client = new SoapClient($this->sushiURL); $this->response = $client->GetReport(???);
Where the ??? is, I need to be passing in the basic parameters of a SUSHI request: customer ID, requestor ID, date range, etc. As an alternative, I guess I could do it "longhand" and pass in an entire XML file, but I'd like to learn the standard way using the WSDL method as specified in the protocol definition.
This is somewhat unrelated, but is it possible to limit the COUNTER data returned to a particular database? Most vendors such as EBSCO allow you to limit COUNTER reports to a particular database in their admin modules, but I don't see any way in the SUSHI standard to specify one.
If anyone with experience rolling a SUSHI client could give me some pointers here, I'd greatly appreciate it.
Josh Welker
Electronic/Media Services Librarian
College Liaison
University Libraries
Southwest Baptist University
417.328.1624
|