You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Sérgio Gomes <se...@gmail.com> on 2008/04/08 18:17:50 UTC

C code generator and subclasses

Hi there,

I'm back with my code generator questions again, sorry about that ;-)
This is a rather complex one, and if it's not implemented (as I
suspect) it might take quite a bit of work.

Here's the story: I've recently generated all the stubs for a complex
WSDL ( https://sandbox.google.com/api/adwords/v11/AdService ), and
noticed that there wasn't any code generated for derived types, even
if they're subtypes of an abstract type.

The abstract type works fine, however. There's a method in this
service that returns a list of derived types, for instance, and I'm
able to use the abstract type stubs to access the inherited
properties. However, I can't use the properties specific to each type,
since there are no stubs for that.

Also, I am unable to use a different method, that requires a list of
derived types as an input parameter, since there are no stubs for
creating them and the service won't accept abstract types (not to
mention the fact that I need to set the properties specific to each
subtype).

As I said, it looks like this still hasn't been done. Is that right?
Any information you can give me as to whether this will be done and,
if so, when?

Thanks,
Sérgio

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Re: C code generator and subclasses

Posted by Dimuthu Gamage <di...@gmail.com>.
Hi again,
You can get generate the adb objects for all the types in the wsdl
(regardless whether it is referred or not ) with the -g option, so
your command to generate the client code would be like,

WSDL2C.sh -uri AdService.wsdl -u -g


Thanks
Dimuthu

On Sat, Apr 12, 2008 at 1:37 AM, Dimuthu Gamage <di...@gmail.com> wrote:
> Hi Sérgio,
>
>  The code generator doesn't generate classes for the sub types because
>  it is never been used in your WSDL. When I check your wsdl i noticed
>  that non of the derived types are not actually used in any operation.
>
>  And I changed the type of one of the element liek this
>
>       <xsd:element name="getAllAdsResponse">
>         <xsd:complexType>
>           <xsd:sequence>
>             <!--<xsd:element name="getAllAdsReturn"
>  maxOccurs="unbounded" type="impl:Ad"/>-->
>             <xsd:element name="getAllAdsReturn" maxOccurs="unbounded"
>  type="impl:CommerceAd"/>
>           </xsd:sequence>
>         </xsd:complexType>
>       </xsd:element>
>
>  And regenerate the code and it generated the adb_CommerceAd.c, which
>  was not generated before the change.
>
>  WSDL2C supports complexContent extension for sometime now. So I think
>  you can freely use that for your implementation (without the pain of
>  changing the generated code) in cases that you are actually using it.
>
>  Thanks
>  Dimuthu
>
>
>
>  On Tue, Apr 8, 2008 at 9:47 PM, Sérgio Gomes <se...@gmail.com> wrote:
>  > Hi there,
>  >
>  >  I'm back with my code generator questions again, sorry about that ;-)
>  >  This is a rather complex one, and if it's not implemented (as I
>  >  suspect) it might take quite a bit of work.
>  >
>  >  Here's the story: I've recently generated all the stubs for a complex
>  >  WSDL ( https://sandbox.google.com/api/adwords/v11/AdService ), and
>  >  noticed that there wasn't any code generated for derived types, even
>  >  if they're subtypes of an abstract type.
>  >
>  >  The abstract type works fine, however. There's a method in this
>  >  service that returns a list of derived types, for instance, and I'm
>  >  able to use the abstract type stubs to access the inherited
>  >  properties. However, I can't use the properties specific to each type,
>  >  since there are no stubs for that.
>  >
>  >  Also, I am unable to use a different method, that requires a list of
>  >  derived types as an input parameter, since there are no stubs for
>  >  creating them and the service won't accept abstract types (not to
>  >  mention the fact that I need to set the properties specific to each
>  >  subtype).
>  >
>  >  As I said, it looks like this still hasn't been done. Is that right?
>  >  Any information you can give me as to whether this will be done and,
>  >  if so, when?
>  >
>  >  Thanks,
>  >  Sérgio
>  >
>  >  ---------------------------------------------------------------------
>  >  To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
>  >  For additional commands, e-mail: axis-c-user-help@ws.apache.org
>  >
>  >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Re: C code generator and subclasses

Posted by Dimuthu Gamage <di...@gmail.com>.
Hi Sérgio,

The code generator doesn't generate classes for the sub types because
it is never been used in your WSDL. When I check your wsdl i noticed
that non of the derived types are not actually used in any operation.

And I changed the type of one of the element liek this

      <xsd:element name="getAllAdsResponse">
        <xsd:complexType>
          <xsd:sequence>
            <!--<xsd:element name="getAllAdsReturn"
maxOccurs="unbounded" type="impl:Ad"/>-->
            <xsd:element name="getAllAdsReturn" maxOccurs="unbounded"
type="impl:CommerceAd"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>

And regenerate the code and it generated the adb_CommerceAd.c, which
was not generated before the change.

WSDL2C supports complexContent extension for sometime now. So I think
you can freely use that for your implementation (without the pain of
changing the generated code) in cases that you are actually using it.

Thanks
Dimuthu

On Tue, Apr 8, 2008 at 9:47 PM, Sérgio Gomes <se...@gmail.com> wrote:
> Hi there,
>
>  I'm back with my code generator questions again, sorry about that ;-)
>  This is a rather complex one, and if it's not implemented (as I
>  suspect) it might take quite a bit of work.
>
>  Here's the story: I've recently generated all the stubs for a complex
>  WSDL ( https://sandbox.google.com/api/adwords/v11/AdService ), and
>  noticed that there wasn't any code generated for derived types, even
>  if they're subtypes of an abstract type.
>
>  The abstract type works fine, however. There's a method in this
>  service that returns a list of derived types, for instance, and I'm
>  able to use the abstract type stubs to access the inherited
>  properties. However, I can't use the properties specific to each type,
>  since there are no stubs for that.
>
>  Also, I am unable to use a different method, that requires a list of
>  derived types as an input parameter, since there are no stubs for
>  creating them and the service won't accept abstract types (not to
>  mention the fact that I need to set the properties specific to each
>  subtype).
>
>  As I said, it looks like this still hasn't been done. Is that right?
>  Any information you can give me as to whether this will be done and,
>  if so, when?
>
>  Thanks,
>  Sérgio
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
>  For additional commands, e-mail: axis-c-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org