我正在使用JUDDI库在JUDDI注册我的服务。当我执行以下代码时,我收到了错误
{urn:uddi-org:v3_service} UDDI_Security_Port不是有效的服务。有效的服务是:{urn:uddi-org:v3_service} UDDISecurityService
代码:
try {
String clazz = UDDIClientContainer.getUDDIClerkManager(null).
getClientConfig().getUDDINode("default").getProxyTransport();
Class<?> transportClass = ClassUtil.forName(clazz, Transport.class);
if (transportClass!=null) {
transport = (Transport) transportClass.getConstructor(String.class).newInstance("default");
System.out.println("Second satement");
security = transport.getUDDISecurityService();
juddiApi = transport.getJUDDIApiService();
publish = transport.getUDDIPublishService();
inquiry = transport.getUDDIInquiryService();
}
} catch (Exception e) {
e.printStackTrace();
}
下面是maven依赖项,我用于JUDDI。 org.apache.juddi JUDDI客户端 3.0.4 org.apache.juddi JUDDI核心 3.1.5
下面是我的uddi.xml文件
<uddi>
<reloadDelay>5000</reloadDelay>
<manager name="example-manager">
<nodes>
<node>
<name>default</name>
<description>Main jUDDI node</description>
<properties>
<property name="serverName" value="localhost"/>
<property name="serverPort" value="8080"/>
<property name="keyDomain" value="juddi.apache.org"/>
<property name="department" value="businesses" />
</properties>
<proxyTransport>
org.apache.juddi.v3.client.transport.JAXWSTransport
</proxyTransport>
<custodyTransferUrl>
http://${serverName}:${serverPort}/juddiv3/services/custody-transfer?wsdl
</custodyTransferUrl>
<inquiryUrl>
http://${serverName}:${serverPort}/juddiv3/services/inquiry?wsdl
</inquiryUrl>
<publishUrl>
http://${serverName}:${serverPort}/juddiv3/services/publish?wsdl
</publishUrl>
<securityUrl>
http://${serverName}:${serverPort}/juddiv3/services/security?wsdl
</securityUrl>
<subscriptionUrl>
http://${serverName}:${serverPort}/juddiv3/services/subscription?wsdl
</subscriptionUrl>
<subscriptionListenerUrl>
http://${serverName}:${serverPort}/juddiv3/services/subscription-listener?wsdl
</subscriptionListenerUrl>
<juddiApiUrl>
http://${serverName}:${serverPort}/juddiv3/services/juddi-api?wsdl
</juddiApiUrl>
</node>
</nodes>
</manager>
</uddi>
我在我的localhost上安装了JUDDI门户。
答案 0 :(得分:0)
第一个问题,你的依赖关系是不正常的。 org.apache.juddi juddi-client 3.1.5或最新的
第二个问题是你错过了一个依赖 org.apache.juddi uddi-ws 3.1.5或最新的
juddi-core仅用于托管Web服务和访问数据库。
那应该解决它。
ASF SVN有很多例子,包括应该始终保持最新的POM。 这是最新的开发主干 http://svn.apache.org/repos/asf/juddi/trunk/juddi-examples/hello-world/pom.xml
这是3.1.5的一个 http://svn.apache.org/repos/asf/juddi/tags/juddi-3.1.5/juddi-examples/hello-world/pom.xml