Welcome Guest, Not a member yet? Register   Sign In
XMLRPC - Root element missing
#6

I have now written this:


PHP Code:
public function reportuser($request)
    {
        
        
$zsite $this->load->database('grid'TRUE);
        
        
        
$xmlrpc_server xmlrpc_server_create();
        
        
xmlrpc_server_register_method($xmlrpc_server"reportuser",
 
                             "processreport");
                             
 
                              
        $request_xml 
file_get_contents("php://input");
        
        
$zsite->query("INSERT INTO TEST_PARAMS VALUES ('$request_xml')");    
        
        
xmlrpc_server_call_method($xmlrpc_server$request_xml'');
        
xmlrpc_server_destroy($xmlrpc_server);
        
    }
    
    function 
processreport($method_name$params$app_data)
    {
        
$req        $params[0];
        
        
$regionName = (string)$req['regionName'];
        
$abuserID = (string)$req['abuserID'];
        
$category = (int)$req['catagory'];
        
$checkflags = (int)$req['checkflags'];
        
$details = (string)$req['details'];
        
$objectID = (string)$req["objectID"];
        
$position = (string)$req['postion'];
        
$reportType = (int)$req['reportType'];
        
$screenshotID = (string)$req['screenshotID'];
        
$Summary = (string)$req['Summary'];
        
$reporter = (string)$req['reporter'];
        
        
$result $zsite->query("INSERT INTO reports VALUES (NULL, NOW(), '$regionName', '$abuserID', '$category', '$checkflags', '$details', '$objectID', '$position', '$reportType', '$screenshotID', '$Summary', '$reporter')");
        
        
$response_xml xmlrpc_encode(array(
        
'success'      => $result,
        
'errorMessage' => get_error_message($result)
        ));

        print 
$response_xml;
        
        
    } 

The entry in the TEST_PARAMS db actually seems to paste the xml, but the error on the client is the same regardless. I'm sure that is progress, but I cannot interpret what exactly it means for the ci implementation of xmlrpc.

Code:
<?xml version="1.0" encoding="us-ascii"?><methodCall><methodName>reportuser</methodName><params><param><value><struct><member><name>objectID</name><value><string>00000000-0000-0000-0000-000000000000</string></value></member><member><name>checkflags</name><value><i4>0</i4></value></member><member><name>catagory</name><value><i4>31</i4></value></member><member><name>postion</name><value><string>&lt;128, 128, 21.83269&gt;</string></value></member><member><name>reporter</name><value><string>25f196a0-8dcd-4b9a-9191-4207bc9e9d95</string></value></member><member><name>abuserID</name><value><string>ae0a4aa1-20c4-478d-8e12-77839fc706f9</string></value></member><member><name>reportType</name><value><i4>3</i4></value></member><member><name>regionName</name><value><string /></value></member><member><name>details</name><value><string>V5.1.7.55786

Abuser name: test test
Abuser location: test
TEST</string></value></member><member><name>Summary</name><value><string> |Test Island|  [Age]  {test test}  "TEST"</string></value></member><member><name>screenshotID</name><value><string>2a86a4d0-d2ea-3999-6480-dd82a793a8bc</string></value></member></struct></value></param></params></methodCall>

Code:
[USER REPORTS]: Unable to connect to user reports server https://localhost/Report/reportuser/. Method reportuser, params System.Collections.Hashtable. Exception System.Xml.XmlException: Root element is missing.
 at System.Xml.XmlTextReaderImpl.Throw (System.Exception e) [0x00027] in <ced3fc41915941499fefff29c0824046>:0
 at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo (System.String res) [0x00017] in <ced3fc41915941499fefff29c0824046>:0
 at System.Xml.XmlTextReaderImpl.ParseDocumentContent () [0x0035d] in <ced3fc41915941499fefff29c0824046>:0
 at System.Xml.XmlTextReaderImpl.Read () [0x0008c] in <ced3fc41915941499fefff29c0824046>:0
 at System.Xml.XmlTextReader.Read () [0x00000] in <ced3fc41915941499fefff29c0824046>:0
 at Nwc.XmlRpc.XmlRpcResponseDeserializer.Deserialize (System.IO.TextReader xmlData) [0x00098] in <97406e23762445718593faf816975602>:0
 at Nwc.XmlRpc.XmlRpcRequest.Send (System.String url, System.Int32 timeout) [0x000a1] in <97406e23762445718593faf816975602>:0
 at UserReports.UserReportsModule.GenericXMLRPCRequest (System.Collections.Hashtable ReqParams, System.String method, System.String server) [0x00018] in <3c9e8f6a8b4741ca9d52f111ddd00deb>:0
I am still lost as to why it would give me the same error on basically the same implementation as the procedural code I initially received.
Reply


Messages In This Thread
XMLRPC - Root element missing - by Tampa - 08-31-2018, 08:03 PM
RE: XMLRPC - Root element missing - by ciadmin - 08-31-2018, 09:24 PM
RE: XMLRPC - Root element missing - by Tampa - 09-02-2018, 09:45 PM
RE: XMLRPC - Root element missing - by ciadmin - 09-02-2018, 11:18 PM
RE: XMLRPC - Root element missing - by Tampa - 09-05-2018, 09:07 AM
RE: XMLRPC - Root element missing - by Tampa - 09-07-2018, 06:24 AM
RE: XMLRPC - Root element missing - by Tampa - 09-07-2018, 09:31 AM
RE: XMLRPC - Root element missing - by ciadmin - 09-07-2018, 10:01 AM
RE: XMLRPC - Root element missing - by Tampa - 09-07-2018, 01:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB