Quantcast
Channel: SCN : Popular Discussions - SAP NetWeaver Gateway Developer Center
Viewing all articles
Browse latest Browse all 1657

Post method not triggering odata service

$
0
0

Hi,

We are creating a notification in SAP background using a Odata service and Frontend as PHP. we were able to test GET method as it hist Get_entity_set. But couldn't trigger create entity using POST method. java developer has put below logic to trigger create service

 

map.put("sap-client","900");

               map.put("sap-user","UserID");

               map.put("sap-password","pwd");

               map.put("EQUIPMENT","1040369");

               map.put("SHORT_TEXT","TESt");

               map.put("PRIORITY","1");

               map.put("PLANPLANT","1012")



while posting they get Cross domain error as response. It doesn't hit SAP server. Do we need to have any server mappings from PHP to SAP to trigger create service? If yes, how come it is working for GET method. Please guide.

 

Got some more info from PHP team

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, OPTIONS');
header('Access-Control-Max-Age: 1000');
header('Access-Control-Allow-Headers: Content-Type');

echojson_encode(array("your_request_was"=> $_POST['my_request_is']));

  http://www.d-mueller.de/blog/cross-domain-ajax-guide/th


I really don't understand what this is...Please help


Viewing all articles
Browse latest Browse all 1657

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>