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

C++ and Web Services (OT maybe?)

115 views
Skip to first unread message

Christopher Pisz

unread,
Oct 1, 2014, 4:42:02 PM10/1/14
to
It looks like I can't ignore it any longer. Everyone wants to talk to my
C++ clients using web services. I can no longer just make a socket and
define my own protocol or XML schema. I understand web services are just
REST and SOAP. Where would we start in C++ land without handy IDE code
generators and frameworks those .NET guys have?

Did boost have anything built in that I should look up?

I tried GSoap and failed at it after 3 days of trying. Any others to
look into?




Jorgen Grahn

unread,
Oct 1, 2014, 6:19:18 PM10/1/14
to
On Wed, 2014-10-01, Christopher Pisz wrote:
> It looks like I can't ignore it any longer. Everyone wants to talk to my
> C++ clients using web services.

Out of curiosity, what's a C++ client? Clients normally want to talk
to servers, not the other way around ...

Or a more precise question: what is your code doing, when it attracts
web service people? What area are you working in?

(Personally, I'm waiting for web services to go the way of CORBA ...)

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .

Christopher Pisz

unread,
Oct 1, 2014, 7:45:07 PM10/1/14
to
On 10/1/2014 5:19 PM, Jorgen Grahn wrote:
> On Wed, 2014-10-01, Christopher Pisz wrote:
>> It looks like I can't ignore it any longer. Everyone wants to talk to my
>> C++ clients using web services.
>
> Out of curiosity, what's a C++ client? Clients normally want to talk
> to servers, not the other way around ...

True... Wording. I want to talk to them and so do others.

> Or a more precise question: what is your code doing, when it attracts
> web service people? What area are you working in?

Retrieving data from another system's database. Making two pieces of
software, developed separately, usually using a different technology,
share information. I can't really be more specific than that or the
bosses might get upset :P

Up to now, I've either made my own protocol and handed it to another
company's team and went the way of just making a plain old socket on
some specified port, or relied on flat file exports and the like.

Ian Collins

unread,
Oct 1, 2014, 7:50:38 PM10/1/14
to
Christopher Pisz wrote:
> It looks like I can't ignore it any longer. Everyone wants to talk to my
> C++ clients using web services. I can no longer just make a socket and
> define my own protocol or XML schema. I understand web services are just
> REST and SOAP. Where would we start in C++ land without handy IDE code
> generators and frameworks those .NET guys have?

SOAP is just XML, so all you really need is a decent XML library.

--
Ian Collins

Jorgen Grahn

unread,
Oct 2, 2014, 10:02:11 AM10/2/14
to
On Wed, 2014-10-01, Christopher Pisz wrote:
> On 10/1/2014 5:19 PM, Jorgen Grahn wrote:
>> On Wed, 2014-10-01, Christopher Pisz wrote:
>>> It looks like I can't ignore it any longer. Everyone wants to talk to my
>>> C++ clients using web services.
>>
>> Out of curiosity, what's a C++ client? Clients normally want to talk
>> to servers, not the other way around ...
>
> True... Wording. I want to talk to them and so do others.
>
>> Or a more precise question: what is your code doing, when it attracts
>> web service people? What area are you working in?
>
> Retrieving data from another system's database. Making two pieces of
> software, developed separately, usually using a different technology,
> share information. I can't really be more specific than that or the
> bosses might get upset :P

Understood -- I realized that could be a limitation.

> Up to now, I've either made my own protocol and handed it to another
> company's team and went the way of just making a plain old socket on
> some specified port, or relied on flat file exports and the like.

I've done that too. Although I see it as a partial failure -- IMHO
it's better if you can stick to designing text file formats and do
Unix pipelines, perhaps tunneled over ssh. But that might very well
not be feasible in your environment: it just happenes to often work
in mine.

Mr Flibble

unread,
Oct 2, 2014, 1:44:54 PM10/2/14
to
My C++ XML library "NoFussXML" is the fastest! :)

/Flibble

Richard

unread,
Oct 2, 2014, 5:11:16 PM10/2/14
to
[Please do not mail me a copy of your followup]

