Wsdl2Code


The Fastest Way To Connect iOs and Android To Web Services (wsdl)

Login        Register   

  • Android
  • iOs

Android Example

When you upload your WSDL file or submit your service URL we use our engine to create the files needed to connect and automatically receive a parsed object. Our goal is to make the integration process easier and faster for you.

Test our service with our example service parsing

Download Demo Project

Open the service
Open the service WSDL




AUTO Generated Code Example


Usage


1
2
3
4
5
6
7
8
 
                                                                                            public void callWebService(){ 
     SampleService srv1 = new SampleService();
     req = new Request();                     
     req.companyId = "1";
     req.userName = "userName";	                                    
     req.password = "pas";
     Response response =    srv1.ServiceSample(req);
}

Auto Generated Service File

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91

                                                                                                package com.Wsdl2Code.WebServices.SampleService;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.PropertyInfo;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import java.util.Date;
import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;
import java.util.Hashtable;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
import org.ksoap2.HeaderProperty;
import java.util.List;

public class SampleService{
    public String NAMESPACE =" http://Wsdl2CodeTestService/";
    public String url="{0}";
    public int timeOut = 60000;
    


    public void setTimeOut(int seconds){
        this.timeOut = seconds * 1000;
    }
    public void setUrl(String url){
        this.url = url;
    }
    public String HelloWorld(){
        return HelloWorld(null);
    }


