With a Worklight Adapter can I change the domain and port for a procedure at runtime?

后端 未结 1 1095
南笙
南笙 2020-12-20 07:03

I am writing a worklight application and it will be connecting to a variety of backend services which will be decided by the consumer after installation. I would like to use

相关标签:
1条回答
  • 2020-12-20 07:19

    As you have correctly guessed - the client (app) sends an adapter procedure request to the Worklight Server, which then executes whichever it has been programmed to do, connects to where it was asked to (as defined in the adapter XML's connectionPolicy element). This cannot be changed during runtime/once deployed.

    I don't know what your app is supposed to do, as the scenario is not entirely clear... but you could pre-deploy all required adapters for all the various backends and their set of connection parameters, and on the client-side write some logic to determine which of the adapters to use. There will definitely be adapter duplication here, but it shouldn't create too much overhead on runtime (but yes on maintainability).

    And yes, you could also create your own "interface" to allow the end-user to change the connection parameters prior to sending a direct request to the backend (that is, not use Worklight Adapters), but this doesn't sound like something an end-user needs to mock around with.

    0 讨论(0)
提交回复
热议问题