问题描述
MULE中调用CXF发布的外部Web Service,报错:org.mule.api.transport.NoReceiverForEndpointException: There is no receiver registered on connector "connector.VM.mule.default" for endpointUri vm://request-response调用不到这个Web Service,不知道是哪里的问题,求大神解答! 下面是MULE配置文件:<?xml version="1.0" encoding="UTF-8"?><mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsdhttp://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd"> <model name="Gold"> <service name="Lovol_InventoryQueryService"> <description Reliability="0.96" ResponseTime="200" Cost="2" ServiceInstanceId="53d7638a3f0d7153013f0d7482890026"/> <inbound> <vm:inbound-endpoint path="53d7638a3f0d7153013f0d78cbdd002b" exchange-pattern="request-response"/> </inbound> <outbound> <pass-through-router> <outbound-endpoint address="wsdl-cxf:http://localhost:1111/QueryInventory?wsdl&method=QueryInventory2"/> </pass-through-router> </outbound> </service> </model></mule> 下面是发布的CXF Web Service:package org.mule.sdu.ws; import org.apache.cxf.endpoint.Server;import org.apache.cxf.jaxws.JaxWsServerFactoryBean;// SBM库存查询互操作接口public class QueryInventoryMainServer { public static void main(String[] args){JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();factory.setServiceClass(QueryInventory.class); factory.setAddress("http://localhost:1111/QueryInventory"); Server server = factory.create();server.start();}}
解决方案
在Mule中未注入webService的bean,因此outbound时找不到service