0
비누 전화를하려고합니다. 그것의 아주 기본적인 호출 위트 사용자 환영 출력. 반환 값은 xml 형식입니다. 다음과 같은 오류가 발생합니다. 누구든지이 오류가 무엇을 의미하는지 말해 줄 수 있습니다.비누 요청 요청 중 오류
<?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 도와 :
다음 코드는 내가 무엇입니까 오류가 난 다음
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://www.somewebsite.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://www.somewebsite.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://www.somewebsite.com/phpwebservice/index.php/WelcomeXML" forHTTPHeaderField:@"SOAPAction"];
[theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"];
[theRequest setHTTPMethod:@"POST"];
[theRequest setHTTPBody: [soapMessage dataUsingEncoding:NSUTF8StringEncoding]];
를 만든 비누 요청 및 게시 요청을 보여줍니다. 이런 간단한 코드로 2 일을 낭비했습니다.
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
이 dubbled된다
웹 서비스가 xml 입력을 예상하기 때문입니다. 그래서 나는 webservice 요청에이 태그를 작성했습니다. – Jayshree