如何在iOS中解压缩字符串数据?

时间:2014-11-05 09:48:54

标签: ios iphone web-services soap unzip

你能帮帮我吗? 我有解压缩字符串数据的问题。

我尝试了大量用于解压缩字符串数据的代码但是我无法找到解决方案。

我正在尝试解析soap web服务中的数据。它将返回以下数据:

<?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><TestGetNearByDonorListResponse xmlns="tempuri.org">
<TestGetNearByDonorListResult>H4sIAAAAAAAEAM2YXW/iOBSG71fa/3DExWpXk5jYcb66lJFpaGGAUIWg7l66JBSr+UBOKJ399etAmWlHfO3MaNWbtHZOiPGj9z2vaX18zlJ4SmQpivyygZHRgCSfFbHIHy4bq2quY7vxsf3rLy0mJf88nnfSooj9RFUk/XxegHo8Ly+ey/iysaiq5UWzuV6v0dpEhXxoEsPAzb9Gw8lskWS88aVYnC7WRV5WPJ8lDfVygNY3791M1tNS1Symfb+NPUpbza/jNwUBz5K2zzp3bNjXRyzw+7vSzZ03tSyOZVKW7dGqWhRFBddC7YdcwlBkokpibbDgpeQQFAiIYToa3MhilcdwrVYoNRgvl0WpCiEQ6uMeuRTQWfA1zzW4WvBVxVMOYcFjDYKES+jF8xl0VCGCEc9jAT6/X/NU7Na3W82bJd4ugqKNbdslhGDD3dVupl8Kh7xqEw95tuG1mvVgN1/kD22HIttz1XZtRi93fLHd8LZFLIoMFx6zVvPL5O79NYb6Cy/b7IN679fh7lOKvJBXakOqtlrXq9GGYnMfxjPYOp59nG3AwjsWML3Hwr/V3++niyfVC0m/LHWi+auYw1WRLdPkWdsQG2fwSQBbJ0lVaiEX6Zp/3hINuFScuaY2ray0TyKPT1M0sO1SQil2jCMYLQ/vw2gjrLbmEEbTJsghP4yR/DyMruUdx9jrT1ioT8MOC6A7iVjUPU1yMivA9TRFUpY7djCFLvTFi8YmXOQCJlti0BMll2fJixDqma53hAs292GxkEMd6yAW10L2D1PBP1NczgkqLJj0z5cWHNJWTco2jCa2v6HF7ounBAYIrhBEks+qQiLo8bw8zwZNZVimQY5xMkxzLyjP8g6CooaBjB/Xz88jRahxosWF417EBvrVeBpGEI6Z/x1GWMXK71ayet2lJvdCtSeRw/ZZZYTPFUQF9FXH4vmmf+lhsaj44zmOR2yiE8vC9DAyF7keoXstT3khOYjMIsjF7wgZNk3rOLKoP2QDCNgNCyHo3oHfHfbOSCdvQ4evriqRXIDFmqalQSRS/ggBf+CyJrgGP0kXAj4CxipluXAOJUwsz7UpPdyXXGSb7h5GDjK8zY29jCyDqFjynhi55gkD7LCbW7YVlD7qdsNpdBrQA5ojyFVIpJqld5REHpa8gvr7xpDXmsqSShawTPk//CzR4Fr+JjWP4PAcc59mHJX2DPswDxMZ5jvi4bgnJBOyEbudqqsesVF/GDB/eprHF4nQTf95q59oIeTqiaeputR5IeUqO4Q848uV5Fmd3JM856LuXkadNSKeiTTn8Qp+h06yUEkPbkWa8s/q6SqpwyL8cQZUSqnK7yorHDNCm3pkL1RskoPZr4b6rkRGXgWpA8ez2vj0AQuZOqVtDfE01UGPTUIGwRiIQxXVcDwNfLgejsehMj426rDQV8Y6YuGgG4Gm/ukHcNUb3w00ePMqbWu8oCuD9OhZ/qgDIZ5JbEyP0HOIvRcecY4IkqL3pEesjpnH0U0UhSjsb3fyvzvkjDRt+I1nyz9hPleQZkleSZ5CxuVjUmmlOnBX6hid1+3sTKu0T1qljferyjHxkdZlI5P+TyeqVnP/Ty7tfwE0X920tBEAAA==   
</TestGetNearByDonorListResult>
</TestGetNearByDonorListResponse>
</soap:Body>
</soap:Envelope>

我想解析SOAP Web服务&amp;在Array中获取数据。 数据字符串返回zip格式。那我怎么解压字符串数据?

谢谢

1 个答案:

答案 0 :(得分:0)

该字符串是zip文件的base64格式,你需要先解码那个base64,然后你才能解压缩该文件