You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by su...@opensource.lk on 2004/08/13 13:17:31 UTC

RE: [Including non existant headers]Skeletons and stubs are generating for inquire_v2.wsdl - Trying to fix [FYI]

Hi,

I am working on the below mentioned issue. But when I generated the code
for InteropBase.wsdl I find the generated code is not correct. The
generated code will compile run fine if both client and server are Axis
C++. But not interoperable. Because the SOAP message do not correspond to
the WSDL.

Following is the problem,

In

int Axis_Serialize_SOAPStruct(SOAPStruct* param, IWrapperSoapSerializer*
pSZ, bool bArray = false) Function following 3 lines are generated in a
wrong way.


pSZ->serializeAsElement("SOAPStruct_varString",
(void*)&(param->SOAPStruct_varString), XSD_STRING);
pSZ->serializeAsElement("SOAPStruct_varInt",
(void*)&(param->SOAPStruct_varInt), XSD_INT);
pSZ->serializeAsElement("SOAPStruct_varFloat",
(void*)&(param->SOAPStruct_varFloat), XSD_FLOAT);

In order to have correct SOAP message these should be,

pSZ->serializeAsElement("varString",
(void*)&(param->SOAPStruct_varString), XSD_STRING);
pSZ->serializeAsElement("varInt", (void*)&(param->SOAPStruct_varInt),
XSD_INT);
pSZ->serializeAsElement("varFloat", (void*)&(param->SOAPStruct_varFloat),
XSD_FLOAT);

This is not a problem for RPC style wsdls. But for doc/lit this problem
causes interoperability.

My guess is that this has been caused by the improvement of WSDL2Ws tool
to handle the "operator" keyword recently.

Could the developer who did the changes look into this and correct this
ASAP so that the 1.3 Alpha can have the corrections.

Thanks,

Susantha

