www.webdeveloper.com
Results 1 to 2 of 2

Thread: PHP Function

  1. #1
    Join Date
    Apr 2010
    Location
    Cairo,Egypt
    Posts
    33

    PHP Function

    Hello
    I'm trying to create a web service which retruns a value,I'm using this code and need some help with the php code.

    1-I uploaded 'lib/nusoap' from http://sourceforge.net/projects/nusoap/


    2-Then i created Request.php contains
    PHP Code:
    <?php
    require_once('lib/nusoap.php');
    $c = new soapclient('http://www.o-survey.com/ragy/Response.php'); //creation of object for soap
    $name $c->call('getfirstname',array('id' => '1'));
    echo 
    "The firstname for id '1' is --- "$name;
    ?>
    3-Then i created Response.php contains:

    PHP Code:
    <?php
    function getfirstname($id) {

    return 
    "ragy";

    }

    require(
    'lib/nusoap.php');
    $server = new soap_server();
    $server->configureWSDL('details''urn:firstname');
    $server->register("getfirstname",
    array(
    'userid' => 'xsd:firstname'),
    array(
    'name' => 'xsd:lastname'),
    'urn:lasstname',
    'urn:lastname#getfirstname');

    $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA)
    $HTTP_RAW_POST_DATA '';
    $server->service($HTTP_RAW_POST_DATA);
    ?>
    4- When executing the "http://www.o-survey.com/ragy/Request.php"
    the error appear :

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, webmaster@o-survey.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,176
    One guess is that $HTTP_RAW_POST_DATA is empty, but it can also be things like parse errors, time-outs, an so forth.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles