Recently I've inherited some code that has used gsoap for some time, and
up until now has been using an old distribution ... 2.7.6b.    I wanted
to upgrade that to a new version,  2.7.12.

A couple of problems have surfaced (one solved with -z, and one minor
one related to brace generation and gcc warnings).

However, I'm a bit stuck on one, and I'd be glad for some help.

It is to do with mapping of sequences.  In my case, I will simplify to
the following types (PermissionType and PermissionsType):

       <xsd:complexType name="PermissionType">
        <xsd:sequence minOccurs="0" maxOccurs="unbounded">
         <xsd:element name="Code" type="xsd:string"/>
         <xsd:element name="Description" type="xsd:string"/>
        </xsd:sequence>
       </xsd:complexType>

       <xsd:complexType name="PermissionsType">
        <xsd:sequence>
         <xsd:element name="Permission" type="mds:PermissionType"
minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
       </xsd:complexType>

On the older gsoap, after wsdl2h and soapcpp, the following is generated
in mdsSoapStub.h (I've removed stuff I don't think is relevant):
/* mds:PermissionType */
class SOAP_CMAC mds__PermissionType
{
public:
         std::string Code;
         std::string Description;
         struct soap *soap;

         <SNIP>
};
/* mds:PermissionsType */
class SOAP_CMAC mds__PermissionsType
{
public:
         std::vector<mds__PermissionType * >Permission;
         struct soap *soap;

         <SNIP>
};
Notice that there doesn't seem to be any sequence implementation for
PermissionType.  How did this code ever work?  I guess it must work, as
the service seems to function fine right now.  Maybe the generated cpp
stubs did something magical?

gsoap 2.7.12 generates:
class SOAP_CMAC mds__PermissionType
{
public:
         int __size_PermissionType_sequence;
         __mds__PermissionType_sequence *__PermissionType_sequence;
         struct soap *soap;

         <SNIP>
};

/* mds:PermissionsType */
class SOAP_CMAC mds__PermissionsType
{
public:
         std::vector<mds__PermissionType * >Permission;
         struct soap *soap;

         <SNIP>
};
Which looks much more reasonable.

The problem is that the existing code depends on the old generation
behaviour.  Are there any flags that can make the newer gsoaps generate
the older style of cold?

Is the old code actually working?  Is there some subtle bug hiding in
the current implementation?  If not, any ideas on mapping to the new
generated code style?

TIA

Reply via email to