Webservices with DumbartonWhile I have been know to gripe about WebServicesCore, there are however options now when developing service-oriented applications. Introducing, Dumbarton; Dumbarton is basically a ObjC-C# bridge that makes use of the Mono embedded API to allow you to utilize C# code from within your Cocoa application. Personally, I think writing SOAP consumption code in C# using Mono or .NET is far nicer than trying to write something using C/Objective-C via WebServicesCore, so this is my "favorite" option. The word favorite being in quotes as unfortunately Dumbarton is a bit complex to use and bundle for a smaller Cocoa application. Dumbarton is however an option, so I wrote up a quick example that makes use of a currency exchange rate webservice via xmethods.com and essentially rehashes the proverbial "Currency Converter" sample project with an up to date exchange rate. I uploaded the entire project into subversion, so you can check it out with: the nitty grittyMostly because I'm a lazy developer (who isn't?) I used the standard "wsdl" executable that you can find in .NET or Mono to generate the necessary stub class for providing the last intermediary layer between our desktop application. The method that's generated (synchronous) that we'll write our wrapper for is: The Dumbarton wrapper provides the neccessary "boot strapping" for a bridged object between Cocoa and Mono and also "acts" as the bridged object for the C# class. For example, our Dumbarton wrapper class is called CurrencyConverter which is a subclass of DBMonoObjectRepresentation, and in the wrapper method we call: notes on CurrencyConverterI bundled a Dumbarton.framework build that I had handy inside the Subversion repository, but I have linked this against the Mono 1.2.3-preview that I have installed on my machine, so I recommend you checkuot the latest Dumbarton from Subversion ( the springer final thoughtDepending on your familiarity with developing with C# in either Mono or .NET, Dumbarton may be a great option for utilize existing .NET code for webservices, write cross-platform webservices code, or just avoid the pains of WebServicesCore; it can also be another frustrating stop on the avenue of SOAPy pains if you misunderstand how Dumbarton or C# works. It's currently on my ever lengthening todo list to start documenting far more of what you can do with Dumbarton, but hopefully the examples distributed with the source, along with CurrencyConverter provide a good starting point for those who feel crazy enough to try it out. As a side note, I have 8.6444 pound in my wallet right now.
|
Recent comments
6 days 5 hours ago
1 week 1 day ago
1 week 1 day ago
2 weeks 2 days ago
2 weeks 6 days ago
3 weeks 2 days ago
3 weeks 3 days ago
8 weeks 2 hours ago
8 weeks 3 days ago
9 weeks 1 day ago