‎10-02-2020 12:57 PM
Hello,
I am trying to use WSF Templates, and where i have succesfuly deployed, it doesn't feel to be stable. Can anyone provide more information regarding these templates, like how long does the session stays open. Do we need to dispatch or all changes automatically dispatched? How can we get rid of the session?
regards
Solved! Go to Solution.
‎13-02-2020 12:23 PM - edited ‎13-02-2020 12:24 PM
In this post there is 2 threads :
Using the WSF Template
To ensure it works :
Leveraging capabilities of standard REST API.
With V3 with provide out of the box REST API that can read and write in the repository. This REST API is based on GraphQL principle.
In your case you can leverage the schema on Information Architecture that expose Entity MD in read/write.
I suggest you follow our e-learning about this API.
Have a look at the documentation here : https://community.mega.com/t5/REST-API/bd-p/api
You may find useful behavior in terms of REST API.
With this solution it will be standard HOPEX REST API and you would not have to bother writing a custom web service.
‎13-02-2020 11:34 AM
Hello,
The scenario is simple informatica (a third party client) will read Entity (DM) objects from mega, and write back if necessary any missing objects. I was planning to have two service methods getEntities and addEntities, to read and write back to mega, but problem here is after couple of tries error: cannot open session keeps popping up, our client might take it as defective programming on our part when it cannot connect mega at all. A web service is suppose to be always on.
regards
Imran Usman Khatyan
‎13-02-2020 11:20 AM
I don't believe webservice is closing the session properly after the request is complete, after two or three successful tries error is always the same "Cannot open session". Is there anyway to close the session manually,
‎12-02-2020 08:45 AM
I assume you mean single sign on ?
The API need a valid bearer token. So if you are able to get a valid bearer from your SSO tool then Yes.
I'm no export on how to get a bearer through API with single sign on.
All example here will only show how to get a bearer token from MEGA own identity server (UAS).
‎11-02-2020 08:20 AM
Hello,
Procedure to run behind single sign is the same?
‎10-02-2020 03:16 PM
The token is valid for 1h (3600s) so don't worry about this. In the latest template the session and spro stay open long enough to handle next request and avoid the problem described above.
Have a look at the documentation here : https://community.mega.com/t5/REST-API/bd-p/api
You may find useful behavior in terms of REST API.
Could you share your use case ? to see if the catalog of existing REST API fit or not ?
For information, we have fix a wide range of issue in V3 CP3 coming this month on managing the web service.
I recommend you to use the latest template publish on the HOPEX Store link I provided above and use minimum V3 CP2 HF3 and even better V3 CP3.
‎10-02-2020 02:20 PM
Hello,
I am using V3 at this point, macro is in mega. Question is how long should the client wait before sending another request? and a new token would be required at that point?
regards
Imran
‎10-02-2020 01:03 PM
Hello,
which version of the WSF template to do you use ? In which release of the platform are you ? Which language is the macro in MEGA ? Java or C# ?
Significant improvement have been done in V2R1 U3 CP4 and V3 CP2.
Be default the WSF Template :
So for every call to the end point of your REST API :
If in your deployment opening/closing HOPEX is time consuming you can get into situation if you do several call where the calls fail because HOPEX is still closing.
Look at the architecture schema here : https://community.mega.com/t5/HOPEX-Store/Web-Service-Factory-Template/m-p/21388