定时Mule Web服务客户端流程

时间:2013-02-21 15:57:01

标签: mule mule-studio

我在论坛上搜索了这个答案。我发现了一个几乎完全相同的问题,但答案让我仍然感到疑惑。

这里发现了几乎相同的帖子:

Mule - Schedule a flow to consume a web service

这张海报说明了我遇到的问题。

我也是Mule的新手,我正在尝试做同样的事情。我没有意识到我需要一个有效载荷,因为我认为操作规范基本上是有效载荷。

请注意,我有一个包含cxf:jaxws-client的流,该客户端指定服务的URL和操作“listTest”。

为了实际执行服务请求,我需要指定哪些其他有效负载?

我尝试在事件生成器中添加一个虚拟有效负载(如引用文章中所建议的那样),但这并没有什么区别。

当我执行mule应用程序并监视“测试审核员Web服务”(使用wireshark)时,我看到wsdl有四个请求,我看到wsdl返回了,但我实际上看不到调用listTest操作

我的流程是:

   <http:connector name="HTTP_HTTPS" cookieSpec="netscape"
    validateConnections="true" sendBufferSize="0" receiveBufferSize="0"
    receiveBacklog="0" clientSoTimeout="10000" serverSoTimeout="10000"
    socketSoLinger="0" doc:name="HTTP\HTTPS" />
    <flow name="TestAuditorClient_CheckerFlow1" doc:name="TestAuditorClient_CheckerFlow1">
    <quartz:outbound-endpoint jobName="GetTestList"
        repeatInterval="10000" responseTimeout="10000" doc:name="Quartz">
        <quartz:event-generator-job jobGroupName="GetTestList" />
    </quartz:outbound-endpoint>
    <cxf:jaxws-client operation="listTest"
        clientClass="server.TestService_Service" port="TestServicePort"
        wsdlLocation="http://192.168.66.7:8080/TestAuditorWebApp/TestService?wsdl"
        doc:name="SOAPY" />
    <outbound-endpoint
        address="http://192.168.66.7:8080/TestAuditorWebApp/TestService"
        doc:name="HTTP" />
    <logger message="Received HTTP Response #[payload]" level="INFO"
        doc:name="Logger" />
    <!-- <outbound-endpoint exchange-pattern="request-response" address="http://192.168.66.17:8080/TestAuditorWebApp/TestService" 
        doc:name="HTTP"/> -->
    <file:outbound-endpoint path="C:\tmp"
        outputPattern="#[function:datestamp:dd-MM-yy]_#[function:systime].txt"
        responseTimeout="10000" doc:name="Output File" />
</flow>

我不仅是骡子的新手,也是堆叠溢出的新手。因此,如果有更好的方式让我提出相关问题,请提供建议和理由。

提前致谢。

1 个答案:

答案 0 :(得分:0)

您可以使用poll消息处理器生成所需的ListTest实例,而不是Quartz。

假设此类FQDN为server.TestService.ListTest(您没有说明),以下内容应该有效:

<flow name="TestAuditorClient_CheckerFlow1">
  <poll frequency="10000">
    <set-payload value="#[lt=new server.TestService.ListTest(); lt.aField='aValue'; lt]" />
  </poll>
...

请注意如何直接从创建它的表达式设置POJO上的值。

相关问题