Search code examples
c++cxmlxsdgsoap

XSD scheme syntax and gSoap


I have a question, is this XSD syntax valid? Because when I use gSOAP, it pruduces me warnings because it creates struct (C/C++ code), which consists two other structs with the same name (name C), and then when I try to compile that code in c/c++ compiler it prodeces errors (because of the struct with the same name inside one struct). Is here any possibility how to solve this without touching the XSD file?

<complexType name="A">
<choice>
<sequence>
<element name="B" type="base64Binary"/>
<element name="C" type="base64Binary" minOccurs="0"/>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<sequence>
<element name="C" type="base64Binary"/>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</choice>
</complexType>

in gSOAP I create it using: wsdl2h.exe -oSoap.h -s -y -c a.wsdl b.wsdl ... and

soapcpp2.exe -C -L -n -x -w -c -d.\source Soap.h


Solution

  • Yes, it's valid XSD syntax; it just looks like a case that your code generator isn't able to handle.