Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: WebServiceEngine obtain registered webServices  (Read 10128 times)
Jos? V.
Posts: 58


« on: September 06, 2023, 06:19:54 pm »

We have a Soap Server using WebServiceEngine class and RegisterService to register the available services on the server.

We need to build a "welcome page" for this server which would present the tecnichal user with a list of the available services along with a link to the corresponding WSDL.

My question is if there's any method that I can call on WebServiceEngine or WebService classes(or other) that can provide me with the list of registered services so that I can build a dynamic HTML of this "welcome page".

I have searched the documentation and found nothing that can achieve this.

My only solution for now would be to register services on an addoc variable every time I call WebServiceEngine.RegisterService and then access that variable.

Any ideas?
Reuben B.
Four Js
Posts: 1114


« Reply #1 on: September 08, 2023, 12:44:10 am »

I suspect the question you are asking is, can the output of

gasadmin config --list

be available via a URL in the family of /monitor/configuration/... URL's

There is ...

http://localhost:6394/monitor/configuration/service/invalid -- lists invalid web service configurations

but not an equivalent to list valid web service configurations that I know of.  There are a few undocumented monitor/configuration URL's that Studio uses to populate some drop-downs in the GAS configuration window but I don't think there is one that lists the available services like the gasadmin config --list command does.

My instinct at the moment is that you would write something that would generate a web page from the output of ... gasadmin config --list  and setup a cronjob to run overnight and/or have a process to regenerate whenever an .xcf is added/removed.

Reuben







Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Jos? V.
Posts: 58


« Reply #2 on: September 08, 2023, 10:47:44 am »

No, what gasadmin gives me is a list of services and apps registered in GAS.

What I want is a list of WebServices registered in a com.WebServiceEngine.

So if, for example, I register a service such as:
Quote
LET service = com.WebService.CreateWebService("LeaseProposalService"....)
LET operation = com.WebOperation.CreateDOCStyle("ws_registarProposta",...)
CALL service.publishOperation(operation,"")
LET operation = com.WebOperation.CreateDOCStyle("ws_registarContrato",...)
CALL service.publishOperation(operation,"")

CALL com.WebServiceEngine.RegisterService(service)

What I need a method(or similar) that returns a list of services from com.WebServiceEngine like this:
Quote
CALL com.WebServiceEngine.getServiceList()
        returning serviceList

and then a method to return the operations of a service(com.WebService):
Quote
CALL serviceList[1].getOperationList()
        returning operationList
Reuben B.
Four Js
Posts: 1114


« Reply #3 on: September 11, 2023, 02:11:35 am »

Understood. 

Any reason your preference is a 4gl method and not an additional monitor/configuration URL or an additional gasadmin config option?

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Jos? V.
Posts: 58


« Reply #4 on: September 11, 2023, 10:30:10 am »

For what I am trying to achieve there is no reason for this to be 4gl methods.
It's ok for me if I can get this information through gas monitor(html).

I gave the methods idea as an example since it could be useful for other reasons during development.
Reuben B.
Four Js
Posts: 1114


« Reply #5 on: September 20, 2023, 01:17:06 am »

Jos,

I have created an enhancement request https://4js.com/support/issue/?id=GAS-3857

Unfortunately the developers have initially marked it as Invalid, perhaps I didn't explain the issue well enough or they missed something reading this thread, or i have missed something.

I suspect a solution involving "gasadmin config --list --xml" will be the way to go, just need the output enhanced so that the output of
Code
  1. <SERVICE xcf="xcf_file" grp="group_name" />

has the service-names needed to allow you to call ?openapi.json

Or perhaps the ?WS-INSPECTION output needs to be enhanced so that

Code:
http[s]://host:port/gas/ws/r[/group-name]/xcf-file?WS-INSPECTION

gives you the service names you can then plug into

Code:
http[s]://host:port/gas/ws/r[/group-name]/xcf-file/service-name?openapi.json
I would suggest going through your support contact, getting yourself added as a requestor to that case, and providing more information.

Reuben
« Last Edit: October 04, 2023, 11:39:03 pm »

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines