0
인증을 위해 비누 웹 서비스를 구문 분석하고 있지만 NSDF 데이터를 다시 작성할 필요가 없으므로 xml 파서를 writex 할 수 있습니다.비누 웹 서비스
내가 뭘 잘못하고 있는지 알려 주시기 바랍니다.
**
-(void)getAdvertisment
{
NSString* soapMesasge=
[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>"
"<GetAdvertisement xmlns=\"http://tempuri.org/\" />"
"</soap:Body>"
"</soap:Envelope>"];**
NSURL* url=[NSURL URLWithString:@"http://codeexsolutions.com/HosService/ServiceHOSProvider.asmx"];
NSMutableURLRequest* theRequest=[NSMutableURLRequest requestWithURL:url];
NSString* msgLength=[NSString stringWithFormat:@"%d",[soapMesasge length]];
[theRequest addValue:@"text/xml" forHTTPHeaderField:@"Content-Type"];
[theRequest addValue:@"http://tempuri.org/GetAdvertisement" forHTTPHeaderField:@"SOAPAction"];
[theRequest addValue:msgLength forHTTPHeaderField:@"Content-Length"];
[theRequest setHTTPMethod:@"POST"];
[theRequest setHTTPBody:[soapMesasge dataUsingEncoding:NSUTF8StringEncoding]];
NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if (theConnection)
{
webData =[[NSMutableData alloc]retain];
}
else
{
// Inform the user that the connection failed.
}
}
이 자신을 편집 할 수 있습니다 –
위의 코드는 당신이 원한다면 질문. – gideon
가능한 [soap web service parsing] 중복 (http://stackoverflow.com/questions/5456212/soap-web-service-parsing) –