error while soap request call

Posted by Jayshree on Stack Overflow See other posts from Stack Overflow or by Jayshree
Published on 2010-06-05T07:37:31Z Indexed on 2010/06/05 7:42 UTC
Read the original article Hit count: 398

Hello. I am trying to make a soap call. Its a very basic call wit Welcome User output. The return value is in xml format. and i am getting the following error. can anyone plz tell me what this error means.

The following code shows the soap request and post request that i have made

NSString *soapMessage = [NSString stringWithFormat: @"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<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/\">\n"
"<soap:Body>\n"
"<WelcomeXML xmlns=\"http://qa2.alliancetek.com/phpwebservice/index.php\">\n"
"<name>"
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<message>\n"
"<name>Hitesh</name>\n"
"</message>\n"
"</name>"
"</WelcomeXML>\n"
"</soap:Body>\n"
"</soap:Envelope>\n"];

NSLog(@"%@",soapMessage);

NSURL *url = [NSURL URLWithString:@"http://qa2.alliancetek.com/phpwebservice/index.php"];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
NSString *msgLength = [NSString stringWithFormat:@"%d", [soapMessage length]];
[theRequest addValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[theRequest addValue: @"http://qa2.alliancetek.com/phpwebservice/index.php/WelcomeXML" forHTTPHeaderField:@"SOAPAction"];
[theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"];
[theRequest setHTTPMethod:@"POST"];
[theRequest setHTTPBody: [soapMessage dataUsingEncoding:NSUTF8StringEncoding]];

Following is the Error that i am getting :

<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body><SOAP-ENV:Fault><faultcode xsi:type="xsd:string">SOAP-ENV:Client</faultcode><faultactor xsi:type="xsd:string"></faultactor><faultstring   xsi:type="xsd:string">error in msg parsing:
XML error parsing SOAP payload on line 5: Reserved XML Name</faultstring><detail  xsi:type="xsd:string"></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

plz help me. I have wasted 2 days on a simple code like this.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about web-services