Copy Code code as follows:
<?php
This class is automatically generated by the system for testing purposes only
Class Indexaction extends Action {
Public Function index () {
#分销商订单提交, modify, Cancel, query interface
$wsdl 1= ' http://127.0.0.1:8080/ejfxs/services/order?wsdl ';
#分销商可销售产品接口地址
$wsdl = ' http://127.0.0.1:8080/ejfxs/services/availableProducts?wsdl ';
Instantiating an Object
$client =new soapclient ($WSDL);
Interface parameters.
$param 1=array (' Password ' => ' 123456 ', ' dis_code ' => ' fxbzzhlyw ', ' checkcode ' => ' fxfaxm5u1y ');
interface method.
$ret 1 = $client->getavailableproducts ($param 1);
Convert XML data to an array
$array = (array) $ret 1;
Convert to Simplexml_load_string Object
$v =simplexml_load_string ($array [' return ']);
Array definition
$Varr = $v->ybproducts->fzhproducts->product;
Get to a specific value
For ($i =0 $i < count ($Varr); $i + +) {
echo $Varr [$i]->prod_id;
echo $Varr [$i]->product_name;
echo $Varr [$i]->prod_code;
echo $Varr [$i]->prod_category;
echo $Varr [$i]->supply_id;
echo $Varr [$i]->price;
echo $Varr [$i]->parprice;
echo $Varr [$i]->total_ticket_num;
echo $Varr [$i]->inventory;
echo $Varr [$i]->product_name;
echo $Varr [$i]->product_name;
Echo ' <br/> ';
}
Get all the methods and parameters of the interface
Print_r ($client->__getfunctions ());
Print_r ($client->__gettypes ());
}
}
?>
=================================================================
That's probably the way it is! The notes above are more clear. Do not understand the message. or suggest improvements. Message.