How to compile multiple gsoap client web services into one executable?

I use gSOAP for web services, but I have a problem, I have to compile 2 web services into one executable, and some functions have the same name instead of the argument to use a different prefix for function names.

Compilation Error:

 Xo: In function `soap_get_string(soap*, char**, char const*, char const*)': X.cpp:8669: multiple definition of `soap_get_string(soap*, char**, char const*, char const*)' Yo:Y.cpp:4763: first defined here 

In the Makefile:

 wsdl2h -qlpr X.wsdl wsdl2h Y.wsdl Y.xsd soapcpp2 -qlpr -plpr -plprws $(GSOAP_IMPORT) -i -C Xh soapcpp2 -psiwcprws $(GSOAP_IMPORT) -i -C Yh 

Does anyone have any ideas how to solve this?

+4
source share
1 answer

19.34 How to combine several client and server implementations into one executable file You can use the wsdl2h tool to import several WSDLs and schemes at once. Service definitions are combined into a single header file, which will be parsed using soapcpp2. It is important to assign namespace prefixes to the namespace URI using the typemap.dat file. Otherwise, wsdl2h will assign namespace prefixes ns1, ns2, etc. to service functions and circuit types. Thus, any change to the WSDL or schema may result in a new prefix assignment. More details, see section 8.2. Another approach to combining multiple clients and service applications into a single executable file is to use C ++ namespaces to structurally separate definitions or by creating a C library for client / server objects, as explained in the following sections. This is automated with the wsdl2h -q option. Both approaches are demonstrated by an example in the gSOAP distribution, samples / link (C) and examples / link ++ (C ++ with C ++ namespaces).

+6
source

Source: https://habr.com/ru/post/1388471/


All Articles