WSDL Mode
A user can provide a WSDL ( Web Services Description Language) file obtain a proxy
and invoke a service. This is a very convenient way of implementing a client.
Following options can be used to configure wsdl mode.
WSClient Options for WSDL
Option
|
Data Type |
Value Domain |
Default Value |
Description |
wsdl |
string |
this should be uri or a filename |
none |
user can provide a wsdl file or a url of the wsdl file for this option. |
Methods
getProxy()
Returns a proxy client object which is used to access a service endpoint
coveniently using dynamic invocation.
WSClientProxy
WSClientProxy is a class used as the proxy for invoking services.
Following is a sample code demostrating the use of WSClientProxy. Consider we have
a wsdl which defines an operation
"echoString" which echo a given value.
$client = new WSClient(array("wsdl"=>echo.wsdl));
$proxy = $client->getProxy();
$value = $proxy->echoString("Hello World");
Writing a Service to use WSDL mode
By default, WSF/PHP uses functions that accept WSMessage as the argument for service
functions. But when using WSDL mode for server side
this is not necessary. User can write functions that will accept multiple arguments
for functions. To specify that a perticular function arguement type, there are to
types defined as "WSMESSAGE" and "MIXED". When a function is specified as MIXED
it means that it it a function that accepts arguements other that WSMESSAGE. For
WSDL mode in server side, please use MIXED type functions.
Please refer to the sample in wsdl_mode\dynamic_echo_service.php service for an
example.