Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it necessary to create soap message when using ASIFormDataRequest/ASIHTTPRequest?
    primarykey
    data
    text
    <p>I used NSURLConnection to communicate with Soap webservice and it worked fine.</p> <p>Now I am using ASIFormDataRequest and I am not getting is it necessary to create soap message for that? and I am not aware what is SoapAction.</p> <p>Here is the code I am using</p> <pre><code>NSURL *url = [NSURL URLWithString:@"http://SERVERNAME.com/WEBSERVICENAME"]; [self setFrmdataReq:[ASIFormDataRequest requestWithURL:url]]; [frmdataReq setRequestMethod:@"POST"]; [frmdataReq addRequestHeader:@"Content-Type" value:@"text/xml; charset=utf-8"]; [frmdataReq setPostValue:txtField.text forKey:@"city"]; [frmdataReq setDelegate:self]; [frmdataReq setDidFinishSelector:@selector(requestFinished:)]; [frmdataReq setDidFailSelector:@selector(requestFailed:)]; [frmdataReq startSynchronous]; </code></pre> <p>UPDATE</p> <p>Soap Message I used,</p> <pre><code>NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; NSString *soapMessage = [NSString stringWithFormat:@"&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\ &lt;soap12:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap12=\"http://www.w3.org/2003/05/soap-envelope\"&gt;\ &lt;soap12:Body&gt;\ &lt;getCityTime xmlns=\"http://www.Nanonull.com/TimeService/\"&gt;\ &lt;city&gt;%@&lt;/city&gt;\ &lt;/getCityTime&gt;\ &lt;/soap12:Body&gt;\ &lt;/soap12:Envelope&gt;",txtField.text]; NSString *msgLength = [NSString stringWithFormat:@"%d",[soapMessage length]]; [request addValue:@"text/xml" forHTTPHeaderField:@"Content-Type"]; [request addValue:msgLength forHTTPHeaderField:@"Content-Length"]; [request setHTTPMethod:@"POST"]; [request setHTTPBody:[soapMessage dataUsingEncoding:NSUTF8StringEncoding]]; NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:request delegate:self]; if(conn) { responseData = [[NSMutableData data]retain]; NSLog(@"connection successful"); } else NSLog(@"connection fail."); </code></pre> <p>I didn't defined SOAPAction as I don't know anything about that.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload