-1

I use a C++ app to synchronyze data between two PHP servers.

My first server is local, my C++ app call a webservice on that server to get an object to synchronyze. Then, my C++ app use another webservice to send it on my Cloud PHP server.

So my Object is a soap object defined strictly identically on my two php server.

However, for my C++ apps, these two object are not the same (or at least with a different namespace), so Y can't compile the following line:

soapErrorCode = cloudWebService.action(myLocalObject);
//C++ is waiting for an object of type myCloudObject, even if these two object have the same attributes

My soap objects and Webservice definition are defined in my C++ with help of gSoap.

I see different solution, but not sure which is the best:

  1. Is there a way to tell to C++ that myLocalObject and myCloudObject are the same? Note: I don't want manually modify the code generated by gsoap (too much work!).
  2. Is there a way to tell to gsoap that myLocalObject and myCloudObject are the same?
  3. Am I obliged to create fonction to convert myLocalObject to myCloudObject?

Thanks!

cyanat
  • 77
  • 7

1 Answers1

1

In my opinion two possible variants are:

  1. Write converter function from myLocalObject to myCloudObject and from from myCloudObject to myLocalObject
  2. You can make a base class for myLocalObject and myCloudObject and work through its pointer.
Jarod42
  • 203,559
  • 14
  • 181
  • 302
  • Ok, I will go on the converter function. It adds lot of code but easy code, so it's better than modifying code generated by gsoap. – cyanat May 17 '18 at 08:27