downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<SoapParam->__construct()SoapServer->__construct()>
Last updated: Thu, 26 Jun 2008

SoapServer->addFunction()

(PHP 5 >= 5.0.1)

SoapServer->addFunction() — Adds one or several functions those will handle SOAP requests

Description

SoapServer
void addFunction ( mixed $functions )

Exports one or more functions for remote clients.

Parameters

functions

To export one function, pass the function name into this parameter as a string.

To export several functions, pass an array of function names.

To export all the functions, pass a special constant SOAP_FUNCTIONS_ALL.

Note: functions must receive all input arguments in the same order as defined in the WSDL file (They should not receive any output parameters as arguments) and return one or more values. To return several values they must return an array with named output parameters.

Return Values

No value is returned.

Examples

Example #1 Some examples

<?php

function echoString($inputString)
{
   return
$inputString;
}

$server->addFunction("echoString");

function
echoTwoStrings($inputString1, $inputString2)
{
   return array(
"outputString1" => $inputString1,
                
"outputString2" => $inputString2);
}
$server->addFunction(array("echoString", "echoTwoStrings"));

$server->addFunction(SOAP_FUNCTIONS_ALL);

?>



add a noteadd a note User Contributed Notes
Adds one or several functions those will handle SOAP requests
There are no user contributed notes for this page.




<SoapParam->__construct()SoapServer->__construct()>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs