Itzhak Hasson
Itzhak Hasson

Reputation: 67

gsoap latest version generates different code than the version we use

We are upgrading our gsoap version from 2.7.8 to the latest version 2.8.33

When our make file runs soapcpp2.exe and wsdl2h.exe with the exact same flags, I don't get the exact same classes and API, so I figured I'll have to tweak them a little bit.

We used to run soapcpp2.exe with these flags: -C -L -x -I

The first noticeable change was classes inheriting from structs soap rather than pointing to them. I was able to solve this compatibility issue by adding -j.

Now, I am encountering another incompatibility where a function

SOAP_FMAC5 int SOAP_FMAC6 soap_serve_request(struct soap *soap)

is absent.

I searched the gsoap code and found it, so I guess there's some way to make gsoap to generate it. Is there really a way to make gsoap generate this function, or will I have to adjust my code/ write the function myself

Upvotes: 0

Views: 2274

Answers (1)

Dr. Alex RE
Dr. Alex RE

Reputation: 1698

The gsoap tools have options to support backward compatibility. Run soapcpp2 -h to see your options:

Usage: soapcpp2 [-0|-1|-2] [-C|-S] [-T] [-Ecdt] [-L] [-a] [-A] [-b] [-c|-c++|-c++11] [-d path] [-e] [-f N] [-h] [-i] [-I path:path:...] [-l] [-m] [-n] [-p name] [-Q name] [-q name] [-r] [-s] [-t] [-u] [-v] [-w] [-x] [-y] [-z#] [infile]
...
...
-z1 compatibility: generate old-style C++ service proxies and objects
-z2 compatibility with 2.7.x: omit XML output for NULL pointers
-z3 compatibility with 2.8.30 and earlier: _param_N is indexed globally

Try -z1.

PS. The old proxy and service classes with option -z1 are more simplistic, the new classes generated with option -j are an improvement. But when you're generating service classes with -j the C-like API with global functions are gone (a good thing IMO).

Upvotes: 1

Related Questions