I'm trying to implement two windows services that each one implements is own gSoap interface, and both are clients and servers of each interface. So my problem is that i use the same data type in both interfaces (class with members) and generate the c++ code with the soapcpp2.exe -q option that will create two different namespaces, this is fine and it works, but the problem is that the data type that should be equal in both interfaces are now different due to the namespace separation, but if i remove the namespaces i will have conflicts because the shared data type have the same name in both interfaces.
«Problem:
interface 1:
---
>class xsd__Address
{
char *email;
char *url;
};
>int ns1__getAddress(xsd__Address& ret);
---
interface 2:
---
>class xsd__Address
{
char *email;
char *url;
};
>int ns2__setAddress(xsd__Address& ret);
---
after the definition of each header i compile it with soapcpp2.exe something like:
soapcpp2.exe -qintf1 -n xxxx //for interface 1
soapcpp2.exe -qintf2 -n xxxx //for interface 2
so when in my project that uses both interfaces (interface 1 and interface 2) when i need something like this:
intf1::Interface1 int1;
int1.endpoint="xxx";
intf1::ns__Address address;
int1.ns1__getAddress(address);
intf2::Interface1 int2;
int2.endpoint="xxx";
int2.ns2_setAddress(address); //this don't compile like i was expecting because to the compiler they are not the same object (and it is wright...)
Questions:
Is possible to have shared data types between two or more interfaces? Yes? how this is accomplished?
If not what is the best solution to implement this?