nishigandharajurkar / wsdl2objc

Automatically exported from code.google.com/p/wsdl2objc
MIT License
0 stars 0 forks source link

attributes with '-' in the names generate incorrect Objective-C code #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a WSDL and use '-' in naming things, i.e. temp-status
2. generate Obj-C using Wsdl2Objc 0.6
3. Add to project in XCode and attempt to compile

What is the expected output?
No compilation errors.

What do you see instead?
Lots of errors due to the '-' causing Obj-C to interpret the name as the 
expression temp - 
status, instead of the single name temp-status.

What version of the product are you using? On what operating system?
Wsdl2Objc 0.6, on Mac OS X Version 10.5.8

Please provide any additional information below.
As a workaround, I can manually replace any variable occurances of temp-status 
with 
temp_status and have it work (being careful not to change quoted strings like 
"temp-status".

Original issue reported on code.google.com by g051...@gmail.com on 20 Oct 2009 at 5:45

GoogleCodeExporter commented 9 years ago
This set of patch files does a simple fix to resolve this issue (and probably 
issue 56 as well.  I updated the 
USObjCKeywords class to scrub names of invalid characters (that can't be used 
in class or variable names) and 
altered other files to call the new method to try and clean up the generated 
code when it contains characters 
such as '-' or '$'.  I'd like for more experienced ObjC programmers to validate 
this and make sure I'm not doing 
anything dumb related to memory management with this.

Original comment by g051...@gmail.com on 19 Nov 2009 at 7:38

Attachments:

GoogleCodeExporter commented 9 years ago
Here's another patch file to fix an issue that cropped up in our testing.  The 
problem was that my original patch 
was causing the special characters to be stripped out of the wsdlName for 
elements and attributes by mistake.  
This patch to Schema.m corrects that.

Original comment by g051...@gmail.com on 23 Nov 2009 at 2:49

Attachments:

GoogleCodeExporter commented 9 years ago
I've done the mostly same things, see my patch for comparison. (I do not filter 
the '$' char, but that's easy to add in mine.) Also I've stripped illegal chars 
from other places that cause a problem.

Original comment by lailo...@gmail.com on 6 Jan 2011 at 2:38

Attachments:

GoogleCodeExporter commented 9 years ago
I've added the '$' to my patch, and in another issue submitted a change to try 
and fix a few of these.

The change seems to be in the latest svn now.

This should be closed now.

Original comment by lailo...@gmail.com on 28 Feb 2011 at 2:30

GoogleCodeExporter commented 9 years ago
revision 182 solves this, except for the '$' char. I'll patch that in if 
necessary.

Original comment by hasse...@gmail.com on 28 Feb 2011 at 7:19