Posted by dstanley
on April 03, 2007
Over on SOS Adrian has posted a set of slides that describe how to build multi-protocol, opensource, web services using JAX-WS.
The presentation gives a great overview of the architecture that allows Celtix Enterprise to deploy services that simulateneosly support multiple payloads (SOAP, XML, JSON) and transports (HTTP, JMS, AMQP). It also give some very helpful pointers on JAX-WS development in general – well worth checking it out.
Posted by dstanley
on April 02, 2007
Curious about the recent fuss about Twitter, I installed the Ruby
Twitter gem over the weekend.
>gem install Hpricot
>gem install twitter
It has a dependency on the Ruby XML parsing API Hpricot. Its the
first time I’ve played around with Hpricot, and the API is nice. (ActiveResource would do well to use it also as ActiveResources current XML to hash implementation is quite brittle).
In terms of configuration, the gem creates a /.twitter file in your home directory. On windows this is below %HOMEPATH%. Once you add your username and password to the config file, you can then post to twitter from a command shell anytime you like:
>twitter post "Post to my twitter account using ruby"
The only gotcha you have to look out for is that theres a bug in Hpricot when processing XML that contains <text> elements. I just commented out the offending line below:
<ruby>/lib/ruby/gems/1.8/gems/twitter-0.1.0/lib/twitter/status.rb
def new_from_xml(xml)
Status.new do |s|
s.id = (xml).at('id').innerHTML
s.created_at = (xml).at('created_at').innerHTML
#s.text = (xml).at('text').innerHTML
s.user = User.new_from_xml(xml) if (xml).at('user')
end
end
I think you should be able to use the Twitter gem with the new direct messaging Twitter API to
develop automated SMS response agents as described in TechCrunch’s article “Web Services coming to twitter”.
This would allow you to implement your own Twitter SMS agents (similar to the
href="http://www.google.com/intl/en_us/mobile/sms/">Google SMS API). I wonder will Google open up their SMS API on the backend?