Here is a nice little list of public geocoding services, many of which are free or free when not called as a batch operation.
You might need to adapt your code to make REST calls, but it looked like a number of the geocoding services also support XML (SOAP).