I have several unmanaged c++ programs that I use to do "heavy lifting" type operations. I like to database certain information that these clients use. In order to do this I created a WCF service which exposes my DAL to the database. I then created a managed C++/CLI wrapper to call the web service from the native C++. Would it be better to parse the WSDL using gSOAP and connect to the WCF service using SOAP?
The C++/CLI wrapper approach does have many advantages. This does make a simple way to use all of the WCF tooling, with any transport mechanism, from within C++. However, it does introduce a dependency on the CLR, which may or may not be acceptable.
Another option would be to use the C++ REST API (aka Casablanca) to call the WCF service directly, using a pure native API. This would require exposing the WCF service via REST.
Related
I have a web service that have functions to retrieve data from database. (http://exampledomain.com/webservice/webservice.asmx) It's easy to add a web service in C# (Project->Add Service Reference->Advanced->Add Web Reference) but i don't have any knowledge about C++. Also there is no option in Project tab for adding reference. How can i add web service to C++ project and access it's functions and retrieve data?
Standard C++ or MFC do no provide a way to consume web services. However, it is possible to do so with C++ REST SDK. It's a cross-platform library that allows you to consume services, use json, asynchronous streams and other things.
Is there any existing way to consume web services (SOAP, JSON, etc.) leveraging dynamic keyword from C# 4.0?
I'm looking for as lightweight implementation as possible (without calling wsdl.exe or such).
You can just share the contract (the interface) between the client and server. Then the ChannelFactory class will allow you to create communication channels to the server based on either pure code or a configuration file (app or web.config).
I have a C++ web service that needs to send/receive data from a Silverlight client.
Can I still use the WCF RIA client or do I need to use the sockets library directly?
Note that I'm pretty flexible on using HTTP or not, and I even prefer not to use the HTTP protocol.
Now this is just me thinking outloud here. But I'd assume that since you're using a C++ web service you're too low level to be doing anything WCF based (as WCF is usually a C# thing).
As far as using a sockets library directly, I think that a silverlight app can't do that for security reasons. Sockets are mainly for a client app that you have built yourself. But silverlight is a web client, So I would think that you'd only be left to use http requests.
I would like my Qt app to expose a service to another app written in .Net using WCF.
Is there any support in Qt for implementing WCF services?
AFAIK there is no 'native' Qt support for WCF or extensions; however as you know WCF can consume and expose a web service (in addition to a WCF or remoting service, etc.) All you need to do is expose it as a Web Service for the other .NET app to consume.
But that brings up an interesting aspect; usually you would write a windows service (I presume you are on Windows) which is exposed as a Web service rather than one via Qt. Qt is not ideal as it is a GUI framework (and a very good one); you will get into a few interesting situations as discussed here. It is usually easier to consume a web service with Qt as shown in this example.
Do you have the option to expose your service using some other stack such as ASP.NET or WCF or Java?
We have web service running for one of our projects. We want to be able to access this web service similar to how you'd access an API (such as Google Data, etc.) where you have client libraries in several languages: .NET, Java, Python, etc.
You'd be able to download these libraries (usually .DLL) from our project's website and then integrate these into your custom application.
The reason we want to have these client libraries is so that we can encrypt certain data transfers between the client and the web service and so that you wouldn't have to login a million times when you want to make a request (like you have to do when using raw SOAP requests).
So, my question is... What's the best way to do this? What would the client libraries contain, other than some encryption and a bunch of methods? What's the best way to create these libraries? Obviously some different platforms are needed to accomplish this (some flavor of Linux, maybe Mac OS), should virtual environments be used?
What are your thoughts? Thanks in advance for your help!
You would first express an API via the web service. What you are then interested in doing is creating a client "wrapper" for your web service API. This is what the client would download and use in their application (similar to Facebook.NET). This would be an assembly project and house a bunch of classes and so on. These classes would maintain the state of the program utilizing the API and would take care of all the low level plumbing work interacting with the web services by exposing a verbose object model that is easy enough for the user of your wrapper to get around in.
You could do this for any language that could interact with your web services. Java, Python, etc. I suggest using WCF though as you can use TCP for the .NET library and standard web services for the other languages. This will help you to be more performance oriented where possible.