如何在Objective c中使用SAP WSDL服务?

时间:2013-04-04 05:25:02

标签: ios objective-c wsdl sap

要使用WSDL服务,我指的是http://code.google.com/p/wsdl2objc/wiki/UsageInstructions中的代码。我的代码是

  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响应bodyparts得到Null?

任何人都可以帮助我。 感谢

1 个答案:

答案 0 :(得分:0)

我没有使用wsdl2Objc,因为我为此编写了自己的代码。但wsdl2code是使用Soap的更好的库。