set_ws_editurl()*

* Available in commercial versions for IBM i DB2 only

Details on IBM i RESTful Web Services

  • Parameter(s):
    • $edit_url: IBM i web service URL for edit
    • $delete_url: URL to IBM i web service for delete
  • Description:
    • Integrated Web Services for IBM i Web services for building IBM i applications. This function sets URL for both edit and delete to web services.
  • Example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// file_get_contents() context options
$arrContextOptions=array(
  "ssl"=>array(
    "verify_peer"=>false,
    "verify_peer_name"=>false,
  ),
);

// fetch data from API
$url = "https://example.com:440/web/services/GetAllCustomers/";
$json = file_get_contents($url, false, stream_context_create($arrContextOptions));
$json_output = json_decode($json, true);

// load grid
$dg = new C_DataGrid($json_output['CUSTOMER_IORcdsDS'], "CUSTNO", "CUSTOMER_IORcdsDS");

$dg->enable_edit('FORM');

// set WS edit end point (edit, delete)
$dg->set_ws_editurl(
  'https://example.com:440/web/services/UpdateCustomer/updtcustno',
  'https://example.com:440/web/services/DeleteCustomer/dltcust'
);

$dg->display();