-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client fails to parse large, complex response #42
Comments
Thanks for the quick response. Yep, the xml response is chunky. I already tried ^HEAD instead of the npm package, because there seemed to be related issues. Same result. |
Here is a little interoperability test, demonstrating the issue: https://gist.github.com/1856367 It spawns a python xmlrpc server and pumps arguments through it. The results are compared with the input. The implementation is a bit sloppy, but a functional test like this would make a good extension to the existing test suite. The test requires isaacs slide and the xmlrpc module ... obviously ... |
I've added your XML as a test case locally and have been trying to debug the issue. I'm getting the null response you were even when the data isn't chunked. I don't have a definite idea what the issue is yet, but my current thought is the deserializeParams callback is being fired prematurely. My best guess right now is a callback issue when deserializing array params. I'm hoping tomorrow I can take another look and try to at least remove as much of the XML as possible yet still get the error. This should help stepping through the program. |
Thanks for the update. In the meantime I've rewritten the parser/unmarshalling part. It is loosely modeled after pythons xmlrpclib. It passes all tests including the nasty one in question. It's non-strict like yours. It uses a stacks (actually two stacks) to reconstruct the data structure. The main advantage is that it is much easier to understand what is going on. It still has a few loose ends but you might want to take a look: https://github.com/agnat/node-xmlrpc/blob/master/lib/unmarshall.js What do you think? On 18.02.2012, at 23:52, Brandon Alexander wrote:
|
You have made my day @agnat! I think unmarshalling is a much better solution than the current XML-RPC parsing algorithm. Here's a few of my thoughts on the file:
I would be happy to make these changes or you can make some of them and send a pull request in. |
Great you like it. I think it's easier if you do the rest. Most of it is a matter of style and personal preference and you know best how you like it. And, to be honest, I'd like to return to the task at hand...
I also have a few small feature/change requests to get this thing fit for production:
I think although it is a bit old fashioned xmlrpc still is a very important protocol and it would be great to get this thing ship-shape. |
Fixed in 74bf8f2. The new deserializer correctly handles arbitrarily nested data structures. One thing still missing is a good test. There is a small grinder test but it didn't catch this issue. Maybe we should just add the large XML above as a test case. What do you think? |
I added a test case with your XML method response. I wrote the output from the unmarshaller to a file as JSON. Really, though, the JSON should come from something like Python's XML-RPC module for actual verification. That said, the deepEqual is failing when comparing the JSON with the unmarshaller's results (I commented out the comparison for now). It's probably something simple I missed, I can take a deeper look tomorrow evening. |
When comparing UTC dates, date.iso8601 types should specify UTC offset.
I believe this is fixed with PR #81. If any issues still, please comment or file another issue. |
Instead of an response object I just get
null
.I gisted the response XML here: https://raw.github.com/gist/1852071/c6195cd12be6d77be16b68a26e183ae9a76b9195/gistfile1.txt
Would be great if you could take a look.
Cheers,
agnat
The text was updated successfully, but these errors were encountered: