[phpxmlrpc] Re: Getting an error

Edd Dumbill edd@xml.com
29 Sep 2002 17:18:04 +0100


--=-tTtrm4Dekq6+Qe8bYokC
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

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:
>=20
> ---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
>=20
> <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=3D"1.0"?>
> <methodResponse>
> <params>
> <param>
> <value><string>Alabama</string></value>
> </param>
> </params>
> </methodResponse>
> ---END---
> Fault: Code: 2 Reason 'Invalid return payload: enabling debugging to exam=
ine
> incoming payload'
> XML error: junk after document element at line 2=20
>=20
>=20
> How do i solve this error?
> When i run the client on betty.userland.com it works well.
> The server code is:
>=20
> <?php
> include("xmlrpc.inc");
> include("xmlrpcs.inc");
> =20
> function GetStateName($params)
> {
>     $statenum =3D $params->getParam(0);
>   =20
>     switch($statenum) /* could also use assoc array */
>     {
> 		case 1: $name=3D"Alabama"; break;
> 	    case 50: $name=3D"Wyoming"; break;
> 		default: $name=3D"Unknown"; break;
>     }
>   =20
>     return new xmlrpcresp(new xmlrpcval($name, "string"));
> }
>=20
> $s=3Dnew xmlrpc_server(array("examples.getStateName" =3D>=20
> 		array("function" =3D> "GetStateName")));
>=20
> ?>
>=20
>=20
> I just pass '1' as the input parameter.
>=20
> Can you help me?
>=20
> Thanks,
> Gautam Jain.
--=20
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

--=-tTtrm4Dekq6+Qe8bYokC
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQA9lye8rxbtsbubhxERAsboAJ9GdXB7GLpahZac7c2NIEXsfujAAQCgkKbO
AmiXNoukGL35N1aJy1KEduY=
=ZiZW
-----END PGP SIGNATURE-----

--=-tTtrm4Dekq6+Qe8bYokC--