I am trying to parse the soap web service for authentication and the following code is
currentElement = [[NSString alloc] init]; NSString * Email = [NSString stringWithFormat: @ "sbhushan@gmail.com"]; NSString * password = [NSString stringWithFormat: @ "5Pb and Q? 4t"]; NSString * Soap Message [[NSString stringWithFormat: @ "& lt ;? Xml version = \" 1.0 \ "encoding = \" utf-8 \ "? & Gt; "& Lt; 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/ \ "& gt;" "& lt; soap: body & gt;" "& Lt; authentication xmlns = \" http: //tempuri.org/ \ "& gt;" "& Lt; userId>% @ "& Lt; password & gt;% @ & lt; / password & gt;" "& Lt; / Authentication & gt;" "& Lt; / soap: body & gt;" "& Lt; / soap: envelope>", email, password]; NSURL * url = [NSURL URLWithString: @ "http://codeexsolutions.com/HosService/ServiceHOSProvider.asmx"]; NSMutableURLRequest * theRequest = [NSMutableURL request request withURL: url]; NSString * msgLength = [NSString stringWithFormat: @ "% d", [SOAP month length]]; [TheRequest addValue: @ "text / xml" for HTTP headerfile: @ "content-type"]; [TheRequest addValue: @ "http://tempuri.org/Authentication" forHTTPHeaderField: @ "SOAPAction"]; [TheRequest addValue: msgLength forHTTPHeaderField: @ "content-length"]; [TheRequest set HTTP method: @ "post"]; [TheRequest set HTTPBD: [SOAP message data usage encoding: NSTF 8 string encoding]]; NSURLConnection * theConnection = [[NSURLConnection alloc] initWithRequest: theRequest Representative: Self]; If (concession) {webData = [[NSMUtableDataAloc] is maintained); } Else {// inform the user that the connection has failed. } and applied all the delegation method of parsing but did not get in the call
- (zero) connection: (NSURLConnection *) connection was Received: (NSDT * ) Data {[WebDataApendData: data]; }
or is not receiving any data
Hi friends Do not know why the method seems to be working properly, so you can see any data on the console ?? Try it or look at webservices, the data may not come from there
NSString * soapMessage = [NSString stringWithFormat: @ "& lt ;? Xml version = \" 1.0 \ "encoding = \ "UTF-8 \"? & Gt; 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/ \ "& gt; & lt; Soap: Body & gt; GetLientData xmlns = \" Http: // tempuri Org / \ "& gt; & lt; p Search & gt;% @ & lt; / p Search & gt; & lt; / GetClientData & gt; & lt; / Soap: Body & gt; Lt; / soap: envelope & gt; \ n ", nameInput.text]; NSURL * url = [NSURL URLWithString: @ "http://192.168.1.162/iphone/service.asmx"]; NSMutableURLRequest * theRequest = [NSMutableURL request request withURL: url]; NSString * msgLength = [NSString stringWithFormat: @ "% d", [Soap Message Length]]; [TheRequest addValue: @ "text / xml; charset = UTF-8" forHTTPHeaderField: @ "content-type"]; [TheRequest addValue: @ "http://tempuri.org/GetClientData" forHTTPHeaderField: @ "SOAPAction"]; [TheRequest addValue: msgLength forHTTPHeaderField: @ "content-length"]; [TheRequest set HTTP method: @ "post"]; [TheRequest set HTTPBD: [SOAP message datouping encoding: NSTF 8 string encoding]]; NSURLConnection * theConnection = [[NSURLConnection alloc] initWithRequest: theRequest Representative: Self]; If (connection) {webData = [[NSMutableData data is maintained]); } And {nslog (@ "connection to connection"); }
Comments
Post a Comment