我在使用Web服务Web服务接收空数据的iOS
有一个非常奇怪的情况这是我的Xcode项目文件 https://dl.dropbox.com/u/9507586/FubonTest.zip
我得到的回应从下面的服务器返回。
2013-03-04 15:56:18.473 FubonTest[1059:f803] 1: connection: didReceiveResponse
2013-03-04 15:56:18.473 FubonTest[1059:f803] 2: connection: didReceiveData
2013-03-04 15:56:18.699 FubonTest[1059:f803] 2: connection: didReceiveData
2013-03-04 15:56:18.699 FubonTest[1059:f803] 3: Done. Received Bytes: 1789
2013-03-04 15:56:18.700 FubonTest[1059:f803] Return (null)
我确实收到了字节,但是xml标签文件为空。服务器端的人告诉我他们使用utf-8编码,但它只是返回null。如果我使用ascii编码,返回的数据不是null,但它不是我期望的xml标签文件。
正确的返回xml标签文件应该如下。 返回的xml标记文件使用eclipse(窗口版本)Web服务函数。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:RegistResponse xmlns:ns1="http://service.fubon.com" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<RegistReturn xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="soapenc:string">该用户未投保</RegistReturn>
</ns1:RegistResponse>
</soapenv:Body>
</soapenv:Envelope>
有人可以帮我整理一下吗?
你能发布一些培训相关的代码?可能从响应中获取数据的位置,不太可能有人会涉足整个项目。 – 2013-03-05 02:30:27