Consuming a Webservice from C/C++

C, C++, Visual C++, C++.Net Topics
Post Reply
User avatar
Enigma
Lieutenant
Lieutenant
Posts: 74
Joined: Sun Jan 16, 2011 12:40 am
Location: Colombo, Sri Lanka

Consuming a Webservice from C/C++

Post by Enigma » Sun May 29, 2011 5:55 pm

Hi,

Today web services are not new things. Lots of good examples are there in the internet which teaches us on how to consume a web service. But most of them are using .net, java or php for this. So today I tried to consume a web service using C language. If you know the SOAP messaging format, then it’s just another socket application. I used web service which is located in the http://www.w3schools.com/webservices/tempconvert.asmx . Program uses HTTP POST to call the web service method. In the package there are two projects which can be loaded from VS2010 and Dev-Cplus. For Dev-plus, you might have to link the “ws2_32.lib” from the project options. I know there are lots of very easy methods to consume web services from other languages. But I did this for fun :D . If you really want to use C, then you will have to use a XML parser library. I think with little changes this can be run in linux as well. Hope this will help you. :mrgreen:

These are the reference that I have used for this
http://www.jmarshall.com/easy/http/ - A good tutorial on HTTP
SoapInC.zip
(919.75 KiB) Downloaded 509 times
Last edited by Neo on Mon May 30, 2011 10:47 am, edited 2 times in total.
Reason: Placed attachment to the post using "Place Inline" button.
User avatar
Nipuna
Moderator
Moderator
Posts: 2729
Joined: Mon Jan 04, 2010 8:02 pm
Location: Deraniyagala,SRI LANKA

Re: Consuming a Webservice from C/C++

Post by Nipuna » Sun May 29, 2011 6:38 pm

I feel this is Great Friend.

But I don't know what is this? ;) I just feel because You do Great works.
User avatar
Enigma
Lieutenant
Lieutenant
Posts: 74
Joined: Sun Jan 16, 2011 12:40 am
Location: Colombo, Sri Lanka

Re: Consuming a Webservice from C/C++

Post by Enigma » Sun May 29, 2011 11:14 pm

Hi
Thanks Nipuna. You can find about it by visiting this URL
http://www.w3schools.com/webservices/tempconvert.asmx
Basically web service can expose functions to the out side world. So you can call them from your programs . You will find about it more when you are learning java. Also in BIT you have a subject that will tech you the SOAP messaging.
User avatar
Nipuna
Moderator
Moderator
Posts: 2729
Joined: Mon Jan 04, 2010 8:02 pm
Location: Deraniyagala,SRI LANKA

Re: Consuming a Webservice from C/C++

Post by Nipuna » Mon May 30, 2011 7:46 am

Cool. :)

Thanks for sharing With Us.
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Consuming a Webservice from C/C++

Post by Neo » Mon May 30, 2011 11:11 am

Enigma

You always being a great resource to our community and we all appreciate it very much. Sharing is the greatest thing in the world but unfortunately there is only few people who could understand it.

We were discussing about increasing the activity on ROBOT.LK. At the moment, very few people get the use of ROBOT.LK. This is an open invitation for you to join our team and work together on that. Our only aim is to provide help for people who are lacking access to knowledge resources mostly in rural areas. So they could also learn and practice technology to advance their day to day life.

We also have a Sinhala forum as you can see on the top. I have put that their to make it more Sri Lankan. I would start Tamil as well when we have a good Tamil speaking support member.

Here is a topic that some of us have discussed on this subject. Best ways to promote ROBOT.LK among local community.

Your ideas and suggestions are very important. Let's work together to take ROBOT.LK to more people.

Again, thanks for being a great member.

BR

Neo
User avatar
Enigma
Lieutenant
Lieutenant
Posts: 74
Joined: Sun Jan 16, 2011 12:40 am
Location: Colombo, Sri Lanka

Re: Consuming a Webservice from C/C++

Post by Enigma » Mon May 30, 2011 4:57 pm

Sharing is the greatest thing in the world but unfortunately there is only few people who could understand it.
Always glad to help Neo. I give my 100% for this. yeah sharing is a great thing. Also that makes a good knowledge flow among us.
Here is a topic that some of us have discussed on this subject. Best ways to promote ROBOT.LK among local community.
Your ideas and suggestions are very important. Let's work together to take ROBOT.LK to more people.
Sure I will post my suggestions and you have my full support for this. Yeh let's work together to take ROBOT.LK to more people.

Enigma
User avatar
Nipuna
Moderator
Moderator
Posts: 2729
Joined: Mon Jan 04, 2010 8:02 pm
Location: Deraniyagala,SRI LANKA

Re: Consuming a Webservice from C/C++

Post by Nipuna » Mon May 30, 2011 5:46 pm

Yes. Enigma Is a Great Person. He Taught Some things of BIT.

He is a Well Suiting Member for EC.
Post Reply

Return to “C/C++ Programming”