Sharing generated code for shared imported XSD files
Asked Answered
L

0

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.

Landed answered 17/5, 2013 at 8:1 Comment(2)
Earlier I asked the question also on gSOAP Yahoo Group (tech.groups.yahoo.com/group/gsoap/message/19266) but due to apparent little activity I decided to repeat it here.Landed
A somewhat similar question: #12434219 (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.Landed

© 2022 - 2024 — McMap. All rights reserved.