Publier un service sur jUDDI
Bonjour à tous,
Je travaille sur une application web Java/J2ee sous JBoss AS 7.
Je souhaite exposer des webservices au travers d'un annuaire UDDI.
Je me base pour cela sur jUDDI v3. D'après ce que j'ai compris, il y a plusieurs manière d'utiliser jUDDI:
- En tant qu'annuaire indépendant (standalone)
- Intégré à l'application (import du Jar)
Est-ce exact ?
J'ai commencé à faire quelques tests avec le mode standalone. J'ai téléchargé le bundle "tomcat" et je l'ai lancé. J'affiche une liste de services en allant sur l'URL "http://localhost:8082/juddiv3/services".
Je souhaite maintenant publier des services dans l'annuaire.
J'ai essayé par annotations mais ça ne semble pas fonctionner. Voici ce que j'ai fait :
- J'ai ajouté juddi-client.jar au build path du projet
- J'ai annoté mon interface (voir code ci-dessous)
- J'ai créé le fichier uddi.xml (voir code ci-dessous)
- J'ai démarré le serveur
Interface annotée :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| @UDDIService(
description="Service Hello",
serviceKey="uddi:helloServiceKey",
businessKey="uddi:helloBusinessKey"
)
@UDDIServiceBinding(
bindingKey="uddi:helloServiceBindingKey",
description="WSDL endpoint for the helloWorld Service. This service is used for "
+ "testing the jUDDI annotation functionality",
accessPointType="wsdlDeployment",
accessPoint="http://localhost:8082/juddiv3/services/helloworld?wsdl"
)
@WebService()
public interface EJBWS_Interface {
public abstract String hello();
} |
uddi.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| <?xml version="1.0" encoding="ISO-8859-1" ?>
<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="8082"/>
<property name="keyDomain" value="juddi.apache.org"/>
<property name="department" value="businesses" />
</properties>
<proxyTransport>
org.apache.juddi.v3.client.transport.InVMTransport
</proxyTransport>
<custodyTransferUrl>
org.apache.juddi.api.impl.UDDICustodyTransferImpl
</custodyTransferUrl>
<inquiryUrl>org.apache.juddi.api.impl.UDDIInquiryImpl</inquiryUrl>
<publishUrl>org.apache.juddi.api.impl.UDDIPublicationImpl</publishUrl>
<securityUrl>org.apache.juddi.api.impl.UDDISecurityImpl</securityUrl>
<subscriptionUrl>
org.apache.juddi.api.impl.UDDISubscriptionImpl
</subscriptionUrl>
<subscriptionListenerUrl>
org.apache.juddi.api.impl.UDDISubscriptionListenerImpl
</subscriptionListenerUrl>
<juddiApiUrl>org.apache.juddi.api.impl.JUDDIApiImpl</juddiApiUrl>
</node>
</nodes>
</manager>
</uddi> |