【问题标题】:Mule CXF proxy service issueMule CXF代理服务问题
【发布时间】:2012-07-20 15:28:15
【问题描述】:

启动 MuleServer 时出现以下错误 --

11:07:44.523 [main] 错误 org.mule.MuleServer -


消息:在定义中搜索时未找到组件“{http://xyz.com/services/mvi}ProxyService”。检查端点中的命名空间属性是否丢失或具有无效值。可能的服务匹配:“[]”。定义的所有服务:[{http://xyz.com/services/mvi}MVIService] 类型:org.mule.api.lifecycle.InitialisationException 代码:MULE_ERROR-71999 JavaDoc:http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/lifecycle/InitialisationException.html 对象:org.mule.module.cxf.config.FlowConfiguringMessageProcessor@4c372a96

我不确定为什么 Mule 正在寻找 ProxyService 而我已将 MVIServiceProxy 定义为组件类。我的 cxf 代理客户端配置是 --

<flow name="mviProxyService">
    <http:inbound-endpoint address="http://localhost:61005/mvi/service" exchange-pattern="request-response">
        <cxf:proxy-service wsdlLocation="classpath:mvi.wsdl" namespace="http://xyz.com/services/mvi" />
    </http:inbound-endpoint>

    <component>
        <prototype-object class="com.xyz.services.mvi.MVIServiceProxy">
            <property key="requestDispatchUrl" value="jms://mviq.121.order?connector=jmsConnector" />
            <property key="responsePollUrl" value="jms://mviq.async.service.reply?connector=jmsConnector" />
            <property key="serviceTimeout" value="90000" />
        </prototype-object>
    </component>
    <request-reply timeout="60000">
        <jms:outbound-endpoint queue="mviq.121.order" />
        <jms:inbound-endpoint queue="mviq.async.service.reply" exchange-pattern="one-way" />
    </request-reply>
</flow>

=========== 修改流程================

<flow name="mviProxyService">
    <http:inbound-endpoint address="http://localhost:61005/mvi/service" exchange-pattern="request-response">
        <cxf:proxy-service wsdlLocation="classpath:mvi.wsdl" namespace="http://xyz.com/services/mvi" />
    </http:inbound-endpoint>

    <component class="com.xyz.services.mvi.MVIServiceProxy" />
    <request-reply timeout="60000">
        <jms:outbound-endpoint queue="mviq.121.order" />
        <jms:inbound-endpoint queue="mviq.async.service.reply" exchange-pattern="one-way" />
    </request-reply>
</flow>

【问题讨论】:

  • 你介意展示完整的流程吗? CXF 部分不可见。还有为什么要使用prototype-object?您真的希望为每次调用创建一个组件对象吗?
  • 旁注/问题:我注意到您在组件中注入了 JMS 端点 URL。为什么?组件会执行调度然后读取响应吗?然后request-reply也会这样做?
  • 谢谢!我删除了原型对象和 JMS 端点 URL,但仍然出现相同的错误。但是,当我删除对 WSDL 的引用时,该错误就消失了。所以,如果我从 mule config 中取出 [wsdlLocation="classpath:mvi.wsdl"] 它工作正常。可能是代理类需要具有 wsdl 公开的方法。没有把握。我了解实现 Callable 接口和实现 onCall 方法会将有效负载发送到组件的 onCall() 方法,在那里我可以用 XML 做任何事情。我错过了什么吗?为什么 wsdl 会产生问题?
  • 我是否需要使用 而不是

标签: cxf mule


【解决方案1】:

您需要在cxf:proxy-service 上指定service 属性。这是您在 WSDL 中找到的值,在 wsdl:service 元素的 name 属性中。

您的组件也不需要实现org.mule.api.lifecycle.Callable。只需一个接受 javax.xml.stream.XMLStreamReader 参数的公共方法,您就可以访问 XML 有效负载。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-31
    相关资源
    最近更新 更多