on 08-22-2022 12:39 PM
Hello,
I have one customized API names "MYQUERY" , it takes 2 parameters, it is working fine when i am calling it (GET) from Postman. Following is the call
https://myserver.com:50000/b1s/v1/sml.svc/MYQUERYParameters(UserName='xxx',pStatus='N')/MYQUERY
1. When I consume it from another application (Java Script Appgyver), some time it comes up with perfect response. But some times it returns following error. "https://myserver.com:50000/b1s/v1/sml.svc/MYQUERYParameters(UserName='xxx',pStatus='N')/MYQUERY has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled".
Please note that, CORS is enabled, and * is placed in CORS Allowed Header Origin.
2. When i am trying to call this API directly from browser some time it return perfect response and some time it gives "proxy error the proxy server received an invalid response from an upstream server. the proxy server could not handle the request reason: error reading from remote server".
Please note that, SAP Business One standard APIs are working perfectly and dont have any CORS , or Proxy error.
Am i missing anything in customized API?
ankit.chauhan1 mariatrinidad.martinezgea can you help.
Thanks in advance.
Taseeb Saeed
Are these outages occasional (once in a while) or does the outage last for a certain duration (several requests fail in a row)? If you're able to see these in the browser, can you check from your browser's developer console's network tab what the error code and response are?
Are you using SAP AppGyver from BTP or via community edition (platform.appgyver.com)?
What type of integration do you have set up to this API (REST API or BTP Destination)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please let me know if you need any further information.
Thanks,
Taseeb Saeed
Oh so the problem only happens on Android for you? Or another problem only happens on Android for you?
It will probably not help but there are sometimes issues with certain APIs not working on either iOS or Android depending on if you have a trailing slash `/` in the base url of your API in its configuration – check if that makes a difference for you?
Other than that, I don't have any concrete ideas. I would try to check on multiple devices if the 502 only happens on one device at a time or on all devices. If the timeouts are short, you can work around this by creating logic in your app that handles dealing with these periodical timeouts with retrying logic and spinners etc.
I looked into the errors you're getting in general in SAP products and it seems sometimes these timeouts happen when the connection does not happen quickly enough and it times out. Please see possible solutions from e.g.
https://userapps.support.sap.com/sap/support/knowledge/en/2412533
https://blogs.sap.com/2016/05/25/how-to-avoid-502-proxy-error-when-adding-large-documents-via-servic...
https://answers.sap.com/questions/5770670/proxy-error.html
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.