> -----Original Message----- > From: Dimuthu Gamage [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 27, 2008 10:03 PM > To: Apache AXIS C User List > Subject: Re: generated C code from choice elements in wsdl > > Looks like i can't send the attachment to the list. > Please check it from here, > http://people.apache.org/~dimuthu/public/case41.zip
Thank you for your quick and thorough reply. > > Note that you have to use either Axis2/Java 1.4 or the latest > snapshot. I had generated the problem code using Axis2/Java 1.4, so I'll try the latest snapshot. I'm having trouble reaching http://cvs.apache.org/dist/axis2/nightly now (connection refused). I'll try again later and report my results. Thanks again, Bob > > Thanks > Dimuthu > > On Wed, May 28, 2008 at 7:14 AM, Dimuthu Gamage > <[EMAIL PROTECTED]> wrote: > > Hi Bennett, > > > > I checked with your WSDL and got everything working as > expected. There > > I send array of mixed of element that has either a type or b type, > > where as server understand it and deserialize it correctly. > Please see > > the attachment. > > > > The problem may be caused by your logic or some special case that I > > may not have tested. Can you check this again report back with more > > information. > > > > Thanks > > Dimuthu > > > > > > On Wed, May 28, 2008 at 3:02 AM, Bennett, Robert P > > <[EMAIL PROTECTED]> wrote: > >> I have a situation where I am passing a response message > that can be > >> one of a set of different complex types. I am using the 'choice' > >> element to indicate this, like the following. When I run the > >> attached wsdl through the wsdl2c utility (from axis2 1.4), > the adb C > >> code that is generated (the serialize and deserialize functions) > >> assumes that both A and B elements are present in the message and > >> generates an error (or a null pointer reference) if either is > >> missing. By the way, the flags I used with wsdl2c are > "-sd -ss -g -d > >> adb -sp -wv 1 -u -f ". > >> > >> Am I right to assume that the meaning of 'choice' is that > one of the > >> list of elements is present, but not all of them? > >> > >> Thank you, > >> Bob Bennett > >> > >> <xsd:element name="inputData"> > >> <xsd:complexType> > >> <xsd:sequence> > >> <xsd:element name="AorB" type="AorBChoice" > >> minOccurs="0" > maxOccurs="unbounded"/> > >> </xsd:sequence> > >> </xsd:complexType> > >> </xsd:element> > >> > >> <xsd:complexType name="AorBChoice"> > >> <xsd:sequence> > >> <xsd:choice> > >> <xsd:element name="A" type="AType"/> > >> <xsd:element name="B" type="BType"/> > >> </xsd:choice> > >> </xsd:sequence> > >> </xsd:complexType> > >> > >> <xsd:complexType name="AType"> > >> <xsd:sequence> > >> <xsd:element name="Afield1" type="xsd:string"/> > >> <xsd:element name="Afield2" type="xsd:string"/> > >> </xsd:sequence> > >> </xsd:complexType> > >> > >> <xsd:complexType name="BType"> > >> <xsd:sequence> > >> <xsd:element name="Bfield1" type="xsd:string"/> > >> <xsd:element name="Bfield2" type="xsd:string"/> > >> </xsd:sequence> > >> </xsd:complexType> > >> > >> > >> > --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
