XML-RPC Datamapper problem |
[eluser]Unknown[/eluser]
Hey there, I'm new to CI + Datamapper and XML-RPC so forgive me if I have made an newbie error. I have read through all the posts I could find on XML-RPC issues but couldn't find a solution, though I found similar issues in http://ellislab.com/forums/viewthread/78177/ and http://ellislab.com/forums/viewthread/63287/. I tried the solutions there but to no avail. I am trying to setup a test with XML-RPC requests from a client class coming in to a server class which then uses Datamapper to get data from the database and return it. However, when I run it I get this error: Code: ---DATA--- I think I am having the same issue mentioned in the related posts (see above), where there is an extra line added for reasons unknown to the top of the xml data. The XML-RPC spec requires that the first line contains the <?xml version="1.0" encoding="UTF-8"?> info and this extra line at the top seems to be causing the error. If I comment out all references to the 'user' object and model then it works (lines 8, 18, 32, 33, 35 of the server class 'User_controller') - there is no extra line at the top of the xml data. However if I un-comment any one of them, then it doesn't work , with the exception being line 27 (I noticed though there is an extra line added to the bottom of the xml data): Code: $u = new User(); // this works!?! method Here are the classes. Server class Code: <?php Client Class Code: <?php Where is this extra line coming from? Is it a bug or am I missing something obvious here? Any help would be much appreciated. PS. Using CI v.1.7.1, DataMapper v.1.6.0, PHP v.5.1.6, MySQL v.5.0.68 Cheers, Matt
[eluser]tomcode[/eluser]
Don't know neither XML-RPC nor Datamapper, but it looks to me like Your User library might have some whitespace outside the PHP tags.
[eluser]Unknown[/eluser]
[quote author="tomcode" date="1250258545"]Don't know neither XML-RPC nor Datamapper, but it looks to me like Your User library might have some whitespace outside the PHP tags.[/quote] Yes!!! Thanks tomcode, that was the issue. My 'user' model class had trailing white-space on the same line as the closing php tag. Code: <?php Thanks again for your help tomcode. Cheers, Matt |
Welcome Guest, Not a member yet? Register Sign In |