cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Headers for create Operation iOS

Former Member
0 Kudos

Hi guys,  so far I have been able to extract information from my SAP backend systems through the Gateway (which is SP2), but creating new data seems to be a problem. When I print the error message accompying the error, it gives me a 403 failure. The body XML is fine, I checked this using the REST client of Firefox and it works. I think I have to set the headers (X-Requested-With:XMLHttpRequest) of the Query somewhere, but I do not exactly know where. Can anybody help me with this?


Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

DiegoDora
Participant
0 Kudos

Hi,

My understanding from what you say and the version of GW that you have (SP2) your server should be under /SDATA/, right? In this case you should use the http header that you're talking about. But in case that you have GW SP3 and you are using the new OData Channel - this means that you're service is under /ODATA/ you need a different header which is the Cross-Site Request Forgery (CSRF). Check this other post: http://scn.sap.com/thread/3151207

Also check this code snippet:

http://wiki.sdn.sap.com/wiki/download/attachments/250646828/Objective+C+using+MS+OData+SDK+-+How+to+...

Let me know how it goes!

Best,


Diego D.

Former Member
0 Kudos

Hi Diego,

thanks for your reply. I already solved  the problem by indeed setting the HTTP header. I used the SAP Netweaver Gateway Tool for Xcode to generate my proxies and class files, and had to change of the standard library classes in order to set the header, but it is working fine now. I indeed have SP2, so the CSRF is not used.

Greets,

IJsbrand

Answers (0)