Consuming SOAP Services on OSX 1
SOAP is bloated and I hate dealing with it. I still have to do it. When dealing with consuming SOAP services from OS X I like to have a couple of items in my bag of tricks to get up and running: a SOAP Client and a way to do base64 decoding. This way I am able to test the service without writing any code. Too often I beat my head against my keyboard over a piece of code only to realize the service itself is the problem.
Here is the SOAP Client that I use: SOAP Client (what an original name!). It really does the trick, though. Point it at the SOAP service WSDL and you are off to the races. It allows you to pass in arguments and call different services. It does it all and returns the XML requested.
Once you have the XML often you will then need to decode a base64 encoded string. Base64 decoding is a bit trickier. Most of the time you can use openssl to decode on a Unix based platform but for some reason it doesn't seem to work for me. I have had to resort to the following perl script:
#!/bin/sh
# decode a Base64 encoded file, as a side effect of
# openssl base64 handling (but without encryption)
/usr/bin/perl -MMIME::Base64 -e 'print decode_base64(join("", <>))' < "$1" > "$2"
The script takes two arguments: and input file and an output file. I am not a "perl" kinda guy so the script is mostly stolen and probably can be hugely improved.
If your data is a base64 encoded string of gzipped data the next step is to toss the old ".gz" extension on the file and extract the contents using the OS or using gunzip.
Basic stuff really, but it is a pain to track down so I thought I would toss it all in one place.
Rails + PostgreSQL on OSX
I was not able to find simple instructions to get PostgreSQL onto OSX and working with rails. So here is a simple way…
First grab the binary installer from the fine folks at EnterpriseDB .
Then you just need to toss on the ruby gem using:
sudo gem install postgres -- --with-pgsql-include=/Library/PostgreSQL/8.3/include/ --with-pgsql-lib=/Library/PostgreSQL/8.3/lib/
That is it, you should be good to go.
– BONUS: Sphinx with PostgreSQL –
Why not a little bonus! Since searching is something you probably want to do then you will need to install something like Sphinx - so if Sphinx is your choice here is the way to get it going. First download the source code and unzip it. From the folder run:
./configure --without-mysql --with-pgsql --with-pgsql-includes=/Library/PostgreSQL/8.3/include/ --with-pgsql-libs=/Library/PostgreSQL/8.3/lib/ make sudo make install
With that done we just need to configure rails. But for info on that you are better off going to railscasts.
Rogers Mobile Internet Stick on OSX 8
I really like Rogers Mobility products and services - but that is another rant - so when they called me up and offered me a sweet deal on a Mobile Internet Stick I took them up on it. When I went to a local Rogers store and picked one up the sales person said, "this took a Mac expert from Westworld Computers and me four hours to get running on a Mac - you better get their help."
Now we both know that there is no possible way that this is a four hour job. Especially when you think about who makes the "Stick" for Rogers: it is a Novatel Wireless Ovation MC950D. Novatel Wireless has been a Mac-Friendly company for years and they will definitely have drivers. So I took a quick look at their website and not only did they have drivers, but they also have put together a guide on how to get the "Stick" up and running. I grabbed their drivers and was up and running on Leopard in 4 minutes not four hours.
Painless.
At my house I can get about 3.6Mbps down and 1.2Mbps up. To put that into perspective it is faster than Telus ADSL. It is faster than their so called High Speed Enhanced Internet and when the Rogers network is upgraded to 7.2 Mbps it will be faster than their so called High Speed Extreme Internet.
In case you have never done this before there are a bunch of settings that are required to get things running. You need to type in the Account Name and the Password. You will also need to go into the advanced settings and set your APN.
Account Name: wapuser1
Password: wap
APN: internet.com