I looked through the samples in gSOAP and the rest example defines a WSDL and then generates code for the client and server applications. Is there a way to implement a RESTful service using gSOAP without defining a WSDL?
When i try to compile the example below i get the following error
"/usr/local/lib/libgsoap++.a(libgsoap___a-stdsoap2_cpp.o): In function soap_set_error':
/home/mtwells/Downloads/gsoap-2.8/gsoap/stdsoap2_cpp.cpp:17314: undefined reference to
soap_faultcode'"
because it is looking for the generated code using wsdl2h.
1 #include "plugin/httpget.h"
2
3
4 int main(int argc, char **argv)
5 {
6 struct soap *soap = soap_new();
7
8 soap_destroy(soap);
9 soap_end(soap);
10 soap_free(soap);
11 return 0;
12 }
https://www.cs.fsu.edu/~engelen/soapdoc2.html#tth_sEc19.38.2
The gSOAP soapcpp2 compiler can also generate WSDL definitions for implementing a service from scratch, i.e. "without defining a WSDL first." This "closes the loop" in that it enables Web services development directly from a set op C/C++ operations in a header file without the need for users to analyze Web service details.
According to the gSOAP manual 1.2, the gSOAP soapcpp2 compiler can generate the required client and server applications just on the basis of the header files. This means that then you would then have to write the header files all by yourself and feed it to the soapcpp2 compiler which will not only generate the service/ client applications but also generate the missing wsdl file for you if you include it in the option! In this case you do not need the wsdl2h tool.
Regards