hi
I am in big trouble now. i have to post data on a sharepoint using iphone and a webservice which is crated by .net
suppose this is my webservice "http://192.168.0.58:301/_layouts/AppleIphoneService.asmx"
NSURL *url = [NSURL URLWithString:@"http://192.168.0.58:301/_layouts/AppleIphoneService.asmx"];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
and what i have to do is i have to pass an url say "http://moss2010:301/Docs/Lists/WorkSheet/calendar.aspx" as string with soap msg
and when i am passing it raising error of "Access denied"
because sharepoint having credential.
this is what i am doing.....
NSString *Url=@"http://192.168.0.58:301/Docs/";
NSString *list=@"WorkSheet";
NSString *tt=@"Meeting";
NSString *stdt=@"2010-08-12-14-00-00";
NSString *Endt=@"2010-08-12-15-00-00";
NSString *City=@"NY";
NSString *Des=@"This is meeting for getting final payment";
soapMessage= [NSString stringWithFormat:
@""
""
""
""
"%@"
"%@"
"%@"
"%@"
"%@"
"%@"
"%@"
""
""
"",Url,list,tt,stdt,Endt,City,Des];
NSLog(@"SOAP MESSAGE:%@",soapMessage);
NSURL *url = [NSURL URLWithString:@"http://192.168.0.58:301/_layouts/AppleIphoneService.asmx"];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
NSString *msgLength = [NSString stringWithFormat:@"%d",[soapMessage length]];
[theRequest addValue:@"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[theRequest addValue:@"http://tempuri.org/AddCalendarItem" forHTTPHeaderField:@"SOAPAction"];
[theRequest addValue:msgLength forHTTPHeaderField:@"Content-Length"];
[theRequest setHTTPMethod:@"POST"];
[theRequest setHTTPBody:[soapMessage dataUsingEncoding:NSUTF8StringEncoding]];
NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if(theConnection){
webData = [[NSMutableData data] retain];
NSLog( @"connection established");
}
else {
NSLog(@"theConnection is NULL");
}
My Question is how to use such url having credential?