> -----Original Message-----
> From: Samisa Abeysinghe [mailto:samisa_abeysinghe@yahoo.com]
> Sent: Thursday, August 12, 2004 1:26 PM
> To: Apache AXIS C Developers List
> Subject: RE: [Including non existant headers]Skeletons and stubs are
> generating for inquire_v2.wsdl - Trying to fix [FYI]
>
> Cool!!! Thanks for helping Susantha.
>
> So I do not have to commit my *ugly* fix :-)
>
> Samisa...
>
>
> --- Susantha Kumara <su...@opensource.lk> wrote:
>
> > Hi Samisa,
> >
> > I see there are 2 problems you have come across.
> >
> > 1. Inclusion of non-existent headers + Refering to non-existent array
> > types.	My opinion to solve this problem is to generate a typedef for
> an
> > array for each xsd:simpleType in the same place where a typedef for that
> > simpleType is generated.
> > 	Ex:
> > 	<xsd:simpleType name="tModelKey">
> > 		<xsd:restriction base="string"/>
> > 	</xsd:simpleType>
> >
> > 	The generated tModelKey.h has
> > 	typedef xsd__string tModelKey;
> >
> > 	we have to generate a typedef for an array in the next line so
> > that tModelKey.h contain,
> > 	typedef xsd__string tModelKey;
> > 	typedef xsd__string_Array tModelKey_Array;
> >
> > 2. Types with no data members
> > 	This is because
> > 	a. The complexTypes with xsd:simpleContent is not supported
> > correctly.
> > 	b. The WSDL2Ws tool does not understand the reserved prefix
> > 'xml' and the types defined in xml namespace
> > (http://www.w3.org/XML/1998/namespace.html)
> >
> > 	Ex1: See following complexType
> >
> > 	<xsd:complexType name="email">
> > 		<xsd:simpleContent>
> > 			<xsd:extension base="string">
> > 				<xsd:attribute name="useType"
> > type="string" use="optional"/>
> > 			</xsd:extension>
> > 		</xsd:simpleContent>
> > 	</xsd:complexType>
> >
> > But email.h created is ,
> >
> > class email
> > {
> > public:
> > 	xsd__string useType;
> > 	email();
> > 	~email();
> > };
> >
> > But this should be,
> >
> > class email
> > {
> > public:
> > 	xsd__string _email;
> > 	xsd__string useType;
> > 	email();
> > 	~email();
> > };
> >
> > 	Ex2: If we see the complexType
> >
> > 	<xsd:complexType name="name">
> > 		<xsd:simpleContent>
> > 			<xsd:extension base="string">
> > 				<xsd:attribute ref="xml:lang"
> > use="optional"/>
> > 			</xsd:extension>
> > 		</xsd:simpleContent>
> > 	</xsd:complexType>
> >
> > The generated type looks
> >
> > class name
> > {
> > public:
> > 	name();
> > 	~name();
> > };
> >
> > but should be like,
> >
> > class name
> > {
> > public:
> > 	xsd__string _name;
> > 	name();
> > 	~name();
> > };
> >
> > So I am having a look at the WSDL2Ws code and try to fix it ASAP.
> >
> > Susantha,
> >
> > > -----Original Message-----
> > > From: Samisa Abeysinghe [mailto:samisa_abeysinghe@yahoo.com]
> > > Sent: Thursday, August 12, 2004 7:21 AM
> > > To: Apache AXIS C Developers List
> > > Subject: Re: [Including non existant headers]Skeletons and stubs are
> > > generating for inquire_v2.wsdl
> > >
> > > Does anyone have any thoughts on this? Please...
> > > Samisa...
> > >
> > > --- Samisa Abeysinghe <sa...@yahoo.com> wrote:
> > >
> > > > Hi All,
> > > >     I managed to fix the inclusion of non existant problem with a
> > *very*
> > > ugly fix :-(
> > > >
> > > >     What I did was to generate a dummy header file so that the
> > compiler
> > > would not complain.
> > > >     The real fix would have been to remove the inclution of a header
> > > that reffers to an array of
> > > > simple type. However, because the tool already generate some headers
> > for
> > > simple types and
> > > > include
> > > > them here and there, it is time consuming to remove it all together
> > (I
> > > infact tried removing
> > > > referances to invalid headers, in the process ran into more
> > problems)
> > > >     The tool already generates some dummy headers when the type is
> > > string (this is without my
> > > > fix). (And you get classes with no data members)
> > > >
> > > > e.g.
> > > > description.h had:
> > > > class description
> > > > {
> > > > public:
> > > >         description();
> > > >         ~description();
> > > > };
> > > > description_Array.h had:
> > > > typedef struct description_ArrayTag
> > > > {
> > > >         description* m_Array;
> > > >         int m_Size;
> > > > } description_Array;
> > > >
> > > > The tModelKey. had:
> > > > typedef xsd__string tModelKey;
> > > >
> > > > Those were being generated prior to the hack.
> > > >
> > > > So I generated:
> > > > typedef struct tModelKey_ArrayTag
> > > > {
> > > >         xsd__string* m_Array;
> > > >         int m_Size;
> > > > } tModelKey_Array;
> > > >
> > > > This make the header file problem go away. However, as this is not
> > the
> > > correct way to fix it, I
> > > > did not commit it.
> > > >
> > > > Fixing this properly would mean to restructure/refactor the tool
> > which
> > > would take up some time.
> > > > Hence if the community is OK with this fix for the time being I
> > could
> > > commit it, so that those
> > > > who
> > > > are interested could try out complex WSDL files such as this UDDI
> > WSDL.
> > > > (because there could be other unseen problems that could be revealed
> > > once we actually run the
> > > > client/service and test. Up to now I was stuck with code generation
> > and
> > > compilation.)
> > > >
> > > > Any thoughts? Please...
> > > >
> > > > Thanks,
> > > > Samisa...
> > > >
> > > > --- Samisa Abeysinghe <sa...@yahoo.com> wrote:
> > > >
> > > > > Hi All,
> > > > >    In the ClientStubWriter class of the WDL2Ws tool I see a
> > funtion
> > > named 'itoa' being hard
> > > > > coded.
> > > > >
> > > > >
> > >
> > src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java:
> > 29
> > > 3:
> > > >
> > > > >
> > > > >              writer.write("\t\titoa( Value"+i+", buffer, 10);\n");
> > > > >
> > > > >    Please note that there is no 'itoa' on Linux/Unix platforms
> > (onlt
> >
> === message truncated ===
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - 100MB free storage!
> http://promotions.yahoo.com/new_mail


RE: [Including non existant headers]Skeletons and stubs are generating for inquire_v2.wsdl - Trying to fix [FYI]

Posted by Samisa Abeysinghe <sa...@yahoo.com>.
This was not part of fixing 'operator' keyword problem, rhather fixing the handling of ANON_TOKEN
problem.

I used the same logic as Axis Java, assuming that to be correct.
Testing revealed prolems and I have reported them in
http://marc.theaimsgroup.com/?l=axis-c-dev&m=109228604029908&w=2


Nithya has reported that she has fixed it already.

Samisa...

--- susantha@opensource.lk wrote:

> Hi,
> 
> I am working on the below mentioned issue. But when I generated the code
> for InteropBase.wsdl I find the generated code is not correct. The
> generated code will compile run fine if both client and server are Axis
> C++. But not interoperable. Because the SOAP message do not correspond to
> the WSDL.
> 
> Following is the problem,
> 
> In
> 
> int Axis_Serialize_SOAPStruct(SOAPStruct* param, IWrapperSoapSerializer*
> pSZ, bool bArray = false) Function following 3 lines are generated in a
> wrong way.
> 
> 
> pSZ->serializeAsElement("SOAPStruct_varString",
> (void*)&(param->SOAPStruct_varString), XSD_STRING);
> pSZ->serializeAsElement("SOAPStruct_varInt",
> (void*)&(param->SOAPStruct_varInt), XSD_INT);
> pSZ->serializeAsElement("SOAPStruct_varFloat",
> (void*)&(param->SOAPStruct_varFloat), XSD_FLOAT);
> 
> In order to have correct SOAP message these should be,
> 
> pSZ->serializeAsElement("varString",
> (void*)&(param->SOAPStruct_varString), XSD_STRING);
> pSZ->serializeAsElement("varInt", (void*)&(param->SOAPStruct_varInt),
> XSD_INT);
> pSZ->serializeAsElement("varFloat", (void*)&(param->SOAPStruct_varFloat),
> XSD_FLOAT);
> 
> This is not a problem for RPC style wsdls. But for doc/lit this problem
> causes interoperability.
> 
> My guess is that this has been caused by the improvement of WSDL2Ws tool
> to handle the "operator" keyword recently.
> 
> Could the developer who did the changes look into this and correct this
> ASAP so that the 1.3 Alpha can have the corrections.
> 
> Thanks,
> 
> Susantha
> 
> > -----Original Message-----
> > From: Samisa Abeysinghe [mailto:samisa_abeysinghe@yahoo.com]
> > Sent: Thursday, August 12, 2004 1:26 PM
> > To: Apache AXIS C Developers List
> > Subject: RE: [Including non existant headers]Skeletons and stubs are
> > generating for inquire_v2.wsdl - Trying to fix [FYI]
> >
> > Cool!!! Thanks for helping Susantha.
> >
> > So I do not have to commit my *ugly* fix :-)
> >
> > Samisa...
> >
> >
> > --- Susantha Kumara <su...@opensource.lk> wrote:
> >
> > > Hi Samisa,
> > >
> > > I see there are 2 problems you have come across.
> > >
> > > 1. Inclusion of non-existent headers + Refering to non-existent array
> > > types.	My opinion to solve this problem is to generate a typedef for
> > an
> > > array for each xsd:simpleType in the same place where a typedef for that
> > > simpleType is generated.
> > > 	Ex:
> > > 	<xsd:simpleType name="tModelKey">
> > > 		<xsd:restriction base="string"/>
> > > 	</xsd:simpleType>
> > >
> > > 	The generated tModelKey.h has
> > > 	typedef xsd__string tModelKey;
> > >
> > > 	we have to generate a typedef for an array in the next line so
> > > that tModelKey.h contain,
> > > 	typedef xsd__string tModelKey;
> > > 	typedef xsd__string_Array tModelKey_Array;
> > >
> > > 2. Types with no data members
> > > 	This is because
> > > 	a. The complexTypes with xsd:simpleContent is not supported
> > > correctly.
> > > 	b. The WSDL2Ws tool does not understand the reserved prefix
> > > 'xml' and the types defined in xml namespace
> > > (http://www.w3.org/XML/1998/namespace.html)
> > >
> > > 	Ex1: See following complexType
> > >
> > > 	<xsd:complexType name="email">
> > > 		<xsd:simpleContent>
> > > 			<xsd:extension base="string">
> > > 				<xsd:attribute name="useType"
> > > type="string" use="optional"/>
> > > 			</xsd:extension>
> > > 		</xsd:simpleContent>
> > > 	</xsd:complexType>
> > >
> > > But email.h created is ,
> > >
> > > class email
> > > {
> > > public:
> > > 	xsd__string useType;
> > > 	email();
> > > 	~email();
> > > };
> > >
> > > But this should be,
> > >
> > > class email
> > > {
> > > public:
> > > 	xsd__string _email;
> > > 	xsd__string useType;
> > > 	email();
> > > 	~email();
> > > };
> > >
> > > 	Ex2: If we see the complexType
> > >
> > > 	<xsd:complexType name="name">
> > > 		<xsd:simpleContent>
> > > 			<xsd:extension base="string">
> > > 				<xsd:attribute ref="xml:lang"
> > > use="optional"/>
> > > 			</xsd:extension>
> > > 		</xsd:simpleContent>
> > > 	</xsd:complexType>
> > >
> > > The generated type looks
> > >
> > > class name
> > > {
> > > public:
> > > 	name();
> > > 	~name();
> > > };
> > >
> > > but should be like,
> > >
> > > class name
> > > {
> > > public:
> > > 	xsd__string _name;
> > > 	name();
> > > 	~name();
> > > };
> > >
> > > So I am having a look at the WSDL2Ws code and try to fix it ASAP.
> > >
> > > Susantha,
> > >
> > > > -----Original Message-----
> > > > From: Samisa Abeysinghe [mailto:samisa_abeysinghe@yahoo.com]
> > > > Sent: Thursday, August 12, 2004 7:21 AM
> > > > To: Apache AXIS C Developers List
> > > > Subject: Re: [Including non existant headers]Skeletons and stubs are
> > > > generating for inquire_v2.wsdl
> > > >
> > > > Does anyone have any thoughts on this? Please...
> > > > Samisa...
> > > >
> > > > --- Samisa Abeysinghe <sa...@yahoo.com> wrote:
> > > >
> > > > > Hi All,
> > > > >     I managed to fix the inclusion of non existant problem with a
> > > *very*
> > > > ugly fix :-(
> > > > >
> > > > >     What I did was to generate a dummy header file so that the
> > > compiler
> > > > would not complain.
> > > > >     The real fix would have been to remove the inclution of a header
> > > > that reffers to an array of
> > > > > simple type. However, because the tool already generate some headers
> > > for
> > > > simple types and
> > > > > include
> > > > > them here and there, it is time consuming to remove it all together
> > > (I
> > > > infact tried removing
> > > > > referances to invalid headers, in the process ran into more
> > > problems)
> > > > >     The tool already generates some dummy headers when the type is
> > > > string (this is without my
> > > > > fix). (And you get classes with no data members)
> > > > >
> > > > > e.g.
> > > > > description.h had:
> > > > > class description
> > > > > {
> > > > > public:
> > > > >         description();
> > > > >         ~description();
> > > > > };
> 
=== message truncated ===



		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail