Re: WCF services with IronRuby WCF programmers interested in IronRuby might like to check out an example of using WCF in IronRuby that I have created: wcf_service.rb<http://github.com/rvernagus/IronRubyInline/blob/082150220cdd101f10b2b7e43fbfb4067726f32d/examples/wcf_service.rb>
A few caveats are in order: 1. There is C# code involved. This example requires a library that I have just started (IronRubyInline <http://github.com/rvernagus/IronRubyInline>) which allows you to write C# (or F# or VB) code inline with IronRuby and you will need to download the library along with the example in order to run it. 2. Due to the way that classes are implemented in IronRuby, it appears that only Singleton services are possible. 3. This is a new library and it's not quite ready for use. BUT, this example does use a minimal amount of C# without having to resort to a separate Visual Studio project. The C# code can live inside of your IronRuby file. Also, it illustrates a full service implementation in IronRuby. If anything, it shows what kind of magic is/will be possible with IronRuby! =) I hope that you find this interesting and I would love to get your feedback! --Ray On Wed, Mar 11, 2009 at 7:43 PM, Orion Edwards <orion.edwa...@gmail.com>wrote: > Had time to get back to the WCF stuff: Here's the latest > class MyService > include IWcfContract > > def ping(x) > x > end > end > > uri = Uri.new "http://localhost:8700/MyService" > binding = WSHttpBinding.new > host = ServiceHost.new MyService > host.add_service_endpoint(IWcfContract.to_clr_type, binding, uri); > > > => Now raises the following error (new and different from last time, > exciting!): > > *The contract name 'IWcfContract' could not be found in the list of > contracts implemented by the service 'IronRuby.Builtins.RubyClass'.* > * > * > I also tried creating an abstract C# class as follows: > > public abstract class WcfContractClass : IWcfContract > { > public abstract string Ping(string input); > } > > and then having the ruby class do this: > > class MyService < WcfContractClass > > however the same error occurs. Still running the dlr nightly v12211 > build... > > Any ideas? > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core@rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >
_______________________________________________ Ironruby-core mailing list Ironruby-core@rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core