开发者

Is it possible to use wsdl web service in iphone?

Hello every one.....

 I am using wsdl web service in my project.I don't know how to use it.But from the wsdl2objc i generate the wsdl into objective c form.And after that i implement it into my project.In my wsdl there are many methods like getCountryList,getCityList,getCompanyContact....etc.Now i have a problem...i mean i fetched getCityList but not all city is shown in my city list.
Now i don't know what is the problem in my code.

Please tell me some suggestions....if you understand my problem...My code is..

- (SoapRequest*) getScanCustomerCompanies: (id <SoapDelegate>) handler machineId: (NSString*) machineId loc: (NSString*) loc cat: (int) cat pausefollow:(int)pausefollow favorite:(int)favorite activeontop:(int)activeontop nationwide:(int)nationwide orderby:(int)orderby
{
    return [self getScanCustomerCompanies: handler action: nil machineId: machineId loc: loc cat: cat pausefollow:pausefollow favorite:favorite activeontop:activeontop nationwide:nationwide orderby:orderby];
}

- (SoapRequest*) getScanCustomerCompanies: (id) _target action: (SEL) _action machineId: (NSString*) machineId loc: (NSString*) loc cat: (int) cat pausefollow:(int)pausefollow favorite:(int)favorite activeontop:(int)activeontop nationwide:(int)nationwide orderby:(int)orderby
{
    NSMutableArray* _params = [NSMutableArray array];

    [_params addObject: [[[SoapParameter alloc] initWithValue: machineId forName: @"machineId"] autorelease]];
    [_params addObject: [[[SoapParameter alloc] initWithValue: loc forName: @"loc"] autorelease]];
    [_params addObject: [[[SoapParameter alloc] initWithValue: [NSNumber numberWithInt: cat] forName: @"cat"] autorelease]];
    [_params addObject: [[[SoapParameter alloc] initWithValue:[NSNumber numberWithInt:pausefollow] forName:@"pausefollow"]autorelease]];
    [_params addObject: [[[SoapParameter alloc] initWithValue:[NSNumber numberWithInt:favorite] forName:@"favorite"]autorelease]];
    [_params addObject: [[[SoapParameter alloc] initWithValue:[NSNumber numberWithInt:activeontop] forName:@"开发者_如何学JAVAactiveontop"]autorelease]];
    [_params addObject: [[[SoapParameter alloc] initWithValue:[NSNumber numberWithInt:nationwide] forName:@"nationwide"]autorelease]];
    [_params addObject: [[[SoapParameter alloc] initWithValue:[NSNumber numberWithInt:orderby] forName:@"orderby"]autorelease]];

    NSString* _envelope = [Soap createEnvelope: @"getScanCustomerCompanies" forNamespace: self.namespace withParameters: _params withHeaders: self.headers];
    SoapRequest* _request = [SoapRequest create: _target action: _action service: self soapAction: @"urn:abc#getScanCustomerCompanies" postData: _envelope deserializeTo: [[SDZscanCustomerCompanies alloc] autorelease]];
    [_request send];
    return _request;
}

Thanks.......


You can try the tool available online here:

http://sudzc.com/

I always use this service whenever I have SOAP request to handle.


Yes, iOS can consume WebServices including WSDL style. Nobody probably knows where is your problem because you have not posted any code yet.

EDIT:

Cudzc generator makes a class which is named according wsdl name and prefix that you specified on the web site. In this class I had to change namespace and url according to the soap standards.

- (id) init
    {
        if(self = [super init])
        {
            self.serviceUrl = @"https://isir.justice.cz:8443/isir_ws/services/IsirPub001";
            self.namespace = @"urn:IsirPub001/types";
            self.headers = nil;
            self.logging = YES;
        }
        return self;
    }

Basically I recommend you to take SOAPUI, test the service on your machine and compare to the request that is generating by your code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