4

I use gSOAP for XML data binding.

Recently I refactored my XSD files by extracting a common part from two files to a separate third file and then imported it in the first two files. This was a deep and complex element that was refactored out.

In actual code I would like to have a single function that takes an object of gSOAP generated type describing that element and constructs some internal objects.

But for this I would need to have that generated class be stable and same for both final XSD files (so that the function can take a single type). Yet I don't see any way to achieve that.

Is there any solution?


I considered making the function a template based on the fact, that even if generated types are different (in particular because of being in different C++ namespaces) they have the same members and so template should work well. But that requires me to expose implementation which I don't want to do (it is complex correspondingly to the element complexity).


Another approach I tried was to force gSOAP to generated code for both primary XSD files into same C++ namespace so that the code generated for the imported XSD will be considered same. But this leads to link issues since the definitions repeat then.

Adam Badura
  • 5,069
  • 1
  • 35
  • 70
  • Earlier I asked the question also on gSOAP Yahoo Group (http://tech.groups.yahoo.com/group/gsoap/message/19266) but due to apparent little activity I decided to repeat it here. – Adam Badura May 17 '13 at 08:03
  • A somewhat similar question: http://stackoverflow.com/questions/12433719/gsoap-shared-data-types-between-interfaces (with no answers so far!). Maybe in gSOAP internals it is exactly same thing. But since externally use cases differ I decided to ask anyway. – Adam Badura May 17 '13 at 08:04

0 Answers0