|
OpenWeb-UDDI(by huihoo.org OpenWeb项目组) Welcome OpenWebOpenWeb-UDDI是UDDI V2标准的开源实现.UDDI RegistryThe UDDI registry enables businesses to quickly, easily and dynamically find and transact business with one another using their preferred applications. OpenWeb UDDI is all about sharing business information, making it easy to publish your preferred means of doing business.OpenWeb-UDDIOpenWeb-UDDI is a UDDI V2 standard implementation available. Unlike other UDDI V2 implementations, OpenWeb UDDI focuses on private UDDI registry implementation. It extends the UDDI standard with important features that are very useful for the secure publishing of corporate web services.获得OpenWeb-UDDI从http://www.huihoo.org/download/openweb/openwebuddi_v1.0_beta.zip 下载Open-UDDI发行版本设置环境将opwenwebuddi1.0beta.rar解压缩到tomcat\webapps\更名为openwebuddi将lib\下的soap.jar和xerces.jar copy到tomcat\lib下并添加到classpath windows环境:set classpath=%classpath%;D:\Tomcat 4.0\lib\soap.jar;D:\Tomcat 4.0\lib\xerces.jar 这里使用的是soap2.2 xerces1.4.4 Tomcat请使用4.0或4.0以上的版本 建立ODBC数据源uddi,文件指向openwebuddi\web-inf\database\uddi.mdb 目前我们提供了ACCESS的数据库作为测试用,接下来我们会提供对mysql,SqlServer,Oracle等数据库的支持 UDDI配置文件在webapps\openwebuddi\WEB-INF\classes\conf\openwebuddi.config Web Services发布过程
用户可以单独的发布一个tModel. 用户要发布一个服务,首先必须发布一个businessEntity,然后在此基础上在发布businessService和bindingTemplate..然后在bindingTemplate中引用用户自己的tModel或其他用户发布的tModel. Web Services样例一条Web Services商业信息,B5722130-9117-11D7-A88B-FF8AD4FD567F.xml对UDDI注册中心的操作有两种方式一种是通过API,用UDDI4J程序操作一种是通过Web方式操作, 通过客户端程序 这里我们应用了UDDI4J包,编写了一个供测试用的客户端程序,在程序中有对UDDI注册中心的如下操作: saveBusiness; findBusiness; saveService; findService; savetmodel; deletetmodel; deletebinding; deleteservice; findtmodel; findtbinding; getbindingdetail; gettmodel; getservice; getbusiness; :对于以上的save和delete方法,用户必须首先到注册中心注册(使用WEB页面): Web操作方式1.欢迎页启动Tomcat,然后输入:http://localhost:8080/openwebuddi/index.htm
[点击放大] 2.创建用户名 已初始创建用户huihoo
[点击放大] 3.成功创建用户名
[点击放大] 如上所示,注册成功. 当用户注册成功后就可以使用客户端程序对UDDI注册中心进行save和delete操作了. 下面就以SaveBusiness()方法和deleteservice()方法为例作一下介绍. 方法如下: 首先要要取得用户了令牌.(具体请参见程序的UDDI4J类的构造方法). SaveBusiness()方法: 作用: 存储多个BusinessEntity 过程:在此客户端程序中,要存储一个BusinessEntity.我们声明一个Vector类(vector),用来装载BusinessEntity.在这个BusinessEntity中包含了一个name,一个Catagary,一个Contact.首先要对BusinessEntity中包含的部分进行构造.在CatagaryBag中包含了多个KeyedReference,我们也用一个Vector 类(krVector)来装载,然后在将这个Vector类加到CatagaryBag中.对Contact中的可以重复的phone,email,address也用相同的方法进行处理,然后加到Contact里,当将BusinessEntity中我们要发布的信息都构造好之后,在分别加到BusinessEntity中,在将BusinessEntity加入到事先声明的vector中。最后调用UDDI4J包中的uddiproxy类中的save_business方法对BusinessEntity进行存储. 返回值: 无 deleteservice()方法: 作用:删除一个BusinessService并删除其包含的下一层实体。 过程:此方法比较简单,只需调用UDDI4J包中的uddiproxy类中的delete_services方法。调用delete_services方法传入的参数有:用户令牌以及要删除的BusinessService的Key. 返回值:空。 详细过程请参看原程序中的saveBusiness()和deleteservice()。 Find和get方法不需要授权令牌,用户可以直接通过访问页面或客户端进行查询。 下面以findBusiness和getbusiness为例做一下介绍: findBusiness: 4.Find business 进入Find business页面键入要查询的businessEntity的名字,若为空则为全选。 输入: hello world business
[点击放大] 5.获得结果 发送请求后得到结果
[点击放大] 通过客户程序: findBusiness()方法: 作用:查找businessEntity 的操作入口。为getBusiness提供参数。 过程:将我们想查询的businessEntity中的组成部分作为参数,在此是用的名字。直接调用只需调用UDDI4J包中的uddiproxy类中的find_business方法。服务端将返回相应的businessinfo(结构请参阅标准)。 返回值:无。 6.getBusiness 转到direct get页面中,输入我们通过findbusiness的到的businesskey到相应的文本框中。 输入: B5722130-9117-11D7-A88B-FF8AD4FD567F
[点击放大] 7.获得结果 点击发送,得到结果
[点击放大] 以上就得到了一个businessEntity的完整内容(以XML表示)。 通过客户程序: getBusiness()方法: 作用:得到一个businessEntity的详细内容。 过程:直接调用只需调用UDDI4J包中的uddiproxy类中的get_business方法,输入参数为相应的businessEntity的Key.服务端将向客户端返回此businessEntity的详细内容(以XML表示)。 |