SourceForge has been redesigned. Learn more.

Welcome to Open Discussion

  • Nobody/Anonymous

    Welcome to Open Discussion

    • Manish Tamhankar

      Hi is there anybody to help me out in Nusoap

  • victor puig

    victor puig - 2010-12-23

    I have a question.
    I need to create various web services but I want to create them in the same file (services.php) and call them from the other file (front.php).
    I create the first service in services.php:
    $server = new soap_server();
    $server->register("fun1",array("x" => "xsd:string"),array("return" => "xsd:string"),$ns);
    function fun1($x){

    return new soapval("return","xsd:string",$x);

    When I create the second service, only change the function name:

    $server2 = new soap_server();
    $server->register("fun2",array("x" => "xsd:string"),array("return" => "xsd:string"),$ns);
    function fun2($x){

    return new soapval("return","xsd:string",$x);

    And the end of file, I have this code:

    if (isset($HTTP_RAW_POST_DATA)) {
    $input = $HTTP_RAW_POST_DATA;
    else {
    $input = implode("\r\n", file('php://input'));

    And when I call from the client the services:

    $client = new nusoap_client($wsdl);
    $param = array("amount"=>10.00,);
    echo $client->call("fun1", $param);
    echo $client->call("fun2", $param);

    In the web page, only show me the first function, the second print "Array".

    Can I have 2 web services in the same file??

    Thanks a lot for your help…

  • Nitesh Thakur

    Nitesh Thakur - 2012-05-03

    Hi There,

    Can anybody tell me how to add authentication header to wsdl created using nusoap


Log in to post a comment.