skolodyazhnyy / symfony-rpc-bundle

Simple JSON and XML RPC Server/Client implementation for Symfony 2
MIT License
25 stars 22 forks source link

ArrayType and StructType not working properly? #6

Closed flowlive closed 10 years ago

flowlive commented 10 years ago

when trying to send a xml file with param array in it, i get this faultmsg back from the server:

<?xml version="1.0" encoding="UTF-8"?>

faultCode0faultStringNotice: Trying to get property of non-object in /var/www/html/symfony/vendor/seven/symfony-rpc-bundle/Seven/RpcBundle/XmlRpc/ValueType/ArrayType.php line 41

Also, trying to send a simple struct and returning sizeof(struct) gives back 0 in the methodResponse.

Are these known issues or am i just overseeing something with these two types? Am i doing something wrong?

ghost commented 10 years ago

I've also had the problem that the result from methodResponse is empty, when the XML-Response had whitespace. I've made a pull request to fix it, maybe this will solve your problem too.

skolodyazhnyy commented 10 years ago

@flowlive It seems that you didn't wrap your array content into data element. But specification says that it's mandatory - http://xmlrpc.scripting.com/spec.html.

If you sure that your XML request is valid, please show me your case to help me reproduce this error.

Thanks!

flowlive commented 10 years ago

Hi skolo :) thank you both for your replies. I really appreciate it, since i use this(/your) bundle in my Bachelor Thesis.

Here is what i found out, after chrisank pointed out an issue with whitespaces: if the Xml file has any kind of whitespace(normal, tab or linebreak, doesnt matter) between the opening array-tag and the following opening data-tag(yes, i did wrap it ;-> ), i get the fault response(see opening post). If I remove the whitespaces between those two opening tags, everything works like a charm :) So i guess there is some kind of error in the parsing routine?!?

I will do further tests, and let you know if anything else crashes ;-)

EDIT: okay, i found a similar bug within the struct type. There are no whitespaces allowed between any tags in a struct as far as my testings go.

skolodyazhnyy commented 10 years ago

@flowlive @chrisank thanks for pointing on an important problem with bundle. I have pushed a fix. Feel free to reopen the ticket if problem is not resolved.

Thanks and good luck