Re: Getting an error
Edd Dumbill <[email protected]>
| Newsgroups | gmane.comp.php.xml-rpc |
|---|---|
| Message-ID | <1033316285.12690.18.camel@pingu> |
I've copied this mail to the phpxmlrpc mailing list which is the right
place to get help. Please follow up there.
-- Edd
On Fri, 2002-09-27 at 19:32, Gautam Jain wrote:
> Hi,
> I m trying to build a webservice in Php using xml rpc. So i made a
> server.php, and client.php.
> But when i run the client i get the following error:
>
> ---GOT---
> HTTP/1.1 200 OK
> Server: Microsoft-IIS/5.1
> Date: Fri, 27 Sep 2002 18:32:31 GMT
> Content-type: text/html
> X-Powered-By: PHP/4.2.3
>
> <br />
> <b>Notice</b>: Undefined index: ac in
> <b>c:\inetpub\wwwroot\PhpWs\xmlrpc.inc</b> on line <b>333</b><br />
> <br />
> <b>Warning</b>: Cannot add header information - headers already sent by
> (output started at c:\inetpub\wwwroot\PhpWs\xmlrpc.inc:333) in
> <b>c:\inetpub\wwwroot\PhpWs\xmlrpcs.inc</b> on line <b>178</b><br />
> <?xml version="1.0"?>
> <methodResponse>
> <params>
> <param>
> <value><string>Alabama</string></value>
> </param>
> </params>
> </methodResponse>
> ---END---
> Fault: Code: 2 Reason 'Invalid return payload: enabling debugging to examine
> incoming payload'
> XML error: junk after document element at line 2
>
>
> How do i solve this error?
> When i run the client on betty.userland.com it works well.
> The server code is:
>
> <?php
> include("xmlrpc.inc");
> include("xmlrpcs.inc");
>
> function GetStateName($params)
> {
> $statenum = $params->getParam(0);
>
> switch($statenum) /* could also use assoc array */
> {
> case 1: $name="Alabama"; break;
> case 50: $name="Wyoming"; break;
> default: $name="Unknown"; break;
> }
>
> return new xmlrpcresp(new xmlrpcval($name, "string"));
> }
>
> $s=new xmlrpc_server(array("examples.getStateName" =>
> array("function" => "GetStateName")));
>
> ?>
>
>
> I just pass '1' as the input parameter.
>
> Can you help me?
>
> Thanks,
> Gautam Jain.
--
Edd Dumbill ----| phone: +44 1904 427740 fax: +44 8709 909625 |-----
| Managing Editor, XML.com, XMLhack.com -- Chair, XML Europe 2002
| I PGP sign my email; more info at http://heddley.com/edd/pgp.html
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQA9lye8rxbtsbubhxERAsboAJ9GdXB7GLpahZac7c2NIEXsfujAAQCgkKbO AmiXNoukGL35N1aJy1KEduY= =ZiZW -----END PGP SIGNATURE-----