    public String HelloWorld(List<HeaderProperty> headers){
    
        SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        soapEnvelope.implicitTypes = true;
        soapEnvelope.dotNet = true;
        SoapObject soapReq = new SoapObject("http://Wsdl2CodeTestService/","HelloWorld");
        
        soapEnvelope.setOutputSoapObject(soapReq);
        HttpTransportSE httpTransport = new HttpTransportSE(url,timeOut);
        try{
            
            if (headers!=null){
                httpTransport.call("http://Wsdl2CodeTestService/HelloWorld", soapEnvelope,headers);
            }else{
                httpTransport.call("http://Wsdl2CodeTestService/HelloWorld", soapEnvelope);
            }
            SoapObject result=(SoapObject)soapEnvelope.bodyIn;
        }catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    
    public Response ServiceSample(Request req){
        return ServiceSample(req,null);
    }


    public Response ServiceSample(Request req,List<HeaderProperty> headers){
    
        SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        soapEnvelope.implicitTypes = true;
        soapEnvelope.dotNet = true;
        SoapObject soapReq = new SoapObject("http://Wsdl2CodeTestService","ServiceSample");
        soapEnvelope.addMapping("http://Wsdl2CodeTestService","Response",new Response().getClass());
        soapEnvelope.addMapping("http://Wsdl2CodeTestService","req",new Request().getClass());
        soapReq.addProperty("req",req);
        
        soapEnvelope.setOutputSoapObject(soapReq);
        HttpTransportSE httpTransport = new HttpTransportSE(url,timeOut);
        try{
            
            if (headers!=null){
                httpTransport.call("http://Wsdl2CodeTestService/ServiceSample", soapEnvelope,headers);
            }else{
                httpTransport.call("http://Wsdl2CodeTestService/ServiceSample", soapEnvelope);
            }
            SoapObject result=(SoapObject)soapEnvelope.bodyIn;
            SoapObject soapObject =(SoapObject) result.getPropertySafely("ServiceSampleResult");
            Response ServiceSampleResult = new Response(soapObject);
            return ServiceSampleResult;
        }catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    
}

Auto Generated Request File

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93

                                                                                                package com.Wsdl2Code.WebServices.SampleService;

import java.util.Date;
import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;
import java.util.Hashtable;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;

public class Request implements KvmSerializable {

    public String NAMESPACE ="http://Wsdl2CodeTestService";
    public String companyId;
    public String userName;
    public String password;
    
    public Request(){}
    
    public Request(SoapObject soapObject){
    
        if (soapObject.hasProperty("companyId"))
        {
            Object obj = soapObject.getProperty("companyId");
            if (obj.getClass().equals(SoapPrimitive.class)){
                SoapPrimitive j0 =(SoapPrimitive) soapObject.getProperty("companyId");
                companyId = j0.toString();
            }
        }
        if (soapObject.hasProperty("userName"))
        {
            Object obj = soapObject.getProperty("userName");
            if (obj.getClass().equals(SoapPrimitive.class)){
                SoapPrimitive j1 =(SoapPrimitive) soapObject.getProperty("userName");
                userName = j1.toString();
            }
        }
        if (soapObject.hasProperty("Password"))
        {
            Object obj = soapObject.getProperty("Password");
            if (obj.getClass().equals(SoapPrimitive.class)){
                SoapPrimitive j2 =(SoapPrimitive) soapObject.getProperty("Password");
                password = j2.toString();
            }
        }
    }
    @Override
    public Object getProperty(int arg0) {
    switch(arg0){
        case 0:
            return companyId;
        case 1:
            return userName;
        case 2:
            return password;
    }
    return null;
    }
    @Override
    public int getPropertyCount() {
        return 3;
    }
    @Override
    public void getPropertyInfo(int index, @SuppressWarnings("rawtypes") Hashtable arg1, PropertyInfo info) {
    switch(index){
        case 0:
            info.type = PropertyInfo.STRING_CLASS;
            info.name = "companyId";
            break;
        case 1:
            info.type = PropertyInfo.STRING_CLASS;
            info.name = "userName";
            break;
        case 2:
            info.type = PropertyInfo.STRING_CLASS;
            info.name = "Password";
            break;
    }
    }
    @Override
    public void setProperty(int index, Object value) {
    switch(index){
        case 0:
        companyId = value.toString() ;
        break;
        case 1:
        userName = value.toString() ;
        break;
        case 2:
        password = value.toString() ;
        break;
}
}
}

Auto Generated Response File

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108

                                                                                                package com.Wsdl2Code.WebServices.SampleService;

import java.util.Vector;
import java.util.Date;
import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;
import java.util.Hashtable;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
import com.Wsdl2Code.WebServices.SampleService.WSPerson;


public class Response implements KvmSerializable {

    public String NAMESPACE ="http://Wsdl2CodeTestService";
    public VectorWSPerson customArray;
    public VectorString stringArray;
    public String errMessage;
    public int resultCode;
    
    public Response(){}
    
    public Response(SoapObject soapObject){
    
        if (soapObject.hasProperty("CustomArray"))
        {
            SoapObject j10 = (SoapObject)soapObject.getProperty("CustomArray");
            customArray = new VectorWSPerson(j10);
        }
        if (soapObject.hasProperty("stringArray"))
        {
            SoapObject j11 = (SoapObject)soapObject.getProperty("stringArray");
            stringArray = new VectorString(j11);
        }
        if (soapObject.hasProperty("errMessage"))
        {
            Object obj = soapObject.getProperty("errMessage");
            if (obj.getClass().equals(SoapPrimitive.class)){
                SoapPrimitive j12 =(SoapPrimitive) soapObject.getProperty("errMessage");
                errMessage = j12.toString();
            }
        }
        if (soapObject.hasProperty("resultCode"))
        {
            Object obj = soapObject.getProperty("resultCode");
            if (obj.getClass().equals(SoapPrimitive.class)){
                SoapPrimitive j13 =(SoapPrimitive) soapObject.getProperty("resultCode");
                resultCode = Integer.parseInt(j13.toString());
            }
        }
    }
    @Override
    public Object getProperty(int arg0) {
    switch(arg0){
        case 0:
            return customArray;
        case 1:
            return stringArray;
        case 2:
            return errMessage;
        case 3:
            return resultCode;
    }
    return null;
    }
    @Override
    public int getPropertyCount() {
        return 4;
    }
    @Override
    public void getPropertyInfo(int index, @SuppressWarnings("rawtypes") Hashtable arg1, PropertyInfo info) {
    switch(index){
        case 0:
            info.type = PropertyInfo.VECTOR_CLASS;
            info.name = "CustomArray";
            break;
        case 1:
            info.type = PropertyInfo.VECTOR_CLASS;
            info.name = "stringArray";
            break;
        case 2:
            info.type = PropertyInfo.STRING_CLASS;
            info.name = "errMessage";
            break;
        case 3:
            info.type = PropertyInfo.INTEGER_CLASS;
            info.name = "resultCode";
            break;
    }
    }
    @Override
    public void setProperty(int index, Object value) {
    switch(index){
        case 0:
        customArray = (VectorWSPerson)value;
        break;
        case 1:
        stringArray = (VectorString)value;
        break;
        case 2:
        errMessage = value.toString() ;
        break;
        case 3:
        resultCode = Integer.parseInt(value.toString()) ;
        break;
}
}
}

iOs Example

When you upload your WSDL file or submit your service URL we use our engine to create the files needed to connect and automatically receive a parsed object. Our goal is to make the integration process easier and faster for you.

A simple iOS tutorial

Test our service with our example service parsing

Download our Demo project

Open The Service
Open The Service Wsdl

AUTO Generated Code Example

Usage

1. Add Wsdl2CodeDelegate to Your Class
2. Implement Wsdl2CodeDelegate Methods
3. Add libxml.a to your project
4. Add libxml header files to the search path - $(SDK_DIR)"/usr/include/libxml2
* Download The Example Project


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//if service
                                                                                recieve an error this method will be called
-(void)proxyRecievedError:(NSException*)ex InMethod:(NSString*)method{
    NSLog(@"Exeption in service %@",method);

}
//proxy finished, (id)data is the object of the relevant
    method service
-(void)proxydidFinishLoadingData:(id)data InMethod:(NSString*)method{
    NSLog(@"Service %@ Done!",method);
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    
    SampleServiceProxy *proxy = [[SampleServiceProxy alloc]initWithUrl:@"YOUR
            URL" AndDelegate:self];

    [proxy GetDouble];
    [proxy GetEnum];
    [proxy getEnum:kTestEnumTestEnum2];
    [proxy GetInt16];
    [proxy GetInt32];
    [proxy GetInt64];
    [proxy GetString];
    [proxy getListStrings];

    // the answer will be in the delegate method

Auto Generated Proxy h File

#import <Foundation/Foundation.h>

#import "xpathquery.h"

#import "SampleService.h"

#import "Response.h"

#import "Request.h"



#ifndef _Wsdl2CodeProxyDelegate

#define _Wsdl2CodeProxyDelegate

@protocol Wsdl2CodeProxyDelegate

//if service recieve an error this method will be called

-(void)proxyRecievedError:(NSException*)ex InMethod:(NSString*)method;

//proxy finished, (id)data is the object of the relevant
    method service

-(void)proxydidFinishLoadingData:(id)data InMethod:(NSString*)method;

@end

#endif



@interface SampleServiceProxy : NSObject

@property (nonatomic,assign) id<Wsdl2CodeProxyDelegate> proxyDelegate;

@property (nonatomic,copy)   NSString* url;

@property (nonatomic,retain) SampleService* service;



-(id)initWithUrl:(NSString*)url AndDelegate:(id<Wsdl2CodeProxyDelegate>)delegate;

///Origin Return Type:String

-(void)HelloWorld;

///Origin Return Type:Response

-(void)ServiceSample:(Request *)req ;

///Origin Return Type:String

-(void)getListStrings;

///Origin Return Type:WSPerson

-(void)GetListOfCustomObject;

///Origin Return Type:String

-(void)GetString;

///Origin Return Type:Int32

-(void)GetInt32;

///Origin Return Type:Int16

-(void)GetInt16;

///Origin Return Type:Int64

-(void)GetInt64;

///Origin Return Type:Double

-(void)GetDouble;

///Origin Return Type:Int64

-(void)GetLong;

///Origin Return Type:TestEnum

-(void)GetEnum;

///Origin Return Type:

-(void)GetVoid;

///Origin Return Type:String

-(void)sendEnum:(TestEnum)enum1 ;

///Origin Return Type:TestEnum

-(void)getEnum:(TestEnum)enum2 ;

@end

Auto Generated Proxy m File

//------------------------------------------------------------------------------

// <wsdl2code-generated>

// This code was generated by http://www.wsdl2code.com
    iOs version Beta 1.0

//

// Please dont change this code, regeneration will override
    your changes

//</wsdl2code-generated>

//

//------------------------------------------------------------------------------

//

//This source code was auto-generated by Wsdl2Code Beta
    Version

//

#import "SampleServiceProxy.h"



@implementation SampleServiceProxy



-(id)initWithUrl:(NSString*)url AndDelegate:(id<Wsdl2CodeProxyDelegate>)delegate{

    self = [super init];

    if (self != nil){

        self.service = [[SampleService alloc] init];

        [self.service setUrl:url];

        [self setUrl:url];

        [self setProxyDelegate:delegate];

    }

    return self;

}

-(void)dealloc{

    [_url release];

    [_service release];

    [super dealloc];

}



///Origin Return Type:String

-(void)HelloWorld{

    [self.service addTarget:self AndAction:&HelloWorldTarget];

    [self.service HelloWorld];

}



void HelloWorldTarget(SampleServiceProxy* target, id sender, NSString* xml){

    @try{

        NSString *xmldata = [xml stringByReplacingOccurrencesOfString:@"xmlns=\"http://Wsdl2CodeTestService/\"" withString:@""];

        NSData *data = [xmldata dataUsingEncoding:NSUTF8StringEncoding];

        XPathQuery *xpathQuery = [[XPathQuery alloc] init];

        NSString * query = [NSString stringWithFormat:@"/soap:Envelope/soap:Body/HelloWorldResponse/HelloWorldResult"];

        NSArray *arrayOfWSData = [xpathQuery newXMLXPathQueryResult:data andQuery:query];

        [xpathQuery release];

        if([arrayOfWSData count] == 0 ){

            NSException *exception = [NSException exceptionWithName:@"Wsdl2Code" reason: @"Response
                        is nil" userInfo: nil];

            if (target.proxyDelegate != nil){

                [target.proxyDelegate proxyRecievedError:exception InMethod:@"HelloWorld"];

                return;

            }

        }

        NSString *nodeContentValue = [[NSString alloc] initWithString:[[arrayOfWSData objectAtIndex:0] objectForKey:@"nodeContent"]];

        NSString* result = nil;

        if (nodeContentValue !=nil){

            result = [[NSString alloc] initWithString:nodeContentValue];

            [nodeContentValue release];

        }

         if (target.proxyDelegate != nil){

            [target.proxyDelegate proxydidFinishLoadingData:result InMethod:@"HelloWorld"];

            return;

        }

    }

    @catch(NSException *ex){

        if (target.proxyDelegate != nil){

            [target.proxyDelegate proxyRecievedError:ex InMethod:@"HelloWorld"];

            return;

        }

    }

}



///Origin Return Type:Response

-(void)ServiceSample:(Request *)req {

    [self.service addTarget:self AndAction:&ServiceSampleTarget];

    [self.service ServiceSample:req ];

}



void ServiceSampleTarget(SampleServiceProxy* target, id sender, NSString* xml){

    @try{

        NSString *xmldata = [xml stringByReplacingOccurrencesOfString:@"xmlns=\"http://Wsdl2CodeTestService/\"" withString:@""];

        NSData *data = [xmldata dataUsingEncoding:NSUTF8StringEncoding];

        XPathQuery *xpathQuery = [[XPathQuery alloc] init];

        NSString * query = [NSString stringWithFormat:@"/soap:Envelope/soap:Body/ServiceSampleResponse/ServiceSampleResult"];

        NSArray *arrayOfWSData = [xpathQuery newXMLXPathQueryResult:data andQuery:query];

        [xpathQuery release];

        if([arrayOfWSData count] == 0 ){

            NSException *exception = [NSException exceptionWithName:@"Wsdl2Code" reason: @"Response
                        is nil" userInfo: nil];

            if (target.proxyDelegate != nil){

                [target.proxyDelegate proxyRecievedError:exception InMethod:@"ServiceSample"];

                return;

            }

        }

        NSArray* array0 = [[arrayOfWSData objectAtIndex:0] objectForKey:@"nodeChildArray"];

        Response* result = [[Response alloc]initWithArray:array0];

         if (target.proxyDelegate != nil){

            [target.proxyDelegate proxydidFinishLoadingData:result InMethod:@"ServiceSample"];

            return;

        }

    }

    @catch(NSException *ex){

        if (target.proxyDelegate != nil){

            [target.proxyDelegate proxyRecievedError:ex InMethod:@"ServiceSample"];

            return;

        }

    }

}



///Origin Return Type:String

-(void)getListStrings{

    [self.service addTarget:self AndAction:&getListStringsTarget];

    [self.service getListStrings];

}



void getListStringsTarget(SampleServiceProxy* target, id sender, NSString* xml){

    @try{

        NSString *xmldata = [xml stringByReplacingOccurrencesOfString:@"xmlns=\"http://Wsdl2CodeTestService/\"" withString:@""];

        NSData *data = [xmldata dataUsingEncoding:NSUTF8StringEncoding];

        XPathQuery *xpathQuery = [[XPathQuery alloc] init];

        NSString * query = [NSString stringWithFormat:@"/soap:Envelope/soap:Body/getListStringsResponse/getListStringsResult"];

        NSArray *arrayOfWSData = [xpathQuery newXMLXPathQueryResult:data andQuery:query];

        [xpathQuery release];

        if([arrayOfWSData count] == 0 ){

            NSException *exception = [NSException exceptionWithName:@"Wsdl2Code" reason: @"Response
                        is nil" userInfo: nil];

            if (target.proxyDelegate != nil){

                [target.proxyDelegate proxyRecievedError:exception InMethod:@"getListStrings"];

                return;

            }

        }

        NSArray* array1 = [[arrayOfWSData objectAtIndex:0] objectForKey:@"nodeChildArray"];

        NSMutableArray* result = [[NSMutableArray alloc]initWithArray:array1];

         if (target.proxyDelegate != nil){

            [target.proxyDelegate proxydidFinishLoadingData:result InMethod:@"getListStrings"];

            return;

        }

    }

    @catch(NSException *ex){

        if (target.proxyDelegate != nil){

            [target.proxyDelegate proxyRecievedError:ex InMethod:@"getListStrings"];

            return;

        }

    }

}



///Origin Return Type:WSPerson

-(void)GetListOfCustomObject{

    [self.service addTarget:self AndAction:&GetListOfCustomObjectTarget];

    [self.service GetListOfCustomObject];

}



void GetListOfCustomObjectTarget(SampleServiceProxy* target, id sender, NSString* xml){

    @try{

        NSString *xmldata = [xml stringByReplacingOccurrencesOfString:@"xmlns=\"http://Wsdl2CodeTestService/\"" withString:@""];

        NSData *data = [xmldata dataUsingEncoding:NSUTF8StringEncoding];

        XPathQuery *xpathQuery = [[XPathQuery alloc] init];

        NSString * query = [NSString stringWithFormat:@"/soap:Envelope/soap:Body/GetListOfCustomObjectResponse/GetListOfCustomObjectResult"];

        NSArray *arrayOfWSData = [xpathQuery newXMLXPathQueryResult:data andQuery:query];

        [xpathQuery release];

        if([arrayOfWSData count] == 0 ){

            NSException *exception = [NSException exceptionWithName:@"Wsdl2Code" reason: @"Response
                        is nil" userInfo: nil];

            if (target.proxyDelegate != nil){

                [target.proxyDelegate proxyRecievedError:exception InMethod:@"GetListOfCustomObject"];

                return;

            }

        }

        NSArray* array2 = [[arrayOfWSData objectAtIndex:0] objectForKey:@"nodeChildArray"];

        NSMutableArray* result = [[NSMutableArray alloc]initWithArray:array2];

         if (target.proxyDelegate != nil){

            [target.proxyDelegate proxydidFinishLoadingData:result InMethod:@"GetListOfCustomObject"];

            return;

        }

    }

    @catch(NSException *ex){

        if (target.proxyDelegate != nil){

            [target.proxyDelegate proxyRecievedError:ex InMethod:@"GetListOfCustomObject"];

            return;

        }

    }

}



///Origin Return Type:String

-(void)GetString{

    [self.service addTarget:self AndAction:&GetStringTarget];

    [self.service GetString];

}



void GetStringTarget(SampleServiceProxy* target, id sender, NSString* xml){

    @try{

        NSString *xmldata = [xml stringByReplacingOccurrencesOfString:@"xmlns=\"http://Wsdl2CodeTestService/\"" withString:@""];

        NSData *data = [xmldata dataUsingEncoding:NSUTF8StringEncoding];

        XPathQuery *xpathQuery = [[XPathQuery alloc] init];

        NSString * query = [NSString stringWithFormat:@"/soap:Envelope/soap:Body/GetStringResponse/GetStringResult"];

        NSArray *arrayOfWSData = [xpathQuery newXMLXPathQueryResult:data andQuery:query];

        [xpathQuery release];

        if([arrayOfWSData count] == 0 ){

            NSException *exception = [NSException exceptionWithName:@"Wsdl2Code" reason: @"Response
                        is nil" userInfo: nil];

            if (target.proxyDelegate != nil){

                [target.proxyDelegate proxyRecievedError:exception InMethod:@"GetString"];

                return;

            }

        }

        NSString *nodeContentValue = [[NSString alloc] initWithString:[[arrayOfWSData objectAtIndex:0] objectForKey:@"nodeContent"]];

        NSString* result = nil;

        if (nodeContentValue !=nil){

            result = [[NSString alloc] initWithString:nodeContentValue];

            [nodeContentValue release];

        }

         if (target.proxyDelegate != nil){

            [target.proxyDelegate proxydidFinishLoadingData:result InMethod:@"GetString"];

            return;

        }

    }

    @catch(NSException *ex){

        if (target.proxyDelegate != nil){

            [target.proxyDelegate proxyRecievedError:ex InMethod:@"GetString"];

            return;

        }

    }

}



///Origin Return Type:Int32

-(void)GetInt32{

    [self.service addTarget:self AndAction:&GetInt32Target];

    [self.service GetInt32];

}



void GetInt32Target(SampleServiceProxy* target, id sender, NSString* xml){

    @try{

        NSString *xmldata = [xml stringByReplacingOccurrencesOfString:@"xmlns=\"http://Wsdl2CodeTestService/\"" withString:@""];

        NSData *data = [xmldata dataUsingEncoding:NSUTF8StringEncoding];

        XPathQuery *xpathQuery = [[XPathQuery alloc] init];

        NSString * query = [NSString stringWithFormat:@"/soap:Envelope/soap:Body/GetInt32Response/GetInt32Result"];

        NSArray *arrayOfWSData = [xpathQuery newXMLXPathQueryResult:data andQuery:query];

        [xpathQuery release];

        if([arrayOfWSData count] == 0 ){

            NSException *exception = [NSException exceptionWithName:@"Wsdl2Code" reason: @"Response
                        is nil" userInfo: nil];

            if (target.proxyDelegate != nil){

                [target.proxyDelegate proxyRecievedError:exception InMethod:@"GetInt32"];

                return;

            }

        }

        NSString *nodeContentValue = [[NSString alloc] initWithString:[[arrayOfWSData objectAtIndex:0] objectForKey:@"nodeContent"]];

        NSNumber* result = nil;

        result = [NSNumber numberWithInt:[nodeContentValue intValue]];

        [nodeContentValue release];

         if (target.proxyDelegate != nil){

            [target.proxyDelegate proxydidFinishLoadingData:result InMethod:@"GetInt32"];

            return;

        }

    }

    @catch(NSException *ex){

        if (target.proxyDelegate != nil){

            [target.proxyDelegate proxyRecievedError:ex InMethod:@"GetInt32"];

            return;

        }

    }

}



///Origin Return Type:Int16

-(void)GetInt16{

    [self.service addTarget:self AndAction:&GetInt16Target];

    [self.service GetInt16];

}



void GetInt16Target(SampleServiceProxy* target, id sender, NSString* xml){

    @try{

        NSString *xmldata = [xml stringByReplacingOccurrencesOfString:@"xmlns=\"http://Wsdl2CodeTestService/\"" withString:@""];

        NSData *data = [xmldata dataUsingEncoding:NSUTF8StringEncoding];

        XPathQuery *xpathQuery = [[XPathQuery alloc] init];

        NSString * query = [NSString stringWithFormat:@"/soap:Envelope/soap:Body/GetInt16Response/GetInt16Result"];

        NSArray *arrayOfWSData = [xpathQuery newXMLXPathQueryResult:data andQuery:query];

        [xpathQuery release];

        if([arrayOfWSData count] == 0 ){

            NSException *exception = [NSException exceptionWithName:@"Wsdl2Code" reason: @"Response
                        is nil" userInfo: nil];

            if (target.proxyDelegate != nil){

                [target.proxyDelegate proxyRecievedError:exception InMethod:@"GetInt16"];

                return;

            }

        }

        NSString *nodeContentValue = [[NSString alloc] initWithString:[[arrayOfWSData objectAtIndex:0] objectForKey:@"nodeContent"]];

        NSNumber* result = nil;

        result = [NSNumber numberWithShort:[nodeContentValue intValue]];

        [nodeContentValue release];

         if (target.proxyDelegate != nil){

            [target.proxyDelegate proxydidFinishLoadingData:result InMethod:@"GetInt16"];

            return;

        }

    }

    @catch(NSException *ex){

        if (target.proxyDelegate != nil){

            [target.proxyDelegate proxyRecievedError:ex InMethod:@"GetInt16"];

            return;

        }

    }

}



///Origin Return Type:Int64

-(void)GetInt64{

    [self.service addTarget:self AndAction:&GetInt64Target];

    [self.service GetInt64];

}



void GetInt64Target(SampleServiceProxy* target, id sender, NSString* xml){

    @try{

        NSString *xmldata = [xml stringByReplacingOccurrencesOfString:@"xmlns=\"http://Wsdl2CodeTestService/\"" withString:@""];

        NSData *data = [xmldata dataUsingEncoding:NSUTF8StringEncoding];

        XPathQuery *xpathQuery = [[XPathQuery alloc] init];

        NSString * query = [NSString stringWithFormat:@"/soap:Envelope/soap:Body/GetInt64Response/GetInt64Result"];

        NSArray *arrayOfWSData = [xpathQuery newXMLXPathQueryResult:data andQuery:query];

        [xpathQuery release];

        if([arrayOfWSData count] == 0 ){

            NSException *exception = [NSException exceptionWithName:@"Wsdl2Code" reason: @"Response
                        is nil" userInfo: nil];

            if (target.proxyDelegate != nil){

                [target.proxyDelegate proxyRecievedError:exception InMethod:@"GetInt64"];

                return;

            }

        }

        NSString *nodeContentValue = [[NSString alloc] initWithString:[[arrayOfWSData objectAtIndex:0] objectForKey:@"nodeContent"]];

        NSNumber* result = nil;

        result = [NSNumber numberWithLong:[nodeContentValue intValue]];

        [nodeContentValue release];

         if (target.proxyDelegate != nil){

            [target.proxyDelegate proxydidFinishLoadingData:result InMethod:@"GetInt64"];

            return;

        }

    }

    @catch(NSException *ex){

        if (target.proxyDelegate != nil){

            [target.proxyDelegate proxyRecievedError:ex InMethod:@"GetInt64"];

            return;

        }

    }

}



///Origin Return Type:Double

-(void)GetDouble{

    [self.service addTarget:self AndAction:&GetDoubleTarget];

    [self.service GetDouble];

}



void GetDoubleTarget(SampleServiceProxy* target, id sender, NSString* xml){

    @try{

        NSString *xmldata = [xml stringByReplacingOccurrencesOfString:@"xmlns=\"http://Wsdl2CodeTestService/\"" withString:@""];

        NSData *data = [xmldata dataUsingEncoding:NSUTF8StringEncoding];

        XPathQuery *xpathQuery = [[XPathQuery alloc] init];

        NSString * query = [NSString stringWithFormat:@"/soap:Envelope/soap:Body/GetDoubleResponse/GetDoubleResult"];

        NSArray *arrayOfWSData = [xpathQuery newXMLXPathQueryResult:data andQuery:query];

        [xpathQuery release];

        if([arrayOfWSData count] == 0 ){

            NSException *exception = [NSException exceptionWithName:@"Wsdl2Code" reason: @"Response
                        is nil" userInfo: nil];

            if (target.proxyDelegate != nil){

                [target.proxyDelegate proxyRecievedError:exception InMethod:@"GetDouble"];

                return;

            }

        }

        NSString *nodeContentValue = [[NSString alloc] initWithString:[[arrayOfWSData objectAtIndex:0] objectForKey:@"nodeContent"]];

        NSNumber* result = nil;

        result = [NSNumber numberWithDouble:[nodeContentValue doubleValue]];

        [nodeContentValue release];

         if (target.proxyDelegate != nil){

            [target.proxyDelegate proxydidFinishLoadingData:result InMethod:@"GetDouble"];

            return;

        }

    }

    @catch(NSException *ex){

        if (target.proxyDelegate != nil){

            [target.proxyDelegate proxyRecievedError:ex InMethod:@"GetDouble"];

            return;

        }

    }

}



///Origin Return Type:Int64

-(void)GetLong{

    [self.service addTarget:self AndAction:&GetLongTarget];

    [self.service GetLong];

}



void GetLongTarget(SampleServiceProxy* target, id sender, NSString* xml){

    @try{

        NSString *xmldata = [xml stringByReplacingOccurrencesOfString:@"xmlns=\"http://Wsdl2CodeTestService/\"" withString:@""];

        NSData *data = [xmldata dataUsingEncoding:NSUTF8StringEncoding];

        XPathQuery *xpathQuery = [[XPathQuery alloc] init];

        NSString * query = [NSString stringWithFormat:@"/soap:Envelope/soap:Body/GetLongResponse/GetLongResult"];

        NSArray *arrayOfWSData = [xpathQuery newXMLXPathQueryResult:data andQuery:query];

        [xpathQuery release];

        if([arrayOfWSData count] == 0 ){

            NSException *exception = [NSException exceptionWithName:@"Wsdl2Code" reason: @"Response
                        is nil" userInfo: nil];

            if (target.proxyDelegate != nil){

                [target.proxyDelegate proxyRecievedError:exception InMethod:@"GetLong"];

                return;

            }

        }

        NSString *nodeContentValue = [[NSString alloc] initWithString:[[arrayOfWSData objectAtIndex:0] objectForKey:@"nodeContent"]];

        NSNumber* result = nil;

        result = [NSNumber numberWithLong:[nodeContentValue intValue]];

        [nodeContentValue release];

         if (target.proxyDelegate != nil){

            [target.proxyDelegate proxydidFinishLoadingData:result InMethod:@"GetLong"];

            return;

        }

    }

    @catch(NSException *ex){

        if (target.proxyDelegate != nil){

            [target.proxyDelegate proxyRecievedError:ex InMethod:@"GetLong"];

            return;

        }

    }

}



///Origin Return Type:TestEnum

-(void)GetEnum{

    [self.service addTarget:self AndAction:&GetEnumTarget];

    [self.service GetEnum];

}



void GetEnumTarget(SampleServiceProxy* target, id sender, NSString* xml){

    @try{

        NSString *xmldata = [xml stringByReplacingOccurrencesOfString:@"xmlns=\"http://Wsdl2CodeTestService/\"" withString:@""];

        NSData *data = [xmldata dataUsingEncoding:NSUTF8StringEncoding];

        XPathQuery *xpathQuery = [[XPathQuery alloc] init];

        NSString * query = [NSString stringWithFormat:@"/soap:Envelope/soap:Body/GetEnumResponse/GetEnumResult"];

        NSArray *arrayOfWSData = [xpathQuery newXMLXPathQueryResult:data andQuery:query];

        [xpathQuery release];

        if([arrayOfWSData count] == 0 ){

            NSException *exception = [NSException exceptionWithName:@"Wsdl2Code" reason: @"Response
                        is nil" userInfo: nil];

            if (target.proxyDelegate != nil){

                [target.proxyDelegate proxyRecievedError:exception InMethod:@"GetEnum"];

                return;

            }

        }

        NSString *nodeContentValue = [[NSString alloc] initWithString:[[arrayOfWSData objectAtIndex:0] objectForKey:@"nodeContent"]];

        NSNumber* result = nil;

        TestEnum result1;

        if (nodeContentValue !=nil){

            result1 = [SampleService_Enums StringToTestEnum:nodeContentValue];

            [nodeContentValue release];

            result = [[NSNumber alloc]initWithInt:(int)result1];

        }

        else{

            result = [[NSNumber alloc]initWithInt:-1];

        }

         if (target.proxyDelegate != nil){

            [target.proxyDelegate proxydidFinishLoadingData:result InMethod:@"GetEnum"];

            return;

        }

    }

    @catch(NSException *ex){

        if (target.proxyDelegate != nil){

            [target.proxyDelegate proxyRecievedError:ex InMethod:@"GetEnum"];

            return;

        }

    }

}



///Origin Return Type:

-(void)GetVoid{

    [self.service addTarget:self AndAction:&GetVoidTarget];

    [self.service GetVoid];

}



void GetVoidTarget(SampleServiceProxy* target, id sender, NSString* xml){

    @try{

        NSString *xmldata = [xml stringByReplacingOccurrencesOfString:@"xmlns=\"http://Wsdl2CodeTestService/\"" withString:@""];

        NSData *data = [xmldata dataUsingEncoding:NSUTF8StringEncoding];

        XPathQuery *xpathQuery = [[XPathQuery alloc] init];

        NSString * query = [NSString stringWithFormat:@"/soap:Envelope/soap:Body/GetVoidResponse/GetVoidResult"];

        NSArray *arrayOfWSData = [xpathQuery newXMLXPathQueryResult:data andQuery:query];

        [xpathQuery release];

        if([arrayOfWSData count] == 0 ){

            NSException *exception = [NSException exceptionWithName:@"Wsdl2Code" reason: @"Response
                        is nil" userInfo: nil];

            if (target.proxyDelegate != nil){

                [target.proxyDelegate proxyRecievedError:exception InMethod:@"GetVoid"];

                return;

            }

        }

        if (target.proxyDelegate != nil){

            [target.proxyDelegate proxydidFinishLoadingData:nil InMethod:@"GetVoid"];

            return;

        }

    }

    @catch(NSException *ex){

        if (target.proxyDelegate != nil){

            [target.proxyDelegate proxyRecievedError:ex InMethod:@"GetVoid"];

            return;

        }

    }

}



///Origin Return Type:String

-(void)sendEnum:(TestEnum)enum1 {

    [self.service addTarget:self AndAction:&sendEnumTarget];

    [self.service sendEnum:enum1 ];

}



void sendEnumTarget(SampleServiceProxy* target, id sender, NSString* xml){

    @try{

        NSString *xmldata = [xml stringByReplacingOccurrencesOfString:@"xmlns=\"http://Wsdl2CodeTestService/\"" withString:@""];

        NSData *data = [xmldata dataUsingEncoding:NSUTF8StringEncoding];

        XPathQuery *xpathQuery = [[XPathQuery alloc] init];

        NSString * query = [NSString stringWithFormat:@"/soap:Envelope/soap:Body/sendEnumResponse/sendEnumResult"];

        NSArray *arrayOfWSData = [xpathQuery newXMLXPathQueryResult:data andQuery:query];

        [xpathQuery release];

        if([arrayOfWSData count] == 0 ){

            NSException *exception = [NSException exceptionWithName:@"Wsdl2Code" reason: @"Response
                        is nil" userInfo: nil];

            if (target.proxyDelegate != nil){

                [target.proxyDelegate proxyRecievedError:exception InMethod:@"sendEnum"];

                return;

            }

        }

        NSString *nodeContentValue = [[NSString alloc] initWithString:[[arrayOfWSData objectAtIndex:0] objectForKey:@"nodeContent"]];

        NSString* result = nil;

        if (nodeContentValue !=nil){

            result = [[NSString alloc] initWithString:nodeContentValue];

            [nodeContentValue release];

        }

         if (target.proxyDelegate != nil){

            [target.proxyDelegate proxydidFinishLoadingData:result InMethod:@"sendEnum"];

            return;

        }

    }

    @catch(NSException *ex){

        if (target.proxyDelegate != nil){

            [target.proxyDelegate proxyRecievedError:ex InMethod:@"sendEnum"];

            return;

        }

    }

}



///Origin Return Type:TestEnum

-(void)getEnum:(TestEnum)enum2 {

    [self.service addTarget:self AndAction:&getEnumTarget];

    [self.service getEnum:enum2 ];

}



void getEnumTarget(SampleServiceProxy* target, id sender, NSString* xml){

    @try{

        NSString *xmldata = [xml stringByReplacingOccurrencesOfString:@"xmlns=\"http://Wsdl2CodeTestService/\"" withString:@""];

        NSData *data = [xmldata dataUsingEncoding:NSUTF8StringEncoding];

        XPathQuery *xpathQuery = [[XPathQuery alloc] init];

        NSString * query = [NSString stringWithFormat:@"/soap:Envelope/soap:Body/getEnumResponse/getEnumResult"];

        NSArray *arrayOfWSData = [xpathQuery newXMLXPathQueryResult:data andQuery:query];

        [xpathQuery release];

        if([arrayOfWSData count] == 0 ){

            NSException *exception = [NSException exceptionWithName:@"Wsdl2Code" reason: @"Response
                        is nil" userInfo: nil];

            if (target.proxyDelegate != nil){

                [target.proxyDelegate proxyRecievedError:exception InMethod:@"getEnum"];

                return;

            }

        }

        NSString *nodeContentValue = [[NSString alloc] initWithString:[[arrayOfWSData objectAtIndex:0] objectForKey:@"nodeContent"]];

        NSNumber* result = nil;

        TestEnum result1;

        if (nodeContentValue !=nil){

            result1 = [SampleService_Enums StringToTestEnum:nodeContentValue];

            [nodeContentValue release];

            result = [[NSNumber alloc]initWithInt:(int)result1];

        }

        else{

            result = [[NSNumber alloc]initWithInt:-1];

        }

         if (target.proxyDelegate != nil){

            [target.proxyDelegate proxydidFinishLoadingData:result InMethod:@"getEnum"];

            return;

        }

    }

    @catch(NSException *ex){

        if (target.proxyDelegate != nil){

            [target.proxyDelegate proxyRecievedError:ex InMethod:@"getEnum"];

            return;

        }

    }

}

@end
 
Total Generated WSDL To Native Classes: 1875873 .
 
 
Estimated time saved for developers 1555210.5 Hours!
 



   Home   | Terms and Conditions of Use |    © Benjamin Aballay