Я получаю данные с веб-сервера .net следующим образом.
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GenericAndroidMethodResponse xmlns="Mortgage"><GenericAndroidMethodResult><NewDataSet>
<Table>
<LoanOfficerID>3581</LoanOfficerID>
<FirstName>Venkat</FirstName>
<LastName>Sreenu</LastName>
<Address1>d</Address1>
<City>d</City>
<State>Alabama</State>
<WorkPhone>19999999999</WorkPhone>
<Country>United States</Country>
<EmailAddress>ensisinfo@ensis.com</EmailAddress>
<companyName>ensisinfo</companyName>
<CompanyURL>www.ensisinfo.com</CompanyURL>
</Table>
</NewDataSet></GenericAndroidMethodResult></GenericAndroidMethodResponse></soap:Body></soap:Envelope>
Но я проверяю в браузере, передавая параметры XML и имя метода, которое я получаю вот так.
<NewDataSet> <Table> <LoanOfficerID>3581</LoanOfficerID> <FirstName>Venkat</FirstName> <LastName>Sreenu</LastName> <Address1>d</Address1> <City>d</City> <State>Alabama</State> <WorkPhone>19999999999</WorkPhone> <Country>United States</Country> <EmailAddress>ensisinfo@ensis.com</EmailAddress> <companyName>ensisinfo</companyName> <CompanyURL>www.ensisinfo.com</CompanyURL> </Table> </NewDataSet>
Я использую NSUrlRequest
NSURL * url = [NSURL URLWithString: @ "http://173.31.193.92/MobileGenericWebservice/GenericWebService.asmx"]; NSMutableURLRequest * theRequest = [NSMutableURLRequest requestWithURL: url]; NSString * msgLength = [NSStringith% = NSStringW% = строка dSSTringWW)[длина soapMessage]];
[theRequest addValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[theRequest addValue: @"Mortgage/GenericAndroidMethod" forHTTPHeaderField:@"SOAPAction"];
[theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"];
[theRequest setHTTPMethod:@"POST"];
[theRequest setHTTPBody: [soapMessage dataUsingEncoding:NSUTF8StringEncoding]];
почему я так получаю.
Может кто-нибудь, пожалуйста, помогите мне.