Here is what the error looks like


2011-04-27 13:01:[url removed, login to view] AdvancedTableViewCells[920:207] Data return <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="[url removed, login to view]" xmlns:xsi="[url removed, login to view]" xmlns:xsd="[url removed, login to view]"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Server did not recognize the value of HTTP Header SOAPAction: [url removed, login to view]</faultstring><detail /></soap:Fault></soap:Body></soap:Envelope>


All we are trying to do is submit some variables to our web service and get a response back.

Here is what the code looks like

NSString *soapMessage = [NSString stringWithFormat:

@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"

"<SOAP-ENV:Envelope \n"

"xmlns:xsd=\"[url removed, login to view]\" \n"

"xmlns:xsi=\"[url removed, login to view]\" \n"

"xmlns:SOAP-ENC=\"[url removed, login to view]\" \n"

"SOAP-ENV:encodingStyle=\"[url removed, login to view]\" \n"

"xmlns:SOAP-ENV=\"[url removed, login to view]\"> \n"

"<SOAP-ENV:Body> \n"

"<ActivateApp xmlns=\"[url removed, login to view]\">\n"


"</ActivateApp> \n"

"</SOAP-ENV:Body> \n"


NSURL *url = [NSURL URLWithString:@"[url removed, login to view]"];

NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];

NSString *msgLength = [NSString stringWithFormat:@"%d", [soapMessage length]];

[theRequest addValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];

[theRequest addValue: @"[url removed, login to view]" forHTTPHeaderField:@"SOAPAction"];

[theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"];

[theRequest setHTTPMethod:@"POST"];

[theRequest setHTTPBody: [soapMessage dataUsingEncoding:NSUTF8StringEncoding]];

NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];

NSData *returnData = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:nil error:nil];

NSString *returnString = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding];

NSLog(@"Data return %@",returnString);

Compétences : Cocoa, iPad, iPhone, Objective-C

Voir plus : xcode initwithdata encoding, soap fault ios, ios soap, xcode soap, fault code soap xcode, ios delegate, soap encoding xcode, xcode soap ios, xcode c, error 0, xcode, soap, soap server, nil, ios code, ios a, ios 8, error, envelope, asmx, url fix, server ios, client server encoding, xmlns, ios recognize

Concernant l'employeur :
( 24 commentaires ) Montreal, Canada

N° du projet : #1039777

2 freelance ont fait une offre moyenne de 75 $ pour ce travail


please check your inbox...

100 $ USD en 1 jour
(12 Commentaires)

Hi, let me help you now. check PM please.

50 $ USD en 1 jour
(0 Commentaires)