rameshhari / wsdl2objc

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

Searching NSString * standardPrefix declared inside SOAP responce body in empty declared recently [USGlobals sharedInstance].wsdlStandardNamespaces - in addition/replacement to #87 & #99 #104

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. running wsdl2objc parser rev.168 
2. targeting it to an GroupWise.wsdl file - SOAP interface to an Nowell 
GroupWise server
3. addig files to project
4. fixing illegal names (such as 1.h 1.m -> e.h e.m (Events), _.h _.m ->m.h m.m 
(Methods)) and illegal names of objects/methods/etc.
5. adding simple SOAP actions to an program - loginRequest, 
getAddressBooklist,getItemsReguest

here goes jamm #1 - in Request types_Entry was replased by it's parent 
types_FilterElement

and after receiving data from SAP here goes jamm #2 - while deserialisation 
"deserializeElementsFromNode" of an class "item" of an interface "types_Items" 
goes error:

@implementation types_Items
...
@syntetise item
...
- (void)deserializeElementsFromNode:(xmlNodePtr)cur
{
..
NSString *elementTypeString = [NSString stringWithCString:(char*)instanceType 
encoding:NSUTF8StringEncoding];

                    NSArray *elementTypeArray = [elementTypeString componentsSeparatedByString:@":"];

                    NSString *elementClassString = nil;
                    if([elementTypeArray count] > 1) {
                        NSString *prefix = [elementTypeArray objectAtIndex:0];
                        NSString *localName = [elementTypeArray objectAtIndex:1];

                        xmlNsPtr elementNamespace = xmlSearchNs(cur->doc, cur, [prefix xmlString]);

                        /* !!! here goes error: program refers to an newly initialised/ empty object/ object that may have no definition of "prefix". Why? maby because of empty (filled only by intialisation) USGlobals or because "prefix" was declared inside of the body of SOAP's XML responce - look to the bottom of message - part of  SOAP responce placed after mark !!!SOAP!!! */

                        NSString *standardPrefix = [[USGlobals sharedInstance].wsdlStandardNamespaces objectForKey:[NSString stringWithCString:(char*)elementNamespace->href encoding:NSUTF8StringEncoding]];

                        /*MUP Fix - need ?, fix @"gwt"->@"types"*/
                        if ([prefix isEqualToString:@"gwt"] && standardPrefix == nil)
                        {
                            standardPrefix = @"types";
                        }    
                        elementClassString = [NSString stringWithFormat:@"%@_%@", standardPrefix, localName]; //

What version of the product are you using? On what operating system?
wsdl2objC rev 168
OS Mac OS X 10.5.8
XCode 3.1.4
iPhone SDK 3.1.3

!!!SOAP!!!
<soap:Body>
    <gwm:getItemsResponse

 xmlns:gwm="http://schemas.novell.com/2005/01/GroupWise/methods"
 xmlns:gwt="http://schemas.novell.com/2005/01/GroupWise/types"
 xmlns:gwe="http://schemas.novell.com/2005/01/GroupWise/events">
<gwm:items>
<gwt:item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:type="gwt:Contact">
!!!SOAP!!!

the files attached: wsdl - see issues #87 / #99

gw8_rev168.zip - result of Wsdl2ObjC rev.168 work
iGW_copy.zip - fixed SOAP access files + part of a program accessing SOAP (see 
"ContactsViewController.m" -viewDidLoad 

Original issue reported on code.google.com by use...@gmail.com on 4 Jul 2010 at 8:21

Attachments: