on 07-04-2012 4:07 PM
Hello all,
I am currently trying to integrate PHP with SAP OData gateway. I got the Query, Read and Create working from various guides and blogposts, however, I am struggling with the Delete and Update.
I am using the following SDK: http://odataphp.codeplex.com/
In the case of the Delete, I am using the following code:
function deleteBank($id) {
$scheme_agency_id = "LOCAL";
$scheme_id = "Z_BANK_RFC_RRO";
error_log('deleteBank() with id: ' . $id);
$search = null;
try {
$proxy = new ZBANKRFCRRO("http://developer:xxxxxxxx@sapnwgw01:8042/sap/opu/sdata/sap/ZBANKRFCRRO");
$query = "z_bank_rfc_rroCollection(value=%27$id%27,scheme_id=%27$scheme_id%27,scheme_agency_id=%27$scheme_agency_id%27)";
$bank = $proxy->Execute($query . $search)->Result;
$proxy->setMethod('HttpVerb::DELETE');
//The object is added to the list of objects to delete in the database
$proxy->DeleteObject($bank);
//SaveChanges persists the changes in the database
$proxy->SaveChanges();
} catch(ODataServiceException $exception) {
echo '{"error":{"text":'. $exception->getError().'}}';
}
}
Looking the SDK documentation, it instructs to use the DeleteObject method, however, after using a packet sniffer I can confirm that it's using a GET and not a DELETE (which is what the SAP GW expects).
Any thoughts, or guidance in how to change the http verb?
Thank
Hi Robert,
Iam facing similar issue . How you solve the issue, please help me.
Regards,
Venky.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.