Saturday, 19 February 2005
WSDL2PHP
I got inspired to write some code on a new tool to extract the
complex types from a WSDL-file to generate PHP classes to be used
together with PHP's SOAP extension. The SOAP extension partly
extracts this information but it doesn't give you directly access. The
SoapClient object has a method called __getTypes() which
gives you simply a C struct of the complex types from the WSDL file. I
simply used this information to create simple PHP data storage classes. The SoapClient object also has a __getFuntions()
method which return the signature of all methods you can use on the
proxy object (or SoapClient instance if you will). This turned out
useful to generate a local, self-contained WebService class. In
practice this means that I'm now able to write the following command to generate code for XMethods Query Service i.e.:
$ wsdl2php http://www.xmethods.net/wsdl/query.wsdl
Writing ServiceSummary.php...ok
Writing IDNamePair.php...ok
Writing ServiceDetail.php...ok
Writing XMethodsQuery.php...ok
This generate all complex types as seperate PHP classes and the actual WebService class XMethodsQuery. Now I can simply access the service as following:
#!/bin/env php
<?php
require_once 'XMethodsQuery.php';
$query = new XMethodsQuery();
print_r($query->getAllServiceSummaries());
?>
This will simply print out all services listed at XMethods. This is a very simple example, but the key here is that the service is actually self contained and method call may have parameters of complex types that you have autogenerated.
The code is working ok now, but I have some issues left before I can release something out of this little research. I need to find a good way of handeling namespaces (I use the SimpleXML extension to dig into the WSDL file). Sterling Hughes have some information about it here.
The script also need to be tested on a
wider range of WebServices (at least most of the autogenerated tools
like .NET and Axis). Axis seems to have a weird naming convention I
need to sort out. The WebService class should maybe use the new __autoload()
method to dynamiclly load the storage classes when needed. And
what about nested complex types? I mean SOAP responses of complex types
which contain another member variable of a complex type and so on. I
need to verify that this actually works (I see no reason that it
shouln't, but I've not tested it in PHP5 at the time of writing).
Another TODO it that I want to dig out more of provided documentation
in the WSDL file if provided to be added in the generated files as a
part of the autogenerated PHPDoc I'm also adding.
Small update: Seems like SimpleXML isn't the solution for me. I think I'll use the DOM Functions instead. It's better documented too.
Wednesday, 16 February 2005
Internet Explorer 7
Miguel de Icaza on LugRadio.org
Miguel de Icaza, the man behind Mono and Ximian, is interviewed in the latest episode at LugRadio.org.
php|architect - february issue
php|architect's february issue is out. Qiang Xue has wrote an article on PRADO which also contains an example on how to write you own components. In addition there is another interesting article about a new enterprise architecture product for PHP5 called the iConnect architecture. This is a part of the "new" Carthag project. I'll hope to have a look on it tomorrow. It looks quite interesting.
php|architect has lowered their prices pr issue so time for you to grab the latest issue also.
Raptus
I've just put together a very small and simple tool I called Raptus. It's a simple web application to edit an XML-file using PEAR::XML_Serializer to serialize and unserialize XML data into a simple datastructure, PEAR::HTML_QuickForm to add/edit entries and PEAR::HTML_Table to present the data.
References:
- Instant XML with PHP and PEAR::XML_Serializer by Harry Fuecks
- Serializing XML With PHP by Vikram Vaswani
- PEAR::HTML_Table tutorial by Bertrand Mansion
Tuesday, 15 February 2005
PEAR_Server released
Greg Beaver annonced the release of PEAR 1.4.0a1 and PEAR_Server today.
Sunday, 13 February 2005
Debugging C with GDB
Finally got some time to try out some of the GTK+ examples in Gnome 2 Developer's Guide. I ran into some compiling problems and the session instead ended up as a tour into debugging C in Emacs with GDB. I used the following reference material:
- Intro to GDB under Emacs
- GDB som debugger i C (Norwegian).
Saturday, 12 February 2005
LLB 2005
I was visiting Lyd, Lys og Bildeforeningen's fair today. This is the biggest fair in Norway dedicated to the professional market of imagery, sound and light.
Multimedia Innovation joined LydRommet's
booth this year. In the back you can see the superdisplay (counting a
resolution of 3200x1024 pixels) I've been working with in my final
project at school for Multimedia Innovation.
Compact Light System Norway had a really cool fake fireworks effect. I got a really cool image of the effect. 
Avid Technology joined the exhebition with it's own tour bus.
An Avid editor showing the latest functionality in Avid Media Composer.
A guy from Noroff Institute showing new cool stuff in Steinberg Nuendo 3.
A guy from Apple Sweden showing the latest plugins in Apple Logic Pro 7.
pearbot
If you want to create a IRC bot (and also want to write it in PHP) you should check out the pearbot project in PHP's CVS tree. This is the IRC bot used on the #pear-channel on EFNet. It makes use of Net_SmartIRC from PEAR.
The password is "phpfi".
PHPUnit2
I've tested Sebastian Bergman's PHPUnit2 today.
PHPUnit2 is the new version of the unit-testing framework PHPUnit that
should be used for PHP5. One of the first thing I liked the new phpunit command as a shorcut to execute testscripts instead of writing own test suites. You can find a simple tutorial here.
I'm also excited to see that the MonoDevelop project is going forward. More about that in Christian Hergert's blog.
Tuesday, 08 February 2005
Using jEdit for PHP?
Installed jEdit after reading Scott Beatty's article use jEdit to edit your PHP code at sitepoint. The first impression was quite ok, but it's most likely "just-another-editor". It has a nice plugin manager tool so it's easy to customize it the way you want by selecting from over 100 plugins. One of the plugins to choose from is a plugin called PHPParser which hasn't support for PHP5 yet so I guess jEdit have to wait a little longer before I feel like using it.
PEAR_Server on it's way
I'm looking for setting up my own PEAR channel server to use as a
release management system of my code with dedicated official PEAR
packages and own packages I use. I found a tutorial on Seagull's wiki to set up a channel server. This light tutorial tell you to use the pearweb project to set up a channel server. I gave it a try but unfortunately it only runs on PHP4. So I contacted Greg Beaver
to maybe help him out testing the new PEAR_Server comming in PEAR
1.4.0. I got a positive answer and was dedicated "the perfect guinea
pig".

