このコードを自分のコードに置き換えます。
-(void) createconnection {
NSAutoreleasePool *pool = [NSAutoreleasePool new];
NSString *soapMsg = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
"<soap:Body>"
"<GetFlightDetailforSQAR xmlns=\"http://tempuri.org/\">"
"<FlightNo>100</FlightNo>"
"<UserBadgeNo>500</UserBadgeNo>"
"</GetFlightDetailforSQAR>"
"</soap:Body>"
"</soap:Envelope>"];
NSURL *url = [NSURL URLWithString: @"http://74.54.137.138:3052/Service.asmx?op=GetFlightDetailforSQAR"];
NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url];
NSString *msgLength = [NSString stringWithFormat:@"%d", [soapMsg length]];
[req addValue:@"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[req addValue:@"http://tempuri.org/GetFlightDetailforSQAR" forHTTPHeaderField:@"SOAPAction"];
[req addValue:msgLength forHTTPHeaderField:@"Content-Length"];
[req setHTTPMethod:@"POST"];
[req setHTTPBody: [soapMsg dataUsingEncoding:NSUTF8StringEncoding]];
conn = [[NSURLConnection alloc] initWithRequest:req delegate:self];
if (conn) {
webData = [[NSMutableData data] retain];
}
[pool release];
}
}
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName 名前空間URI:(NSString *)namespaceURI 修飾名:(NSString *)qName 属性:(NSDictionary *)attributeDict
{
NSLog(@"START ELEMENT :%@",elementName);
}
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)文字列
{
NSLog(@"String %@",string);
}
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI modifiedName:(NSString *)qName
{
NSLog(@"END ELEMENT :%@",elementName);
}