29,031
社区成员
发帖
与我相关
我的任务
分享
//接收服务返回的数据NSMutableData receivedData
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
if (isRequestSuccess) {
//NSString *responseResult = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];通过这句可以
//查看到服务段返回的string信息。
if(data.length > 0){
if(receivedData == nil){
receivedData = [NSMutableData dataWithData:data];
}
else {
[receivedData appendData:data];
}
}
}
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
if (isRequestSuccess) {
if (receivedData.length==0)//这里报EXC_BAD_ACCESS异常,卡住走不下去
{
return;
}
//略
}
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<VerifyUserResponse xmlns="www.orage.com">
<VerifyUserResult>
{"ID":1,"UserBM":"manager","UserName":"小A","Description":"A员","PassWord":"2323","IsManager":false,"StopTag":false,"DepartID":2,"SearchCode":"JSZC","Sex":false,"SexMan":true,"OfficePhone":"0816-2471190","MobilePhone":"434348","Fax":"343434","Email":"adf@126.com","Address":null,"PostalCode":"2323","Birthday":"0001-01-01T00:00:00","CheckAgentUserID":0,"DefOwhsID":61,"CanInPrice":true,"ISRemoteUser":false,"MacAddress":null,"CheckAgentUserName":null,"CanSave":false,"CanOrderCardName":false,"OverDays":0,"DeptName":"","StopTagString":"","IsDefault":false,"LoginMessage":null,"LoginNum":1,"LoginGuid":"4EC7-9BC1-34E9650CB398","OnlineUsers":[{"UserID":"1","UserBM":"man","UserName":"小A","DepartID":"2","DepartName":""}],"DeptPowerIds":null,"AuthCode":"yx/VwXCABG4qFygrC9PB1TZLhx1tTwIbBFc1USDzdjkXkATJcNzL8YV9LRCg2Ffb9ZDJVd95Px4wtKKkiaApKOyooSlSsGRbRc6mbbsvTCquL0emaUfR9L5jShDGDa2f23OgGW9/dbenr7FQ95l7icrY"}
</VerifyUserResult>
</VerifyUserResponse>
</s:Body>
</s:Envelope>