Four Js Development Tools Forum

Discussions by product => GWS => Topic started by: Jos? V. on September 06, 2023, 06:19:54 pm



Title: WebServiceEngine obtain registered webServices
Post by: Jos? V. 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?


Title: Re: WebServiceEngine obtain registered webServices
Post by: Reuben B. 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








Title: Re: WebServiceEngine obtain registered webServices
Post by: Jos? V. 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


Title: Re: WebServiceEngine obtain registered webServices
Post by: Reuben B. 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?


Title: Re: WebServiceEngine obtain registered webServices
Post by: Jos? V. 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.


Title: Re: WebServiceEngine obtain registered webServices
Post by: Reuben B. 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