Consuming .Net Web Services?

Ok... Anyone have any experience with .NET webservices?

We have a site that we're re-doing in Rails, that was done in .NET, and there's a desktop application to it that we want to keep using for awhile during the switch.

To get the data in to the MS SQL database that the software uses, we'd like to use a WebService, and connect to it with the Rails app to dump the data into the database. Now assuming I've figured out how to make my webservice, and I have it up and running... how does Rails connect to .NET services... is there a plug-in I need to use? Or rather is there a plug-in I should use?

Thanks in advance!

If I understand your Q, you are wanting .NET to consume a Rails webservice(not the opposite)? If so, you'll need to generate a WSDL from your Rails app. Here's a link :http://benrobb.com/2007/01/30/ howto-put-wsdl-on-rails/

Then you'll have .NET generate the stub code to call and consume. From there you are in your .NET and should be able to interface MS SQL.

That being said, I think using Rails to get MySQL to MS SQL is not the only option. You could simply use mysqldump to create a CSV, copy to the MS SQL Server (use pscp to pull the file), use DTS to import and then automate the whole thing via cron and Windows 'at'. This would keep the web out of data syncronization, which sounds like what you are trying to do.

Thanks, Hank

I want to consume a .NET web service with rails. Basically it's a big form that is submitted to a MS SQL database. The data is used to generate a bunch of reports, and so forth with a .NET Desktop Application, and the reports are then going to be uploaded from the Desktop Application to the Ruby on Rails webserver for access by the end user.

The data needs to be put into the MS SQL database in real-time, and it is not a simple synchronization. The data from the one form is put into about 5 different tables in the .NET application, and need to remain that way for the desktop software to work. I figured converting the sumbission method from the .NET application into a web- service, and consume it with Rails, would be the easiest way to complete this.

Maybe I'm wrong?

I have had experience with this before. You might find this helpful:

http://wiki.rubyonrails.com/rails/pages/How+To+Consume+.NET+WebServices

I ended up using a combination of Soap4r[1] and ReXML (probably would have used Hpricot if it was around) rather than using the Rails Web Services module. Basically created model objects that mapped to models against the web service to hide all the ulginess of working with SOAP :slight_smile:

[1] http://dev.ctor.org/soap4r

Let me know if you need any more info.

Cheers, Nicholas