0

I've to consume a wsdl which uses polymorphism, in c code to make GSOAP calls. As per GSOAP documentation (8.2 Customizing Data Bindings With The typemap.dat File), it requires modification in typemap.dat, which is redeclaration of the base type as a wrapper type. Since, I just want to change the usage so I used elipsis (...) in the declaration section as suggested in the documentation, but wsdl2h doesn't seems to comprehend the elipsis and placing them as it is in the output header file, which is causing syntax errors during code build.

Addition done in typemap.dat for polymorphic binding:

[ 
struct __ns__PolymorphicStruct
{ 
   int __type;
   void *__item;
   struct ns__PolymorphicStruct *__self; 
};
]
ns__PolymorphicStruct = ... | struct __ns__PolymorphicStruct | struct __ns__PolymorphicStruct

Could anyone please help or point out if I'm doing something wrong here?

1 Answers1

0

The ellipsis is meant to represent the wsdl2-generated definition of ns__PolymorphicStruct, so in your case you will end up with two declarations.

Use:

[ 
struct __ns__PolymorphicStruct
{ 
   int __type;
   void *__item;
   struct ns__PolymorphicStruct *__self; 
};
]
ns__PolymorphicStruct = | struct __ns__PolymorphicStruct | struct __ns__PolymorphicStruct

or use the following (the placement of the overriding declaration of ns__PolymorphicStruct will change though):

ns__PolymorphicStruct = \ 
struct __ns__PolymorphicStruct\
{\
   int __type;\
   void *__item;\
   struct ns__PolymorphicStruct *__self;\
};\
| struct __ns__PolymorphicStruct | struct __ns__PolymorphicStruct

where \ is used to allow the declaration to continue onto the next line.

Dr. Alex RE
  • 1,772
  • 1
  • 15
  • 23