You can read more about PEAR channels in Greg Beaver's blog PEAR 1.4.0 channels from the client side. I found some old information about how PEAR_Server should work here.
Hey Jude!
Tested Jude today, another UML modeling tool. What I liked about it was it's drawing capabilities. I tested drawing use-case diagrams, sequence diagrams and activity diagrams and almost everything I drew felt natural so it was quite rapid. It's just a drawing tool actually, but exporting to images works nice and if you want a tool just to draw UML quite rapid and use it in your documentation I'll suggest Jude.
Monday, 07 February 2005
Gaphor - another UML tool
Building web clients using XUL and SOAP
I found some nice slides from Dr. Volker M. Göbbles talk at the International PHP Conference 2004 about building web clients with XUL and SOAP.
PHP Code evaluator for emacs
Since I use Emacs as my primary editor for most of my work I finally found some lisp code to evaluate PHP code from Emacs.
More comment spam
Since I've got more referers to my blog lately the comment spam has increased rapidly. Got another 30 comment spam today. I've now removed all comment functionality.
Saturday, 05 February 2005
Comment spam
The comment spam beast hit me today with around 70 spam comments. I blocked all IP-addresses and removed the comment feature until I've looked more on the issue. six apart have a good guide on combat comment spam.
I've used most of my free time today on looking more into PRADO and learning the TDataList control and how to create modules.
Thursday, 03 February 2005
Creole Performance
Qiang Xue, the creator of PRADO, read my post about an enterprise web solution in PHP 5 and asked me about Creole's performance, so I did some research.
I found a performance benchmark of Creole by Tony Bibbs which shows that Creole is slower than both ADOdb and PEAR::DB. Hans Lellelid, the creator of Creole had an interesting reply on this issue and the future of Creole. But I would like to see what Creole can do in the same test but with use of it's unbufferedQuery()-method. That would be really interesting.
Maya 6.5
Alias have launched Maya 6.5. This release seems like it's dedicated to performance issues with Unparalleled performance improvements, new scene segmentation tools, high performance CAD data import and mental ray for Maya 3.4. Nice to see that there seem to be a better solution for network rendering with mental ray and Maya with the new Maya Satelite.
Wednesday, 02 February 2005
Pling bugfixing
Got some bugs of the Pling engine fixed yesterday. The engine is now "stable" enough so I can start adding more service checks. I'll go back and fix more on the engine while I discover problems with new services. I'm working toward a some kind of test release for some friends in the near future. I've already got some good feedback on the project so I'm quite excited about it at the moment.
I see that Robert Peake is working on PEAR::Net_Monitor that basicly is the same idea as Pling, but I've run through the code and see no reason to use it as a framework for Pling.
Emacs keybindings in Firefox
I was doing some editing on a Wiki page today through Firefox. Then I needed to cut'n'paste some text and instantly typed Ctrl+W (cut in Emacs), and Whops! there goes my Firefox tab away. After a little look at the File-menu I discovered that Ctrl+W is a shortcut for "Close Tab". Jippi!
A quick search at Google gave me this solution if to enable Emacs keybindings in Firefox.
LugRadio.org
I got a tip from Kristian Vedvik Holm about a free software radio called LugRadio.org. The programs is produces by four Linux fans talking about free and open source software and is appearing with new "episodes" each two weeks. I've listen to a few episodes today and find it quite entertaining.
Tuesday, 01 February 2005
PHP Security Consortium
Chris Shiflett, an internationally recognized expert in the field of PHP security, has launched the PHP Security Consortium (PHPSC), an international group of PHP experts dedicated to promoting secure programming practices within the PHP community. As he say in yesterdays press release: As PHP has transitioned from personal projects to enterprise application development, the need to educate the community about secure programming practices has risen. A PHP Security Guide is already launched on their pages. Marcus Whitney has also got an interesting article about Using PEAR's Text_CAPTCHA to Secure Web Forms. I got a very good first impression of this project and will keep an eye on it.
Instiki
Just found Instiki. Seems like this is the next Wiki I'm gonna use. It has a very nice default layout which makes it easy to read and the focus on the content is very strong.
