SOAP: Difference between revisions

From Rosetta Code
Content added Content deleted
m (SOAP Request moved to Creating a SOAP Client: Tasks shouldn't have "Request" in the name.)
(Formatted more correctly as task.)
Line 1: Line 1:
{{task}}

In this task, the goal is to create a SOAP client which accesses functions defined at '''http://example.com/soap/wsdl''', and calls the functions '''soapFunc( )''' and '''anotherSoapFunc( )'''.

==[[PHP]]==
==[[PHP]]==


<?php
<?php

Assuming you have a wsdl definition file at at 'http://example.com/soap/wsdl', you can create a client...

$client = new SoapClient('http://example.com/soap/wsdl');
$client = new SoapClient('http://example.com/soap/wsdl');

in this example, the soap server has a function called 'soapFunc' with a single string parameter $input, and returns a result.

$result = $client->soapFunc('hello');
$result = $client->soapFunc('hello');

in this example, the soap server has a function called 'anotherSoapFunc' with a single integer parameter $input, and returns a result.

$result = $client->anotherSoapFunc(34234);
$result = $client->anotherSoapFunc(34234);
?>
?>

Revision as of 15:52, 23 January 2007

Task
SOAP
You are encouraged to solve this task according to the task description, using any language you may know.

In this task, the goal is to create a SOAP client which accesses functions defined at http://example.com/soap/wsdl, and calls the functions soapFunc( ) and anotherSoapFunc( ).

PHP

<?php
$client = new SoapClient('http://example.com/soap/wsdl');
$result = $client->soapFunc('hello');
$result = $client->anotherSoapFunc(34234);
?>