Open GoogleCodeExporter opened 9 years ago
The reason: WTClient (delegate) did not automatically call the function
"parserDidEndDocument", you need to
add the following to call it manually: (file WTClient.m)
[self parserDidEndDocument:xmlParser];
More detail:
- (void)HTTPConnection:(WTHTTPConnection *)connection
didReceiveResponse:(NSDictionary *)response
{
self.currentResponse = response;
if (connection == self.propertiesConnection)
{
//get properties from response body and report about to delegate when finished
NSXMLParser *xmlParser = [[[NSXMLParser alloc] initWithData:[response
valueForKey:@"responseBody"]] autorelease];
[xmlParser setDelegate:self];
[xmlParser parse];
[self parserDidEndDocument:xmlParser];
}
else if (connection == self.uploadConnection || connection == self.downloadConnection)
{
if ([self.delegate respondsToSelector:@selector(transferClientDidFinishTransfer:)])
{
[self.delegate transferClientDidFinishTransfer:self];
}
}
}
Regards, :)
SonTH
Original comment by tranhoai...@gmail.com
on 6 Oct 2009 at 2:20
I just tried this in simulator 3.0 and it seems to work fine (at least with
Mobile Me servers).
parserDidEndDocument is called only when the XML was parsed successfully. If
it's not called, that means an
error occurred while parsing. Can you post an error message here
(xmlParser.parserError)?
Probably the webdav server you are using generates some weird XML which does
not get handled properly by
NSXMLParser.
Original comment by alex.chu...@gmail.com
on 7 Oct 2009 at 2:34
i meet the same issue, after debug i found the reason is:
1. webdav server is HTTPS and need an authentication.
2. first time do preparePropertiesConnection, it failed at do authentication.
3. after finished authentication, the response for authentication is empty at
responseBody.
So it will not call NSXMLParser delegate parserDidEndDocument.
Original comment by bygree...@gmail.com
on 7 Feb 2011 at 6:15
Original issue reported on code.google.com by
maigi...@gmail.com
on 6 Oct 2009 at 11:16