Monday, January 28, 2008

Select you service operation parameters..

In Web Service Framework for PHP 1.2, when you are writing a service using WSService with a WSDL, you always had to specify the type of the operation parameters to be "MIXED". But it would have been more convenient that the 'MIXED' to be default for ther service operation parameters when WSDL is specified.

So yesterday I took some minitues and change the logic so that,

1. When the WSDL is specified, the opParms would be default to "MIXED"
2. Otherwise, the opParams would be default to 'WSMESSAGE'.

So wsdl-mode code will be simplified to this..

function QueryPurchaseOrderFunction($pro_name, $quantity, $date, $orderNo) {
// the business logic.


$operations = array("QueryPurchaseOrder" => "QueryPurchaseOrderFunction");

// The following line is not required

// $opParms = array("QueryPurchaseOrderFunction" => "MIXED")

$svr = new WSService(array("wsdl"=>"sample_wsdl_11.wsdl",
//opParams" => $opParams; // This too not required

"operations" => $operations));

No comments: