2

I'm doing a simple change password through a web service project, using sudzc to generate the SOAP requests.

When I run the project, I just keep receiving nothing in the simulator.

Here's my code:

.h

#import <UIKit/UIKit.h>

@interface ChangePasswordViewController : UIViewController {
    NSString *CPstr1;
    NSString *CPstr2;
    NSString *CPstr3;


    IBOutlet UITextField *CPText1;
    IBOutlet UITextField *CPText2;
    IBOutlet UITextField *CPText3;


}

@property (nonatomic,retain) IBOutlet UITextField *CPText1;
@property (nonatomic,retain) IBOutlet UITextField *CPText2;
@property (nonatomic,retain) IBOutlet UITextField *CPText3;

@property (nonatomic,retain) IBOutlet UITextView *CPResult;


-(IBAction) CPSendString;

@end

viewcontroller.m

#import "ChangePasswordViewController.h"
#import "MINEHBJTService.h"

@implementation ChangePasswordViewController
@synthesize CPText1,CPText2,CPText3;
@synthesize CPResult;


//to send the user's old and new password to CPstr
-(IBAction) CPSendString{

    CPstr1 = [[NSMutableString alloc] initWithString:CPText1.text];
    CPstr2 = [[NSMutableString alloc] initWithString:CPText2.text];
    CPstr3 = [[NSMutableString alloc] initWithString:CPText3.text]; 



    MINEHBJTService *service = [[MINEHBJTService alloc] init];
    [service ChangePassword: self action: @selector(handleChangePassword:) 
                       sUserID:CPstr1 sPassWord:CPstr2  sNewPassword:CPstr3];      


    return;

}

-(void) hadleChanePassword:(int)value{

    int result = value;
    if(result==1){ 
        CPResult.text = @"Change password sucessed";
    }
    else {
        CPResult.text = @"Change password failed";
    }

}



// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {

    [super viewDidLoad];
}


- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


- (void)dealloc {
    [CPstr1 release];
    [CPstr2 release];
    [CPstr3 release];
    CPResult.text = @"";
    [ MINEHBJTService release]; 
    [super dealloc];
}

@end
nneonneo
  • 171,345
  • 36
  • 312
  • 383

1 Answers1

1

In the service call you define the callback method as handleChangePassword. However, the actual implementation of this method is mispelled as hadleChanePassword.

Fix the naming and you should start seeing something in the output field in the simulator.

pmartin
  • 2,731
  • 1
  • 25
  • 30