Is it possible to exchange web-services over socket programs written in C/C++?
The data to exchange are in the from of xml/soap message.
Is it possible to exchange web-services over socket programs written in C/C++?
The data to exchange are in the from of xml/soap message.
Yes, it is possible. You can write code that uses standard POSIX sockets, so it will be portable between windows and unix-like operating systems. But you'll very likely want to build up some layers of abstraction to make it all easier on yourself, or use an existing library.
As for talking to webservices, you will need some sort of XML/Json/whatever parser. SAX is a good XML parser, and I'm pretty sure there is a C interface for that. But it all depends on the data format.
Put simply, yes. I suppose you likely want more detail than just a "yes", but the question is far too general to garner any much more specific answer.
You mention UDP and even raw sockets, but it's not clear to me why. "Web Services" are typically HTTP, which means they're over TCP.
I think at this point in your learning there are just far too many things for you to learn that it sounds like maybe you just don't even know the questions to ask. Perhaps if you could be more specific about what you're trying to accomplish folks could provide more helpful answers.
If you're using web services, you'll spend more time writing socket code than you will writing code to consume the web services.
If it is SOAP web services, use gSoap (http://www.cs.fsu.edu/~engelen/soap.html). If it is something like REST web services or plain data exchange over an HTTP post without all the SOAP protocol stuff, libcurl (http://curl.haxx.se/) is easy to use too.
Both libraries will work on Windows and Linux.
Maybe you want to try CGI? With it it's possible to create a website in C++, without worrying about sockets.. Your compiled executable will be executed by the web server every time a page is requested, and the output of said executable will be sent to the web browsers.
So you can do stuff like cout << "<html>";
.
[I know that this is not exactly what you asked but your question isn't very clear, and I didn't want to repeat something already said!]
First, I wan't me who made the question unclear and sorry if the question was incomplete ...
Let's then make it more clear. When we have an XML/SOAP message as follow:
...
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
...
</soap:Body>
</soap:Envelope>
and we have got programs that are already written in C/C++ and exchange data through sockets, how can we than use those programs to exchange XML/SOAP messages.
Hope the question is now clear and thanks for your replies