Hi!
I have a form in my iPhone application which contains three textFields and a post-button, of course.
I have built two WebMethods in a WebService, I have tried both from my local PC. They works perfectly. The methods are:
- TestAddData - no parameters
- AddObject(string name, string address, string phoneNumber)
I know wonder how to call this web services from my iPhone application. The current code:
NSURL *url = [[NSURL alloc] initWithString:@"http://www.domain.com/Service.asmx"];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request startSynchronous];
// Parameters:
//[request setPostValue:@"value" forKey:@"parameterInMethod"];
//[request setPostValue:@"value" forKey:@"parameterInMethod"];
Edit: I figured out how to select which method to call. The code for that was:
[request setRequestMethod:@"TestAddData"];
But it returns 403 - Forbidden. The Service.asmx-file is read and write.
Both my WebMethods is public. TestAddData is "public string", and AddObject is "public void".