Call a C# service through C++ - c#

I want to make a call to a web service that is written in C#, through Visual C++ or C++ in Visual Studio 2010. I searched on web but was not able to find any point to point document. It would be a great help if you will tell me.

If you're prepared to go with managed C++ then you can use WCF.
However, if this isn't an option then your best bet is to go with a socket approach. You'll need some cross-language way to represent the data your sending from C++ to C# and back again. Google Protobuf will help here as there are frameworks for both languages, in addition to many others.

A web service uses something JSON or XML as an interface and is inherently language independent. You would have to look for libraries that can create requests to the web service. For example if your web service in C# uses SOAP (XML) which it would if you created the default web service in Visual Studio you could create your own request in XML in accordance to the specifications of SOAP:
http://www.w3.org/TR/2000/NOTE-SOAP-20000508/
or use one of the libraries mentioned in this question:
Generic WebService (SOAP) client library for C++

Have a look at Walkthrough: Accessing an XML Web Service Using C++.

Related

Can I import libxml2 to Visual Studio 2013

I am creating a custom SOAP parser for a C# project.
I would like to import libxml2 (a pure c library) to my project. Is this doable?
Are there any C# alternatives in .NET? Is there a C# port of libxml2?
You can use standard XmlWriter and XmlReader from System.Xml namespace which internally use Microsoft Xml Parser which is pretty fast. You can even use DOM oriented acces with System.Xml.XmlDocument or System.Xml.Linq.XDocument. Even there is System.Runtime.Remoting.SoapServices class which help you with soap message.
If you want to consume some SOAP web service, than you can easily import it and visual studio will create strong typed object for you for free without any touch to the SOAP message. You can refer to: MSDN Consuming Web Services
You may have probably allready solved this but i will add this:
I was looking for the same thing and found out there is a nuGet package for libxml2
you might find this helpful.

Generic Webservice Architect for Java and C#

We have a web service written in C# running on Window 2008. We have two applications that need to access the web service. One written in C# and the other is in Java. We want to develop an over-arching architecture so both can call on the web service without us having to write two separate interfaces. Does anyone know the best approach for this?
Answer : To use Window Communication Foundation WCF.

Convert/Use API written for C#/Java with PHP

I have access to an API that I would like to use, but it only has documentation in C#/Java. I know neither of these languages and would love to use the API in PHP. I do have access to the API's WSDL and was wondering how I might go about this?
I've heard various other ways such as SOAP calls or converting the WSDL into PHP Classes. Any information is very helpful. Thanks!
While I haven't used Soap's native functions, I have used NuSoap with a WSDL document that's generated from a Java system. Overall its worked pretty flawlessly; the only problem has been when they've changed how they do authentication and I've had to make some manual changes. Other than that, I've just had to update the WSDL when they do upgrades.
If I had a newer version, I probably would have just used php's native functions.

Is Python good for writing standard, compatible and complete SOAP web services?

I have used few python soap libraries (SOAPpy, soaplib and Twisted wrapper around SOAPpy) to write my soap web service.
When I used python clients (SOAPpy.SOAPProxy and SUDS), I was able to communicate with my web service (returning simple and complex type objects).
But, when I tried with C# ASP.net, I got many issues. I came over returning simple types (int, string, double, boolean) issue with some hack into SOAPpy library. But, I am still struggling with returning ComplexTypes from SOAPpy.
I could not find any complete, compatible alternative python library for writing my web service.
Main Question: Any suggestions/examples for dot net compatible complex type return from python web service would be highly appreciated.
Note: I had to hack SOAPpy quite a bit to make it working in first place. And, I had to handwrite wsdl file in case of SOAPpy.
In my personal opinion, the compatibility of Python SOAP libraries with other platforms is not good.
I think that there are two issues here:
First, the compatibility of web services among web service stacks is an aspiration rather than reality. For example, look at this question to see how to use web services between Java and WCF.
That being said, the concept of WSDL which is largely compile time typing is not in line with Python's original philosophy, so less effort was put into it.
I haven't worked with web services for over a year now so may be things have changed. But the advice is the same as in the previous question:
Start with the WSDL writing if you are using more than one language/library.
As copied from the other question, "start with XSD, but confine yourself to mainstream types. Primitives, complextypes composed of primitives, arrays of same."
In the end I settled on using suds for Python web clients, after experimenting with it and soappy and zsi. That was after some time using a C based library (gsoap) and linking to it from Python.
I was never satisfied with server implementations in Python, so I used to build Python servers and connect to them from another library which can export SOAP services (in my case Java or C, you will probably use C#). The connection is usually a much simpler protocol.
That being said, if you start with WSDL you are likely to get good results using soaplib or may be zsi. But I am afraid there is almost no way around building your types slowly while checking for compatibility.

Open source equivelants to wsdl.exe? (how to autogen a web reference proxy class)

As an ASP.NET developer, I'm used to working with how VS/C# transparently autogens proxy classes for web references via wsdl.exe (yes, I know, we're spoiled), but now that I'm creating documentation for more than one coding platform I'm trying to discover what the equivelant to that is in any other framework.
So is there a similar way to work transparently with web reference proxy classes for say, RoR, PHP, and Python?
And if there's nothing integrated, are there tools you recommend to autogen the proxy classes, or do you recommend to roll custom classes?
I've had (limited) success with ZSI http://pywebsvcs.sourceforge.net/ for Python. Try at your own risk.
If it would be possible to run IronPython or IronRuby I would check that out.
I definitely know how VS can spoil you.

Categories

Resources