- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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 :
- Install HOPEX Platform V3 CP2 HF3 https://community.mega.com/t5/Downloads-Updates/HOPEX-V3-Download-amp-Updates/ta-p/20548
- Use the latest template https://community.mega.com/t5/HOPEX-Store/Web-Service-Factory-Template/m-p/21388
- A lot of fixes have been made on session opening that explain your error
- Ensure IIS configuration is correct. See attached screenshot IIS Application pool/png
- the HOPEXAPI and HOPEXAPIMWAS must be set on the same impersonification user.
- In your macro within HOPEX you need to properly dismissed objects (SET xxx = null in VBScript for instance)
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2020 08:20 AM
Hello,
Procedure to run behind single sign is the same?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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.
- At installation : the API call need to be made on an dedicated application pool HOPEX API for MWASAPI and HOPEXAPI
- At runtime : SSP need to know that this is an API call through the web service to find the proper SPRO with the MWASAPI.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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 :
- Open HOPEX in single-session in private transaction
- The dispatch is done at the end of the request
- The MEGA process is closed at the end of the request.
So for every call to the end point of your REST API :
- HOPEX is launched (spro process)
- a session is opened
- the macro is executed
- the work is dispatch or discarded
- the session is closed
- HOPEX process is closed
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
