1
Vote

complex types in FunctionImport issue (using odatagen)

description

Hi,
 
When the otadatagen is used to generate classes for services that has complex types inside the FunctionImport section - there are two issues:
 
1) in the class header file the type considers string or collection only. here is a suggestion for a fix:
objc_headers.h line 181:
 
"- (<xsl:choose><xsl:when test=\"contains(@ReturnType, 'Collection')\">NSArray *</xsl:when><xsl:when test=\"contains(@ReturnType, @ComplexType)\"><xsl:choose><xsl:when test=\"contains(@ReturnType, '.')\"><xsl:value-of select=\"substring-after(@ReturnType,'.')\"/> </xsl:when><xsl:otherwise><xsl:value-of select=\"@ReturnType\"/> </xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>NSString *</xsl:otherwise></xsl:choose>) <xsl:value-of select=\"@Name\"/>"\
 
2) in the implementation file, if the complex type includes the namespace the code is generated with a dot, causing to a build error. so the suggestion here is to remove the namespace:
objc_implementation.h line 172:
"- (<xsl:choose><xsl:when test=\"contains(@ReturnType, 'Collection')\">NSArray *</xsl:when><xsl:when test=\"contains(@ReturnType, @ComplexType)\"><xsl:choose><xsl:when test=\"contains(@ReturnType, '.')\"><xsl:value-of select=\"substring-after(@ReturnType,'.')\"/> </xsl:when><xsl:otherwise><xsl:value-of select=\"@ReturnType\"/> </xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>NSString *</xsl:otherwise></xsl:choose>) <xsl:value-of select=\"@Name\"/>"\   Thanks.

comments

CTapang wrote Mar 12, 2011 at 12:13 AM

Both issues fixed in Version 1.2. Regarding the second issue, odatagen now prefixes the class name with a user-specified namespace.