Christopher Pisz <nos...@notanaddress.com> spake the secret code
<m0houd$fhr$1...@dont-email.me> thusly:

>It looks like I can't ignore it any longer. Everyone wants to talk to my
>C++ clients using web services. I can no longer just make a socket and
>define my own protocol or XML schema. I understand web services are just
>REST and SOAP. Where would we start in C++ land without handy IDE code
>generators and frameworks those .NET guys have?
>
>Did boost have anything built in that I should look up?

I'm not aware of anything in boost, although there is cpp-netlib that
hopes to fill this void.
<https://github.com/cpp-netlib/cpp-netlib>

>I tried GSoap and failed at it after 3 days of trying. Any others to
>look into?

Yeah, GSoap isn't the greatest thing. I've used it successfully in
the past to talk to WSDL based web services from C++, but I usually
cringed when I looked at the code it generated from the WSDL. For
WSDLs with objects with many (hundreds) of methods, the resulting
library was tens of megabytes, which didn't install confidence in our
team. The one thing GSoap has going for it is that if you need to
talk to a WSDL based service from C++ and the WSDL is reasonably
sized, then it provides a ready-made path for achieving that
objective without writing tons of manual code.

However, most of the world has left WSDL (SOAP) based web services
behind and instead focused more on RESTful APIs. A good, free book
on designing RESTful web services is here:
<http://restfulwebapis.com/rws.html>

If you want to supply a restful API from your C++ based server, then
you might want to look at this stack overflow thread:
<http://stackoverflow.com/questions/15183232/library-for-restful-api-in-c>
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
The Terminals Wiki <http://terminals.classiccmp.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>

woodb...@gmail.com

unread,
Oct 3, 2014, 12:46:48 AM10/3/14
to
Unix pipelines work on binary formats.

I'm thinking of how helpful it is to use compression
to create a binary file out of a bunch of text files.
Why have so many spent so many hours improving the
compression algorithms and associated tools? Bandwidth.
By converting the files to a binary format, you're able
to accomplish the same thing with less bandwidth.


Brian
Ebenezer Enterprises - Shalom.
http://webEbenezer.net

Scott Lurndal

unread,
Oct 3, 2014, 9:40:53 AM10/3/14
to
No. Unix pipelines transfer formless streams of bytes.

>
>I'm thinking of how helpful it is to use compression
>to create a binary file out of a bunch of text files.
>Why have so many spent so many hours improving the
>compression algorithms and associated tools? Bandwidth.
>By converting the files to a binary format, you're able
>to accomplish the same thing with less bandwidth.

Not necessarily. Not even generally.

Consider the case of a numeric field. The uncompressed
text representation of a zero value would consume a single
byte, whereas a binary version may consume four bytes
(depending on the desired magnitude of the value in the
binary stream). When the binary values exceed a fundamental
unit in length (e.g. an 8-bit byte), then the algorithms
at both ends must be aware of the endianess of the binary
stream and convert to the endianess of the host platform.

woodb...@gmail.com

unread,
Oct 6, 2014, 12:09:09 PM10/6/14
to
A binary version may just need one byte if
you're using a variable-length integer format.

I think games that have a lot of numeric data usually
use a binary format to communicate.


Brian
Ebenezer Enterprises - In G-d we trust.
http://webEbenezer.net

Christopher Pisz

unread,
Oct 6, 2014, 3:45:59 PM10/6/14
to
I've got a REST architecture in. It really isn't the best for relational
data, I am finding, because you have to make so many calls to first get
the data that tells you what other data you might be interested in. The
SOAP based ones seem better in that regard in that there is usually some
method with an argument list which could be a collection of foreign
keys, rather than a URL that ends up having a parameter list 1000s of
arguments long.

But it ends up, I have to support almost any feasable way someone would
want to give me data. So, I need Rest and Soap.

I did find Microsoft evidently created a native C++ web services library
and it was super easy to use and very clean compared to Gsoap, but there
seems to be issues with getting it from them for pre windows 7 machines.




0 new messages