How to call the SAP Netweaver Gateway Demo System from SMP Cloud
After many hours of struggle to get the SMP cloud to communicate to the SAP Netweaver Gateway i am jotting down my findings. I was trying to get the list of flights using the call to the http://gw.esworkplace.sap.com/sap/opu/odata/IWBEP/RMTSAMPLEFLIGHT_2
1) Got to the SMP trial offering and create a new application (application name: Flight) and in the Backend tab and put the endpoint as http://gw.esworkplace.sap.com/sap/opu/odata/IWBEP/RMTSAMPLEFLIGHT_2 If you dont want to pass the username and password from the outside call then you can hardcode the username and password in this step by selecting the Allow Anonymous Connection. I select “Internet” from the radio buttons as the GW system is not in the same environment of the SMP.
2) Click on Authentication tab and create a new security profile and select basic authentication and use the same url used in step 1 for the endpoint.
In order to test the this i was using the RestClient plugin in Firefox.
1) Select the Method as Post and enter the url to the public collection.
2) Add the following headers.
Value: Flight (this value has to be a unique value as the SMP use this distinguish application connections)
3) Add Authentication to the service call. (this would be the username and password for the SAP Netweaver Gateway)
4) Add the request body for the call.
<?xml version=”1.0″ encoding=”utf-8″?>
<entry xmlns=”http://www.w3.org/2005/Atom” xmlns:d=”http://schemas.microsoft.com/ado/2007/08/dataservices”
<d:DeviceType>iPhone</d:DeviceType><d:DeviceModel m:null=”true” /> <d:ApnsDeviceToken
5) Click on the send button and check the return code and if the call was successful you will get a 201 result and in the SMP portal you would see new connection under Applications->Application Connection make sure the status of it is registered.
6) Now you can finally retrieve your flights using the following url.
FAQ: 403 forbidden
The trial version of the SMP has a limit of 25 calls per day so dont freak out if you see a 403 forbidden check the error message 🙂
“Operation is rejected by server. Maximum allowed requests for a day in trial space for an application connection are 25 and the limit has been crossed.”