加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

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

发布时间:2020-12-16 23:58:59 所属栏目:安全 来源:网络整理
导读:最近在做Mule与WSO2 注册表的集成,现有的资料中,只找到一个老外的博客 http://www.smartjava.org/content/mule-and-wso2-registry-integration 可是却没有走通,所以只有另辟蹊径。 最近项目组研究注册表的同学发现WSO2 Registry提供的一些发布,查询服务

最近在做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.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://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然后再打成包,才能够使用。




(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读