Java 如何使用cxf公开web服务:代理服务
我试图在mule中使用“cxf:proxy service”公开一个简单的问候web服务。下面是我的流程Java 如何使用cxf公开web服务:代理服务,java,proxy,cxf,mule,callable,Java,Proxy,Cxf,Mule,Callable,我试图在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:H
<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>
我的ServiceProxy计算如下所示
public class ServiceProxy implements Callable, Initialisable
请帮助我了解我在哪里错过了路径。试试这个
使用属性“service”来指定服务名称,而不是
元素中的属性“name”。没有运气。它给出了异常org.xml.sax.SAXParseException:cvc复杂类型。3.2.2:元素“cxf:proxy service”中不允许出现属性“name”。我的错误。更正了我上面的回答,使用服务而不是名称。
public class ServiceProxy implements Callable, Initialisable
<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>