cancel
Showing results for 
Search instead for 
Did you mean: 

Error consuming OData Service

MariusStoica
Active Participant
0 Kudos

Hi guys,

I tried to follow this blog to create an OData data source, but I get an error:

Nothing more

I'm running AppBuilder on premise, on client's server and I have access on the same machine to the service provided by the Gateway system.

Any ideas?

Thanks,

Marius

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member258330
Participant
0 Kudos

Yes. I Found a solution. I realy dont know how suspicious it is, but worked very well

I'm trying to consume oData and the OPTION method is set...

So i put this http before my service odata:

https://cors-anywhere.herokuapp.com/

Look how it became:

In other words, its a problem of CORS - Cross-origim-Resource-Samambaia....

MariusStoica
Active Participant
0 Kudos

Hi guys,

I still need a hint/answer.

Thanks,

Marius.

Former Member
0 Kudos

Hi Marius

Try looking at transactions /IWBEP/ERROR_LOG and /IWFND/ERROR_LOG on the server.

Called from the command box in sapgui, these would need to be entered with a preceding '/n', e.g. '/n/IWBEP/ERROR_LOG'. I add them as Favourites for convenience.


If the problem is in the service response you should see something here. If not, you can have a look at the network activity with an http sniffer, to see what http calls happen and succeed.

Regards

Ron.


.

MariusStoica
Active Participant
0 Kudos

No errors on Gateway server. Or at least nothing shown in that transaction and the service works fine when called via browser (on that machine or remotely)

MariusStoica
Active Participant
0 Kudos

So ..

I've tried all possibilities ...

"New ODataService Data Source" - the request was "http://gateway:8000/sap/opu/odata/sap/Z_AUTH_SERVICE/"

     "Use Jsonp"

     "Use WEB Proxy"

     None of them ... the response is "System returned an error" for all 3 accounts (and no sniffer data).

"New ODataQuery Data Source" - the request was "http://gateway:8000/sap/opu/odata/sap/Z_AUTH_SERVICE/AuthCollection('{0}')"

     "Use Jsonp" the response is "Request timeout", sniffer response "Unauthorized".

     "Use Proxy" the response is "Can't get reponse", no sniffer data

     None of the above, the response is "HTTP request failed", no sniffer data

"New RESTful Data Source" - the request was "http://gateway:8000/sap/opu/odata/sap/Z_AUTH_SERVICE/AuthCollection('{0}')"

     "Use Jsonp" the response is "Request timeout", sniffer response "Bad request".

     "Use Proxy" the response is "Can't get reponse", no sniffer data

     None of the above, the response is "HTTP request failed", no sniffer data

Although I've got even a window pop-up for my user and pass (even though they where completed in the wizard) I still got the 2 responses "Unauthorized" and "Bad request".

Is there a way to find out why am I "Unauthorized" ?

Thanks,

Marius

AshwinDutt
Active Contributor
0 Kudos

Hello Marius,

Seems like something is wrong with the URL

U r performing READ is it ?

If yes below URL seems wrong :

http://gateway:8000/sap/opu/odata/sap/Z_AUTH_SERVICE/AuthCollection('{0}')

Please try as below:

http://gateway:8000/sap/opu/odata/sap/Z_AUTH_SERVICE/AuthCollection('0')

Regards,

Ashwin

MariusStoica
Active Participant
0 Kudos

the {0} was there because you have to tell app builder that "0" is a parameter. 0 is the name of the parameter and in the wizard you have the edit box for the value of that parameter.

Former Member
0 Kudos

Hi Marius,

Since Appbuilder is a browser based app, it should show its network activity in the developer tools of the browser.

Example: UI5 can also be a real pain in reporting 'Errors' that we have no means of discerning where the source is. The usual initial step is to turn on network tracing in dev tools  and see what http calls occur. Even if they fail, you will at least see the attempt. If there is not even an attempt your web app is not working properly. UI5 can fail due to out of date libraries, etc. Appbuilder might have that kind of issue.

Have you confirmed that the service is responding outside of Appbuilder by simply using a direct browser request to http://gateway:8000/sap/opu/odata/sap/Z_AUTH_SERVICE/ ?

Regards

Ron.

MariusStoica
Active Participant
0 Kudos

Hi Ron,

Yes, it was the first thing I tried. The service works perfectly on the same computer where AppBuilder is installed, on the same browser, with or without the parameter .