2013-04-04 21 views
3

要使用WSDL服務,我指的是http://code.google.com/p/wsdl2objc/wiki/UsageInstructions的代碼。我的代碼是如何在Objective c中使用SAP WSDL服務?

ZESRV_PM_SEARCH_PARAMETERS *binding = [[ZESRV_PM_SEARCH_PARAMETERS alloc] initWithAddress:urlString]; 
    binding.logXMLInOut = YES; 
    binding.authUsername = username; 
    binding.authPassword = password; 


    NSMutableArray *array=[[NSMutableArray alloc]init]; 
    [array addObject:@"Karama"]; 
    [array addObject:@"Commercial"]; 
    [array addObject:@"Industrial"]; 


    ZESRV_PM_SEARCH_PARAMETERSSvc_TableOfZesrvLocation *request = [[ZESRV_PM_SEARCH_PARAMETERSSvc_TableOfZesrvLocation alloc] init]; 

    request.item=array; 

    ZESRV_PM_SEARCH_PARAMETERSResponse *response = [binding ZesrvPmSearchParametersUsingParameters:request]; 
    NSLog(@"response %@",response); 

    NSError * responseError = response.error; 

    NSLog(@"responseError %@",responseError); 

    NSArray *array=response.bodyparts; 

    dispatch_async(dispatch_get_main_queue(), ^{ 
     [self processResponse:response]; 
    }); 

這裏我得到了響應,和響應錯誤是Null.But我得到response.bodypart也NULL.why響應正文部分越來越空?

任何人都可以幫助我。 謝謝

回答

0

我沒有使用wsdl2Objc,因爲我爲此寫了自己的代碼。但是wsdl2code是使用肥皂更好的庫。