cancel
Showing results for 
Search instead for 
Did you mean: 

Using Relay Server in connection with REST API

PekkaKorsoff
Explorer
0 Kudos
302


Hi,

We are developing a client app for Windows Phone 8 based on REST API, have SMP 2.2. installed with Relay server in the DMZ and NW Gateway providing the Odata services for the backend ERP data.We have defined the appication id in the Sybase Control Centre and the Odata service url in the application settings in SCC.

The access from public internet is to be provided through the Relay Server. I have not been able to find good examples on what kind of http request formats should be used in this scenario. This one is for the case when you can directly access the SMP server, but how does it change when you go through the Relay Server (assuming you need to use relay server host, port, farm id, domain, application id etc. instead of SMP host and port)?

http://host:port/[public/]/odata/applications/{v1|latest}/{appid}/

Or would it make sense to use SMP relay server in pass-through mode?

Does anyone have experience on that option, I have understood that then you can directly specify the backend url (i.e. the Odata service to be called) and bypass the application settings in the SCC?

Best regards,

Pekka Korsoff

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Pekka,

Please see this link for an example of the URL format when Relay Server is used.

Request URL Format

Thanks,

Andrew.

PekkaKorsoff
Explorer
0 Kudos

Hi Andrew,

Thanks for the response. Actually I have seen this one, but I could not figure out what should be put into the  {ProxyName} as the last part in the url:

http://{RelayServerName}[:port]/ias_relay_server/client/rs_client.dll/{Unwired Server Farm ID}/[public/]/{ProxyName}

If it should be simply the value of the application endpoint defined in SCC, I am bit puzzled by the fact that we do not need the application id in this url at all. Could you give an example of the contents of the {ProxyName}?

Best regards,

Pekka

Former Member
0 Kudos

Hi Pekka,

Yes, {ProxyName} is just the proxy endpoint defined in SCC.

I think by the time you call your proxy endpoint, you should already have X-SUP-APPCID as a cookie from creating the application connection in the first place.

Create Application Connection

Thanks,

Andrew.

PekkaKorsoff
Explorer
0 Kudos

Hi Andrew,

Ok, I think I am getting the picture now, have to give it a try. But what is the difference between using the proxy endpoint in the url like this and using  X-SUP-BACKEND-URL in the header?

Best regards,

Pekka


Former Member
0 Kudos

Hi Pekka,

If you use the X-SUP-BACKEND-URL header, the request is supposed to be passed thru to the specified URL with no URL rewriting done on the response.

Thanks,

Andrew.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Please guide me how to consume odata services in native iOS code through SAP mobile server and relay server. Please share the code snippet for the same.

Regards

Neha

PekkaKorsoff
Explorer
0 Kudos

Hi Neha,

I am afraid we have done this mainly using Windows Phone 8, not iOS. But if you want to use the REST API to consume Odata services and use SMP only as a proxy, this the principle how it works

Assumptions

1. You have your Odata services in the Netweaver Gateway, so you could call them directly like this

http://gatewayserver.your_domain:8030/sap/opu/odata/sap/ZFIVM_SRV/ZFIV_InvoiceCollection('0000000266...

2. You have your application (example_app) defined in SMP so that it has the following endpoint definition

http://gatewayserver.domain:8030/sap/opu/odata/sap/ZFIVM_SRV

3 The you can call the same service (ZFIV_invoiceCollection) through SMP like this

http://smpaccesspoint.your_domain:80/ias_relay_server/client/rs_client.dll/smp.poc.msg/example_app/Z...

The exact format of this url depens on what type of relay server you are using. You also need to specify your SMP domain name in the request header (X-SUP-DOMAIN).

Best regards,

Pekka