Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Calling a web service from MFC

731 views
Skip to first unread message

Eddie Paz

unread,
Jun 23, 2010, 3:20:16 AM6/23/10
to
Hi fellows,

How do I call a web service from an MFC application? This is something I'd
like to do without bringing .NET into the picture, if possible.

Thanks in advanced for any pointers.

Goran

unread,
Jun 23, 2010, 3:55:56 AM6/23/10
to

I don't know of WebServices library for MFC specifically, but I think
that Apache Axis has C++ implementation.

BTW, it's a strange demand, that, not to bring .NET in. It's simple
with .NET, so why are you making your life complicated?

Finally, I don't know your context, but I'd consider writing a COM
server (probably an *.exe) in .NET, that would call out from the web
service. That way, you can have an easy interface on MFC side (you
define what that is), easy life on the WebService client side, and if
you go with the *.exe, a good process isolation. But the price is a
more complicated executable module structure; 2 modules instead of 1).

Goran.

Giovanni Dicanio

unread,
Jun 23, 2010, 4:29:24 AM6/23/10
to

On 23/06/2010 09:20, Eddie Paz wrote:

> How do I call a web service from an MFC application? This is something
> I'd like to do without bringing .NET into the picture, if possible.

There is a C library called WWSAPI (Windows Web Services API):

http://msdn.microsoft.com/en-us/library/dd430435(VS.85).aspx

You can find an interesting article here:

http://msdn.microsoft.com/en-us/magazine/ee335693.aspx

The problem is that it is complicated (and expensive...) to get the
WWSAPI binaries for Windows XP (instead, this API is included in Win7).

As an alternative, there is the open-source gSOAP:

http://www.cs.fsu.edu/~engelen/soap.html


HTH,
Giovanni

Bogdan Jokel

unread,
Jun 23, 2010, 8:47:16 AM6/23/10
to
The simples method might be to use sproxy.exe that comes with
ATLServerLibrary. It generates all the necessary code for you - just point
it to a WSDL or a given Web service URL.
VS2003 (and possibly 2005) had it built in. ATLServerLibrary is no longer
packaged with VS so you need to download it separately.

sproxy generates a C++ class whose methods map one-to-one to methods of a
service at a given URL. It can't be simpler that this.

Hope this helps.

"Eddie Paz" <drp...@hotmail.com> wrote in message
news:374F57A8-EFB9-4A47...@microsoft.com...

bharath_r

unread,
Jun 23, 2010, 11:07:38 AM6/23/10
to

You can use the WinHTTP library to call webservices from MFC
application.
http://msdn.microsoft.com/en-us/library/aa384081

Cholo Lennon

unread,
Jun 23, 2010, 9:52:02 PM6/23/10
to

As Giovanni has told you I would recommend you gSoap. AFAIK is the most
used C/C++ web service library. I use it at work with a great level of
satisfaction.

http://gsoap2.sourceforge.net/

Regards

--
Cholo Lennon
Bs.As.
ARG

Eddie Paz

unread,
Jun 23, 2010, 11:42:55 PM6/23/10
to

Goran" <goran...@gmail.com> wrote in message
news:07cff30e-5f8b-411b...@d8g2000yqf.googlegroups.com...

Thanks for the info. I realize that this would be easy in .NET. VC.NET will
make it even easier, but we currently don't have support from the network
guys to deploy .NET to 500+ PCs -- we still run Windows 2000 clients, and we
use Netware/Zen for Updates. It's not pretty, but we got to work with it.

I'll check out Axis and see it'll work for us. Thanks!

Eddie.

Eddie Paz

unread,
Jun 23, 2010, 11:47:15 PM6/23/10
to
"Giovanni Dicanio" <giovanniD...@REMOVEMEgmail.com> wrote in message
news:uavk04qE...@TK2MSFTNGP05.phx.gbl...

Thanks for the links, Giovanni. The WWSAPI looks good, but unfortunately our
clients are Windows 2000. gSOAP looks just like what I need, but I don't
much about the OS license. The software is for internal use of the
company... I don't know if that makes it commercial. I'll check with them
but definitely looks promising. Thanks!

Eddie.

Eddie Paz

unread,
Jun 23, 2010, 11:55:39 PM6/23/10
to
"Bogdan Jokel" <bjo...@company.com> wrote in message
news:OOqD$ItELH...@TK2MSFTNGP06.phx.gbl...

Nice. I found it in VS2005, which is what we use. It seems to be based on
ATL Project, which I believe MS discontinued some time back (they even made
it open source, if I recall correctly).

The web service is written in Java, but returns XML. Hopefully this works
with Java WS. Thanks!

Eddie Paz

unread,
Jun 24, 2010, 12:07:36 AM6/24/10
to
"bharath_r" <bharat...@gmail.com> wrote in message
news:3b7fb4b3-8fa2-4ad7...@j8g2000yqd.googlegroups.com...

I must admit I don't know much about web services, but I can't find anything
on the site about how to do it with this API. Do you have a link you can
share?

Eddie Paz

unread,
Jun 24, 2010, 12:09:13 AM6/24/10
to

"Cholo Lennon" <cholo...@hotmail.com> wrote in message
news:OcC4Y$zELHA...@TK2MSFTNGP05.phx.gbl...

It definitely looks like this is the one. Thank you all for the help!

Eddie.

0 new messages