Please help if anybody knows the answer!
I’m just starting to learn Ruby on Rails. I’m working my way through
the Agile Web D. with Rails book.
I have been offered a project that I’d like to do with Rails for a
not-for-profit organization. However, the person who I would be doing
it for would like the application to integrate with their Quickbooks
system on a Windows server. What is the best way to do this
integration? I have tried to research this, and I have found out that
there is a COM based API for Quickbooks. Is there any kind of
integration between Ruby and Microsoft COM? Am I better off placing the
COM code interacting with QuickBooks behind a web service which I can
call from my Ruby code? Any other ideas about how to do this? I’m not
sure if I can satisfy the requirements for this project, so any help
would be appreciated. You can also email me directly at
[email protected].
CONFIDENTIALITY NOTICE
This transmission is intended for the sole use of the individual
and/or entity to whom it is addressed, and may contain information
and/or attachments that are privileged, confidential and exempt
from disclosure under applicable law. If the reader of this
transmission is not the intended recipient, you are hereby notified
that any disclosure, dissemination, distribution, duplication or
the taking of any action in reliance on the contents of this
transmission by someone other than the intended addressee or its
designated agent is strictly prohibited. If your receipt of this
transmission is in error, please notify the sender by replying
immediately to this transmission and destroying the transmission.
For your protection, do not include Social Security numbers,
passwords or other non-public and personal information in your
email. Thank you
Might be a hack, but SaltyPickle.com is for sale | HugeDomains says it
allows access to .NET
Can COM objects be directly accessed via .NET or do you need to manually
develop .NET wrappers?
Dr Nic wrote:
Might be a hack, but HugeDomains.com says it
allows access to .NET
Can COM objects be directly accessed via .NET or do you need to manually
develop .NET wrappers?
.NET can wrap com objects. You just need to include the com object with
your project and it will automatically create an interop for it. I
suggest sticking to basic object types (string, int, etc…) and not
trying to pass complex custom objects between them.
Regards,
Michael
I may be wrong, but if I remember correctly you need to develop the
wrappers unless the object already uses a .NET namespace. The closest
thing I have heard of that does what you ask is remoteObjX by
Synergration (http://www.synergration.com/remoteObjX/default.htm). Don’t
think you can use it on Rails though.
Jarod R. wrote:
I may be wrong, but if I remember correctly you need to develop the
wrappers unless the object already uses a .NET namespace. The closest
thing I have heard of that does what you ask is remoteObjX by
Synergration (http://www.synergration.com/remoteObjX/default.htm). Don’t
think you can use it on Rails though.
My experience tells me differently. If you browse to the com object
from your .NET project (there is a tab for com objects) then it will
build the interop automatically. The only time you need to do anything
special is if you want to sign it - then you have to build a key and
this is for deployment purposes when you need the object in the GAC.
However, unless you are accessing it from MTS/DCOM then you don’t need
to put it in the GAC.
Regards,
Michael
Jarod R. wrote:
This works for a COM object that is not using .NET?
Jarod,
It works for COM objects. .NET doesn’t use COM by default but has
access to com objects. There is extra marshalling that takes place so
it is preferable to use pure .NET if possible but for most companies
this isn’t an option. IN fact, the interop allows you to slowly migrate
from non-.net projects to .net projects little by little. I’ve used
this method with com objects created in VB and C++. If the com object
is written in C then the interface needs to be properly exposed (most
commercial products it is) - so yes, this works from within a .NET
project. Again, the only time you have to do anything special is if you
have a particular need to strongname the file.
If you have Visual Studio.NET then open it up, add a COM reference or
browse to a dll or exe that you know is a com object and you will see it
creates an interop for the com object under your bin directory of the
project.
Regards,
Michael
Without knowing much about Quickbooks specifically, wrapping the COM
API with Web Service/s makes a lot of sense to me. If you pick up the
“Programming Ruby” book, you’ll see that you can integrate Ruby with
COM, but it ties you to having to host your Ruby app on Windows -
wrapping the COM API with Web Service/s frees you from that
restriction.
I run RoR apps on both Linux and Windows hosts, and in general the
Linux hosts are less trouble and give me greater throughput. I’d
ditch the Windows hosts entirely, except that those specific
environments are tied to Windows and I don’t have that option.
Regards
Dave M.
This works for a COM object that is not using .NET?
Poserow, Benjamin wrote:
Please help if anybody knows the answer!
I’m just starting to learn Ruby on Rails. I’m working my way through
the Agile Web D. with Rails book.
I have been offered a project that I’d like to do with Rails for a
not-for-profit organization. However, the person who I would be doing
it for would like the application to integrate with their Quickbooks
system on a Windows server. What is the best way to do this
integration? I have tried to research this, and I have found out that
there is a COM based API for Quickbooks. Is there any kind of
integration between Ruby and Microsoft COM? Am I better off placing the
COM code interacting with QuickBooks behind a web service which I can
call from my Ruby code? Any other ideas about how to do this? I’m not
sure if I can satisfy the requirements for this project, so any help
If you are deploying on a Windows machine (and can develop on a Windows
machine), Ruby on Windows has a WIN32OLE library for working with COM
objects. I’ve used it a little bit and it seems to work quite well
(though it may be worth wrapping up the COM objects in some kind of
adapter object).
If you are deploying to Linux then you definately want to look at
running a separate service on a Windows machine that exposes the COM
functionality to you. This could be a Web Service or it could be a set
of Ruby wrappers around the COM objects exposed using DRb.
For those who come across this forum topic later with the same
question…
You can see examples of how to do Win32Ole / COM in the demo QuickBooks
rubygem, available at quickbooks | RubyGems.org | your community gem host.
The full version is available for sale at http://behindlogic.com, but if
all you want is the COM communication, you can get that out of the demo
gem.
Also available at http://behindlogic.com is an HTTP Connector that makes
it possible to use the gem (or other quickbooks-integration project in
any language) from a different computer.