如何使用cxf:proxy-service公开web服务



我试图在mule中使用"cxf:proxy-service"公开一个简单的问候web服务。下面是我的流程。

<flow name="WS_In">
    <http:inbound-endpoint address="http://localhost:8080/HelloService" exchange-pattern="request-response">
        <cxf:proxy-service  wsdlLocation="classpath:HelloService.wsdl" namespace="http://example.org/HelloService"/>
    </http:inbound-endpoint>        
    <component>             
        <prototype-object class="com.example.ServiceProxy">
        </prototype-object>
    </component>
    <echo-component></echo-component>
    <logger level="INFO"        />
</flow>

但是它给我的错误如下:

2013-01-03 16:13:35,569 ERROR [main] construct.AbstractFlowConstruct (AbstractFlowConstruct.java:180) - Failed to stop service: WS_In
org.mule.api.lifecycle.LifecycleException: Lifecycle Manager 'WS_In.stage1' phase 'start' does not support phase 'dispose'

我的ServiceProxy类如下

public class ServiceProxy implements Callable, Initialisable 

请帮助我了解我错过的路径。

代替<cxf:proxy-service>元素中的属性" name ",使用属性" service "来指定服务名称

试试这个…

  1. 从WSDL获取服务名称并在cxf:proxy-service中使用它
  2. 直接在组件中使用类。

<flow name="WS_In">
    <http:inbound-endpoint address="http://localhost:8080/HelloService" exchange-pattern="request-response">
        <cxf:proxy-service  wsdlLocation="classpath:HelloService.wsdl" namespace="http://example.org/HelloService" service="HelloService"/>
    </http:inbound-endpoint>        
    <component class="com.example.ServiceProxy" />
    <echo-component></echo-component>
    <logger level="INFO"        />
</flow>

相关内容

  • 没有找到相关文章

最新更新