Mule学习之路_2.与WSO2 Registry集成之查询WSDL

来源:互联网 发布:sql数据库语句大全 编辑:程序博客网 时间:2024/05/17 17:58

最近在做Mule与WSO2 注册表的集成,现有的资料中,只找到一个老外的博客

http://www.smartjava.org/content/mule-and-wso2-registry-integration

可是却没有走通,所以只有另辟蹊径。

最近项目组研究注册表的同学发现WSO2 Registry提供的一些发布,查询服务和WSDL的API

并且有了调用的例子,所以我就打算在Mule中通过对这些方法发布服务,来在Mule进行使用,再次记录一下。


下面是WSO2所提供的一些类,并且还有一些需要的JAR文件,用来通过服务名来查找服务的WSDL等

其中searchUrl(String)就是通过服务名来获得真实的WSDL地址


1、把WSO2查询服务的项目导入到Mule Studio 并引入相应的包。

2、把项目转成Mule Project

3、创建流程,发布服务



配置文件如下

<?xml version="1.0" encoding="UTF-8"?><mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsdhttp://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsdhttp://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsdhttp://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd">    <flow name="RegistryServiceFlow1" doc:name="RegistryServiceFlow1">        <http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:8888/services/resgistryService" doc:name="HTTP"/>        <cxf:jaxws-service serviceClass="heru.com.FindUrlImpl" doc:name="SOAP"/>        <component class="heru.com.FindUrlImpl" doc:name="Java"/>            </flow></mule>

SOAPUI测试结果


在运行项目的时候可能会出现一些错误,例如出现NoSuchMethod.........主要是WSO2项目中的JAR包与Mule中的JAR有版本冲突,例如项目中的axiom包是1.2.11的,而Mule中自带的是1.2.5的,那么就需要把1.2.11版本中的文件都拷贝到mule中的1.2.5然后再打成包,才能够使用。







原创粉丝点击