-----Original Message-----
From: Donald Tyler [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 26, 2003 9:29 AM
To: 'Marek Kilimajer'
Subject: RE: [PHP] XmlRPC - Server did not understand request

Well that fixed it.

*Slaps head*. I guess I should have noticed that. Sorry for such a retarded
question.

Thanks for the help. =0)

-----Original Message-----
From: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 26, 2003 9:18 AM
To: Donald Tyler
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] XmlRPC - Server did not understand request

Donald Tyler wrote:

> sending http request:
> 
> POST Test_Server/XML/PHP_Servers/XMLTEST.php HTTP/1.0
should be
POST /Test_Server/...
(asuming Test_Server is a directory)

> User-Agent: xmlrpc-epi-php/0.2 (PHP)
> Host: localhost:80
should be
Host: localhost

> Content-Type: text/xml
> Content-Length: 111
> 
> <?xml version="1.0" encoding="iso-8859-1"?>
> <methodCall>
> <methodName>test</methodName>
> <params/>
> </methodCall>
> 
> receiving response...
> 
> got response:
> 
> . 
> 
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> <html><head>
> <title>400 Bad Request</title>
> </head><body>
> <h1>Bad Request</h1>
> <p>Your browser sent a request that this server could not understand.<br
/>
> </p>
> <hr />
> <address>Apache/2.0.47 (Win32) PHP/4.3.2 Server at localhost Port
> 80</address>
> </body></html>
> 
> 
> 
> 
> 
> //-------[ Here is the client code: -------\\
> 
> <?PHP
> 
> require_once('XMLRPC_Utils.php');
> 
> $XMLRequest = array();
> 
> $options = array('output type' => 'xml', 'version' => 'xmlrpc');
> $result = xu_rpc_http_concise(
>       array(method    => 'test',
>                 args  => $XMLRequest,
>                 host  => 'localhost',
>                 uri           =>
> 'Test_Server/XML/PHP_Servers/XMLTEST.php',
>                 port  => 80,
>                 options       => $options,
>                 debug => 1));
> 
> ?>
> 
> //-------[ Here is the server code: -------\\
> 
> <?php
> 
> include("xmlrpc_utils.php");
> 
> // ensure extension is loaded.
> xu_load_extension();
> 
> function test($method_name, $params, $app_data)
>       {
>               return 'Hello Scott';
>       }
> 
>       /* create a new server object */
>       $server = xmlrpc_server_create();
>       
>       xmlrpc_server_register_method($server, "test", "test");
>       
>       /* Now, let's get the client's request from the post data.... */
>       $request_xml = $HTTP_RAW_POST_DATA;
>       if(!$request_xml) {
>         $request_xml = $HTTP_GET_VARS[xml];
>       }
>       if(!$request_xml) {
>         echo "<h1>No XML input found!</h1>";
>       }
>       else {
>         /* setup some (optional) output options */
>         $display = array();
>         if($HTTP_POST_VARS[verbosity]) {
>                $display[verbosity] = $HTTP_POST_VARS[verbosity];
>         }
>         if($HTTP_POST_VARS[escaping]) {
>                $display[escaping] = $HTTP_POST_VARS[escaping];
>         }
>         else {
>                $display[escaping] = array("non-ascii", "markup");
>         }
>         if($HTTP_POST_VARS[version]) {
>                $display[version] = $HTTP_POST_VARS[version];
>         }
>         if($HTTP_POST_VARS[encoding]) {
>                $display[encoding] = $HTTP_POST_VARS[encoding];
>         }
>         if($HTTP_POST_VARS[output_type]) {
>                $display[output_type] = $HTTP_POST_VARS[output_type];
>         }
>       
>         /* handle the request */
>         $response = xmlrpc_server_call_method($server, $request_xml,
> $response, $display);
>       
>         if($HTTP_POST_VARS[disp] === "html") {
>                if($HTTP_POST_VARS[output_type] === "php") {
>                       echo "<xmp>\n";
>                       var_dump($response);
>                       echo "\n</xmp>\n";
>                }
>                else {
>                       echo "<xmp>\n$response\n</xmp>\n";
>                }
>         }
>         else {
>                echo "$response";
>         }
>       }
>       
> ?>
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to