看到本版里不少人问uddi4j连接juddi的问题 我做成功了 ,大家分享一下
配置好juddi : 我是用mysql5.0 + tomca5.5 + juddi
一定要配置好数据源
把tomcat启动好
建立一个工程 名为uddi4jdemo
引入包uddi4j.jar , soap.jar(在http://www.apache.org/dyn/closer.cgi/ws/soap/ 下载)
把uddi4j sample里面的 samples.prop configurator.java SaveBusinessExample.java FindBusinessExample.java
publisherAssertionExample.java 放在工程默认package下
由于juddi刚装好没有插入user 因此 这里插入user
INSERT INTO PUBLISHER (PUBLISHER_ID,PUBLISHER_NAME,EMAIL_ADDRESS,IS_ENABLED,IS_ADMIN)
VALUES ('juddi','juddi','juddi@apache.org','true','true')
打开samples.prop这个文件 修改设置下参数
设置url
inquiryURL = http://localhost:8080/juddi/inquiry
publishURL = http://localhost:8080/juddi/publish
设置
userid = juddi
password = juddi
设置soap transport 默认就是这个
TransportClassName=org.uddi4j.transport.ApacheSOAPTransport
运行结果
运行 SaveBusinessExample.java
*********** Running SaveBusinessExample ***********
Get authtoken
Returned authToken:authToken:60BDF210-6641-11DB-A066-BC0BE7D6EEB5
Save 'Sample Business'
Returned businessKey:60DF35B0-6641-11DB-A066-A0B53CE33E0E
Listing businesses starting with S after we publish
Sample Business
Sample Business
Sample Business
运行FindBusinessExample.java
*********** Running FindBusinessExample ***********
Sample Business
Sample Business
Sample Business
因为我运行了三次save 所以有三个 sample business