Tuesday
22
Feb 2005

Call a WSDL/SOAP Service from PHP using NuSOAP

(4:50 pm) Tags: [Software, How do I...]

Ever find yourself needing to make a quick call to some WSDL service out there? Do it with PHP next time, and find out how easy it is!

Just download the latest copy of NuSOAP, and type up a PHP file something like:

< ?php

// include the SOAP classes
require_once(’nusoap.php’);

$client = new soapclient(’http://example.com/url/to/some/valid.wsdl’, True);

$err = $client->getError();
if ($err) {
// Display the error
echo ‘client construction error: ‘ . $err ;
} else {
$answer = $client->call(’someSOAPMethod’,
array(
‘param1′=>’foo’
,’param2′=>’bar’));

$err = $client->getError();
if ($err) {
// Display the error
echo ‘Call error: ‘ . $err;
print_r($client->response);
print_r($client->getDebug());
} else {
print_r($answer);
}
}
?>

It couldn’t be easier. NuSOAP reads and parses the WSDL, configures your method call and params with the correct schema types, and makes the call. The response comes back as an associative array. This is how WS-* should be :)

Popularity: 31%

Comments: (4)
Thursday
10
Feb 2005

When to add a feature

(7:34 pm) Tags: [Software]

Overheard on the NetNewsWire beta mailing list (Brent Simmons talking):

There are the six main questions I think about when I consider a new feature, any new feature:

1. Is it a useful feature that a lot of people want?

2. Can it be added in a way that doesn’t compromise the ease-of-use and quality of the app as a whole?

3. Can the feature itself be easy-to-use and powerful enough to satisfy the people who want it?

4. Is it important when it comes to competing with other applications?

5. Would having the feature increase sales or decrease sales or have no effect?

6. Would the development effort outweigh the benefits?

I think this is a great base for you to ponder whenver you decide to add a feature to some piece of software. Personally, I think too many people feel that saying yes is always the right answer, only to find out the deep trouble they end up in because of it.

Popularity: 10%

Comments: (0)
Wednesday
9
Feb 2005

The IFRAME is dead…Long live the IFRAME!

(12:51 pm) Tags: [Software]

Since Alex has been pushing me towards the XMLHttpRequest object for what seems like years, why is the hidden IFRAME still a favorite?

In Mapping Google, Joel Webber proceeds to dissect the new Google Maps. Interesting quote:

The first thing I noticed is that it doesn’t quite work like GMail. Whereas GMail uses XMLHttp to make calls back to the server, Google Maps uses a hidden IFrame. Each method has its benefits, as I’ll discuss below, but this difference of approach does seem to imply that it may not be the same team doing the work.

Not only a different team is implied, but also some sort of ‘holding on to what works’. This is fine, until 6 years down the road, we realize we still have to support it. :)

I guess I shouldn’t talk so much, since I have used both approaches, heck I have even used the brain-dead ‘hold the http connection open and send more javascript’ approach, and I can assure you that particular approach just doesn’t scale.

Popularity: 7%

Comments: (0)
Tuesday
8
Feb 2005

40 things every drunk should do…

(7:44 pm) Tags: [General]

…before he dies: Read it here.

I guess I need a little more work, since I have only done 8 (3 and 4, 22, 23, 31(thanks Aco), 33, 36, 39) of those things. Guess I better get cracking :)

Happy Drinking.

Update: forgot to mention I got this from Jason.

Popularity: 8%

Comments: (0)
Monday
7
Feb 2005

Matt needs Tasks

(11:46 am) Tags: [General]

Matt,

Perhaps you would like to try the dogfood of your colleague, Alex King? His Tasks software package is extremely powerful for, you know, managing tasks. You can either just download and run it on your own server, or use the hosted service Use Tasks. I and many others have found it a useful product that fulfills a daily need.

And not to be mean, but his software upgrades seamlessly :)

Popularity: 9%

Comments: (0)