简体   繁体   English

以编程方式获取 WSO2 ESB 端点元数据

[英]Getting WSO2 ESB endpoint meta data programmatically

I am trying to programmatically retrieve the meta data of the end points configured to WSO2 ESB (Eg: ServiceName, WebMethods, Input/Output Parameters with Return types etc).我正在尝试以编程方式检索配置为 WSO2 ESB 的端点的元数据(例如:ServiceName、WebMethods、具有返回类型的输入/输出参数等)。 Can someone direct me to some way/docs which could help me fetch this data.有人可以指导我使用某种方式/文档来帮助我获取这些数据。

Unfortunately it's not really clear what you want to do.不幸的是,你并不清楚你想做什么。 Here some examples how to access properties (Meta-Data?)这里有一些示例如何访问属性(元数据?)

inside a proxy/sequence access properties:在代理/序列访问属性中:

<property name="some name" expression="get-property('registry','conf:resource/path')"/>
<property name="some name" expression="get-property('registry',gov:resource/path')"/>
<property name="some name" expression="get-property('registry','resourceName')"/>

Or inside a Custom Mediator:或者在自定义调解器中:

String property = (String)messageContext.getProperty("nameOfThePropery");

Or inside a Custom Mediator (getting the filename from the Transport Layer):或者在自定义调解器中(从传输层获取文件名):

org.apache.axis2.context.MessageContext axis2messageContext = ((Axis2MessageContext) messageContext).getAxis2MessageContext();
// print the filename of the current transport
myLog.info("FileName: " + axis2messageContext.getTransportIn().getName());

Hope this helps you a little bit further, otherwise improve you question.希望这可以帮助您更进一步,否则可以改善您的问题。

To further improve on Abdul's question, we are developing a web-service gateway between a legacy client on side and on the other side are external web-services.为了进一步改进 Abdul 的问题,我们正在遗留客户端和另一端之间开发一个 Web 服务网关,这是外部 Web 服务。 We have created a template/sequences in WSo2 where we trap the legacy client request and redirect it to the correct web-service based on a internal protocol.我们在 WSo2 中创建了一个模板/序列,我们在其中捕获遗留客户端请求并将其重定向到基于内部协议的正确 Web 服务。

The external web services are registered in WSo2 as endpoints.外部 Web 服务在 WSo2 中注册为端点。 So far we have been configuring these endpoints manually using the admin console.到目前为止,我们一直在使用管理控制台手动配置这些端点。 We are looking at automating this step so that our gateway will hit WSo2 and provide the WSDL URL.我们正在考虑自动执行此步骤,以便我们的网关能够访问 WSo2 并提供 WSDL URL。 A class mediator would then invoke the WSo2 / Synapse APIs to save this endpoint in the Synapse configuration.然后类中介将调用 WSo2 / Synapse API 以将此端点保存在 Synapse 配置中。 We have not been successful in this.我们在这方面没有成功。

We have also read the docs which say that changing synapse config thru mediator is not recommended, hence would like to see if there are other options that would do this job for us.我们还阅读了文档,其中表示不建议通过中介更改突触配置,因此想看看是否有其他选项可以为我们完成这项工作。

One workaround would be to create those endpoints from the client side itself.一种解决方法是从客户端本身创建这些端点。 This can be done by calling the AdminService APIs exposed by the carbon framework.这可以通过调用 Carbon 框架公开的 AdminService API 来完成。 In carbon, a front end of any carbon component talks to its back end through Admin Services.在 carbon 中,任何 carbon 组件的前端都通过 Admin Services 与其后端进行对话。 For example, if we take endpoints related functionalities, when you use the management console to create/delete or to do any functionalities, it would in turn call the respective back end via the "EndPointAdmin" admin service.例如,如果我们采用与端点相关的功能,当您使用管理控制台创建/删除或执行任何功能时,它会依次通过“EndPointAdmin”管理服务调用相应的后端。 Therefore I believe, if you want to programmatically create those endpoints, you can call the EndPointAdmin backend admin service (via EndPointAdminStub - it is the client stub corresponding to the aforesaid back end service) directly from your client side and get your requirement fulfilled.因此我相信,如果您想以编程方式创建这些端点,您可以直接从客户端调用 EndPointAdmin 后端管理服务(通过 EndPointAdminStub - 它是与上述后端服务对应的客户端存根)并满足您的要求。

Regards, Prabath问候,普拉巴特

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM