Description WSDL2PHP tool will generate you the client or service PHP code for your WSDL.    
       
Your WSDL      
 
 
 
 
 
 
   
       
 
<?php
 
// PHP classes corresponding to the data types in defined in WSDL
 
class matrixAdd {
 
    /**
     * @var (object)Matrix
     */
    public $param0;
 
    /**
     * @var (object)Matrix
     */
    public $param1;
 
}
 
class Matrix {
 
    /**
     * @var array[0, unbounded] of (object)MatrixRow
     */
    public $rows;
 
}
 
class MatrixRow {
 
    /**
     * @var array[0, unbounded] of int
     */
    public $columns;
 
}
 
class matrixAddResponse {
 
    /**
     * @var (object)Matrix
     */
    public $return;
 
}
 
class simpleAdd {
 
    /**
     * @var int
     */
    public $param0;
 
    /**
     * @var int
     */
    public $param1;
 
}
 
class simpleAddResponse {
 
    /**
     * @var int
     */
    public $return;
 
}
 
// define the class map
$class_map = array(
    "matrixAdd" => "matrixAdd",
    "Matrix" => "Matrix",
    "MatrixRow" => "MatrixRow",
    "matrixAddResponse" => "matrixAddResponse",
    "simpleAdd" => "simpleAdd",
    "simpleAddResponse" => "simpleAddResponse");
 
try {
 
    // create client in WSDL mode
    $client = new WSClient(array ("wsdl" =>"http://labs.wso2.org/wsf/php/example.wsdl",
        "classmap" => $class_map));
 
    // get proxy object reference form client 
    $proxy = $client->getProxy();
 
    // create input object and set values
    $input = new matrixAdd();
    //TODO: fill in the class fields of $input to match your business logic
 
    // call the operation
    $response = $proxy->matrixAdd($input);
    //TODO: Implement business logic to consume $response, which is of type matrixAddResponse
 
    $input = new simpleAdd();
    //TODO: fill in the class fields of $input to match your business logic
 
    // call the operation
    $response = $proxy->simpleAdd($input);
    //TODO: Implement business logic to consume $response, which is of type simpleAddResponse
 
} catch (Exception $e) {
    // in case of an error, process the fault
    if ($e instanceof WSFault) {
        printf("Soap Fault: %s\n", $e->Reason);
    } else {
        printf("Message = %s\n", $e->getMessage());
    }
}
?>
 
   
       
Rating
(4)
   

Comments

Date Author Comment
Dec 31 1969 04:00:00 PM