My guess is that this could just be an OpenSimulator bug, though I'm surprised it hasn't shown up before. I presume this always happens to you?

Could you open a Mantis with the PHP and the LSL script code if possible?

-- Justin

On 22/10/14 23:48, Jeff Kelley wrote:
Dear developers.

I use XML-HTTP with success, except a HTTP 400 error is appended to the 
(otherwise correct) XML response. Example:

llRemoteDataReply(channel, message_id, "Je vous ai compris", 42);

My PHP program reads:

<?xml version="1.0"
encoding="utf-8"?><methodResponse><params><param><value><array><data><value><struct><member><name>IntValue</name><value><i4>42</i4></value></member><member><name>StringValue</name><value><string>Je
vous ai
compris</string></value></member></struct></value></data></array></value></param></params></methodResponse>HTTP/1.0
 400
BadRequest: Invalid request line.

I can strip the extra data and go as-is, but I would prefer to understand what triggers 
"Invalid request line" to fix my
code.

Can you help?

-- Jeff



Full PHP code:


<?php
$req_url = 'http://192.168.0.6:20800/';

$request = xmlrpc_encode_request('llRemoteData',
     array ('Channel' => '71c0838f-fb8c-4c5d-a500-9dae4298243d',
         'IntValue' => 117,
         'StringValue' => 'GABUZO')
);

$context = stream_context_create(array('http' => array(
     'method' => "POST",
     'header'=> "Content-type: text/xml\r\n"
         "Content-length: ".strlen($request)."\r\n",
     'content' => $request
    )));

$file = file_get_contents($req_url, false, $context);

$lastbracket =  strrpos($file, '>');
$extra = substr ($file, $lastbracket+1,-1);
$file  = substr ($file, 0, $lastbracket+1);

$answer = xmlrpc_decode($file);

print_r ($answer);
?>

Array
(
     [0] => Array
         (
             [IntValue] => 42
             [StringValue] => Je vous ai compris
         )

)
_______________________________________________
Opensim-dev mailing list
[email protected]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-dev



--
Justin Clark-Casey (justincc)
OSVW Consulting
http://justincc.org
http://twitter.com/justincc
_______________________________________________
Opensim-dev mailing list
[email protected]
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-dev

Reply via email to