KanikaVarma / sudzc

Automatically exported from code.google.com/p/sudzc
0 stars 0 forks source link

Issues with Objective-C code generation #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. For the WSDL select https://www.discoverygate.com/webservice/1.0/DGWS?WSDL
2. Fill in the rest and hit Generate
3. Open the resulting example project in XCode and attempt to compile

What is the expected output? What do you see instead?

You expect it to compile, instead you get hundreds of errors, caused by:

A. The WSDL uses an element named return and the code generation does not 
protect against 
the use of keywords.

      <xsd:complexType name="getSchemaResponse">
        <xsd:sequence>
          <xsd:element name="return" type="xsd:string" />
        </xsd:sequence>
      </xsd:complexType>

This generates code like:

@property (retain, nonatomic) NSString* return;

which because return is a keyword, throws errors.

I had to manually refactor the name.

B. The code generated does not handle forward references very well.

The code generated has:

#import "DGWSDrug.h";
#import "DGWScapped.h"
@class DGWScapped;

@interface DGWSDrugPatent : DGWScapped
...

But because the Drug also references the DrugPatent, you cannot compile this

By altering to:

    //#import "DGWSDrug.h";
#import "DGWScapped.h"
@class DGWScapped;
@class DGWSDrug;

@interface DGWSDrugPatent : DGWScapped

it compiles (of course there were other cases).

You might want to consider a more generous use of @class in the header files.

What version of the product are you using? On what operating system?

Current version of SudzC from the website (2/12/2020)
XCode 3.2.1
OS X Version 10.6.2

Please provide any additional information below.

I downloaded the read only copy you provided, but it is unclear whether this 
actually contains 
any of the code generation so I could try and figure out the way to fix it.

In addition, the methodology for generating complex arguments is unclear from 
anything I can 
locate (and this WSDL is packed with complex types).

Original issue reported on code.google.com by Shawn.La...@gmail.com on 13 Feb 2010 at 6:00

GoogleCodeExporter commented 8 years ago
Oh, that date should be 2010 of course.

Original comment by Shawn.La...@gmail.com on 14 Feb 2010 at 3:28

GoogleCodeExporter commented 8 years ago
The code generation tool uses XSL to transform the WSDL into meaningful code.  
There is a provision made for modifying keywords, however some have not been 
added (such as return).  I couldn't find a definitive list of these keywords in 
Objective-C.

Original comment by jkichl...@gmail.com on 26 Jun 2010 at 2:54

GoogleCodeExporter commented 8 years ago
Is there a chance that this bug will be fixed in the next weeks? Is there 
anybody who works actively on this project?

Original comment by tob...@stardustlabs.org on 29 Jun 2010 at 5:50