D
D
des1roer2017-01-18 16:30:01
PHP
des1roer, 2017-01-18 16:30:01

NuSoap use variable in function?

server
$server->wsdl->addComplexType(
'complexReturn', 'complexType', 'struct', 'all', '',
array(
'id' => array('name' => 'id', 'type' => 'xsd:string'),
'param' => array('name' => 'param', 'type' => 'xsd:string')
)
);
$server->register('get', array('id' => 'xsd:string', 'param' => 'xsd:string'), //parameters
array('return' => 'tns:complexReturn' ), //output
'urn:server', //namespace
'urn:server#getServer', //soapaction
'rpc',
// style 'encoded', // use
'description'); //description
function get($id, $param)
{
return array(
'id' => $id,
'param' => $param
);
}
client
$client = new SoapClient(" inner_work/test/nusoap/samples/server.php?wsdl ",
array(
"trace" => 1,
"exceptions" => 1,
"cache_wsdl" => 0,
"encoding" => "UTF-8",
'soap_version' => SOAP_1_1,
'style' => SOAP_DOCUMENT,
'use' => SOAP_LITERAL,
));
var_dump($client->get(array('id'=>'john', 'param'=>'doe')));
output object(stdClass)#2 (2) { ["id"]=> string(5) "Array" ["param"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
des1roer, 2017-01-19
@des1roer

des1roer.blogspot.ru/2017/01/soap-nusoap.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question