This article shares with you a PHP interface code for calling the wsdl file type. it is very simple and practical. you can use it directly if you have any requirements. The code is as follows:
<? Php
// This class is automatically generated by the system for testing purposes only
Class IndexAction extends Action {
Public function index (){
// # API for submitting, modifying, canceling, and querying distributor orders
$ Wsdl1 = 'http: // 127.0.0.1: 8080/ejfxs/services/order? Wsdl ';
// # Contact address of the reseller's salable product
$ Wsdl = 'http: // 127.0.0.1: 8080/ejfxs/services/availableProducts? Wsdl ';
// Instantiate the object
$ Client = new SoapClient ($ wsdl );
// Interface parameters.
$ Param1 = array ('password' => '000000', 'dis _ code' => 'fxbzzhlyw', 'checkcode' => 'fxfaxm5u1y ');
// Interface method.
$ Ret1 = $ client-> getAvailableProducts ($ param1 );
// Convert XML data into an array
$ Array = (array) $ ret1;
// Convert to simplexml_load_string object
$ V = simplexml_load_string ($ array ['Return ']);
// Array definition
$ Varr = $ v-> ybproducts-> fzhproducts-> product;
// Obtain the 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'
';
}
// Obtain all methods and parameters of the interface
// Print_r ($ client->__ getfunctions ());
// Print_r ($ client->__ getTypes ());
}
}
?>
========================================================== ======================================
This is probably the case! The above annotations are clear. Leave a message if you do not understand it. Or we recommend that you improve it. Leave a message.