- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
亲爱的大家,在第一个新年快乐。
我的目标如下:
我在 wso2as 中部署了两个 axis2 Web 服务(ws1、ws2)。客户端必须通过 wso2esb 向 ws1 提供参数,并且必须将返回值作为参数提供给 ws2,以便将最终值返回给客户端。所以客户端所做的,只是将参数提供给 ws1 并接收来自 ws2 的最终响应。
问题:
如何逐步实现并使 ws1 和 ws2 进行通信(我认为是通过代理)?因为我尝试了很多教程,但没有人了解我的详细信息,因为我真的是 ESB 的初学者。
非常感谢。
最佳答案
是的。您可以一步完成此操作。我之前在一个项目中做过这样的事情:您可以按照以下步骤操作:
1. ws1 and ws2 are both have "endpoints" defined in the ESB.
2. In the ws1 proxy, define a target inSequence to point to a "sequence"
for example "ws1InSequence"
3. In the "ws1InSequence", you can use <filter> to make sure the value is exists.
Then you can <send> to the ws1 <endpoint> with "receive" attribute point to
a sequence for example "ws1ResultSequence"
4. In the ws1ResultSequence, you can again use the <filter> to make sure
it has the parameter/value you need. Then you can use param/value to format a request message.
<payloadFactory>
<format>
<ns1: ws2Operation
xmlns:ns1="ws2Namespace">
<element1 xmlns="">$1</element1>
<!-- Note $1 will have the //paramName value from the ws1 Result message -->
<element2 xmlns="">$2</element2>
<!-- Note $2 will have the //paramName2 value from the ws1 Result message -->
</format>
<args>
<arg expression="//paramName" />
<arg expression="//paramName2" />
</args>
</payloadFactory>
5. Still in ws1ResultSequence, after you create the request message,
you <send> it to the ws2 proxy. Then in the ws2 proxy, in the <outSequence>
you can juse use <send/> to send the response to the client.
请注意,您可能需要包含异常(faultSequence)处理。
WSO2ESB 使用 Apache Synapse 进行配置。您可以在其文档中找到大多数语法和示例用法:http://synapse.apache.org/userguide/config.html
更新:您可以以此为例。注意,这可能不是您需要的完整代码,您可能需要添加异常处理。
<sequence xmlns="http://ws.apache.org/ns/synapse" name="ws1ResultSequence"
trace="enable" onError="ws1ResultSequenceErrorHandler">
<log level="custom">
<property name="sequence" value="INVOCATION START: ws1ResultSequence" />
</log>
<!-- record the original message for future reference -->
<enrich>
<source clone="true" type="envelope" />
<target action="replace" type="property" property="ORIGINAL" />
</enrich>
<!-- Check if the ws1 result message has the value -->
<property
xmlns:ns1="ws1Namespace"
name="valueExists" expression="//ns1:element1" />
<!--Note here, element1 is the element name which has the value: output1 -->
<filter xpath="fn:boolean( get-property('valueExists') )">
<then>
<!-- create the request message to invoke ws2 -->
<payloadFactory>
<format>
<ns1:ws2OperationName
xmlns:ns1="ws2Namespace">
<element2 xmlns="">$1</element2>
</ns1:ws2OperationName>
</format>
<args>
<arg expression="//ns1:element1" />
</args>
</payloadFactory>
<log level="custom">
<property name="inInvokeWS2" value="INVOCATION START: value from ws1 result exists" />
</log>
<send>
<endpoint key="ws2Sequence" />
</send>
<drop/>
</then>
</filter>
<!-- No result value found from the ws1 result message -->
<send>
<endpoint key="DoSomethingElseOrThrowError" />
</send>
关于java - wso2esb 和 wso2as - 两个 Web 服务的链接或编排,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14131335/
我已经在现有代码库上工作了一段时间,通过浏览我们的崩溃日志服务,我注意到一个异常经常发生,我无法重现这个问题,我也没有上下文尝试深入研究的场景,因为这是一个相当大的项目,因此越来越难以找出此异常的原因
我知道这是一个有点长的问题,但我们将不胜感激。 简而言之,我想让一组容器在多个主机上相互通信,并且可以通过 SSH 访问。我知道有这方面的工具,但我做不到。 长版是: 有一个软件有多个组件,这些组件可
如何在知道业务流程名称的情况下动态调用 BizTalk 业务流程? 调用编排形状需要在设计时知道编排的名称和参数。我试过使用'call' XLang 关键字,但它还需要编排名称作为设计时间,就像表达式
我们可以肯定地说,如果 ESB 提供编排功能,它就有资格成为 BPM 的实现吗? 我知道 BPM 有一个不同的目的,即对某些业务流程进行建模,并且这些业务流程的实现可以由任何简单的 Java/J2EE
背景 我有一个 API 网关端点,它代理 Lambda 函数 (Lambda A),供我的 React 应用程序获取客户数据。 此 lambda 函数调用 API 来获取客户数据,但响应的格式还有很多
我对 SOA 中编排的含义感到困惑,我阅读了很多定义但没有明白这个想法,你能帮我吗? 最佳答案 有两种主要方法可以从更大的类(class)粒度服务、编排和编排中执行所有必要的细粒度服务。 对于管弦乐队
嘿,我正在开发一个包,该包生成用于训练 GPT-2 的 TFX 管道(参见 https://github.com/steven-mi/tfx-gpt2)。 我想知道如何在本地将我的管道部署到 Kube
我有一个由作为服务发布的公共(public)端口启动的编排。每当有人调用此服务时,编排就会开始 我也需要每 30 分钟启动一次编排。 什么是更好的方法?我看过一些 here但我想要更简单的东西 最佳答
我正在运行一个 Windows Azure Web 角色,在大多数情况下,该角色接收的流量非常低,但有一些(可预见的)事件可能会导致必须完成大量后台工作。后台工作由许多数据库调用(Azure SQL)
我们正在考虑将 apache spark 集成到我们的计算过程中,我们最初想使用 apache oozie 和标准 MR 或 MO(仅限 map )作业。 经过一些研究后,仍然存在几个问题: 是否可以
我们是否需要使用诸如 eventuate、camunda 等任何框架来在 Spring Boot 中实现基于 Orchestration 的 SAGA 微服务? 最佳答案 您可以使用 eventuat
我是一名优秀的程序员,十分优秀!