Author: kstam
Date: Wed May  8 17:07:25 2013
New Revision: 1480357

URL: http://svn.apache.org/r1480357
Log:
JUDDI-514 improving support for WSDL2UDDI adding deployment lifecycle example

Added:
    juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/
    juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/README.txt
    juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/pom.xml
    juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/
    juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/
    juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/
    juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/
    juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/apache/
    
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/apache/juddi/
    
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/apache/juddi/example/
    
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/apache/juddi/example/wsdl2uddi/
    
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/apache/juddi/example/wsdl2uddi/Delete.java
    
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/apache/juddi/example/wsdl2uddi/Find.java
    
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/apache/juddi/example/wsdl2uddi/Publish.java
    juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/resources/
    juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/resources/META-INF/
    
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/resources/META-INF/wsdl2uddi-uddi.xml
    juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/resources/wsdl/
    
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/resources/wsdl/helloworld.wsdl
    juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/test/
    juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/test/java/
    juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/test/resources/
Modified:
    juddi/trunk/juddi-examples/pom.xml

Modified: juddi/trunk/juddi-examples/pom.xml
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/pom.xml?rev=1480357&r1=1480356&r2=1480357&view=diff
==============================================================================
--- juddi/trunk/juddi-examples/pom.xml (original)
+++ juddi/trunk/juddi-examples/pom.xml Wed May  8 17:07:25 2013
@@ -31,7 +31,8 @@
        <module>hello-world</module>
        <module>simple-browse</module>
        <module>simple-publish</module>
-       <module>wsdl2uddi</module>
        <module>uddi-annotations</module>
+       <module>wsdl2uddi</module>
+       <module>wsdl2uddi-lifecyle</module>
     </modules>
-</project>
\ No newline at end of file
+</project>

Added: juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/README.txt
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/README.txt?rev=1480357&view=auto
==============================================================================
--- juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/README.txt (added)
+++ juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/README.txt Wed May  8 
17:07:25 2013
@@ -0,0 +1,69 @@
+This example is a command line demonstration of how to interact with JUDDI.
+
+1. Start the jUDDI-server (juddi-tomcat or juddi-bundle)
+
+2. Check the settings of the META-INF/wsdl2uddi-uddi.xml, to make sure the 
serverName and serverPort are set correctly.
+
+3. Create Joe Publisher and his keyGenerator and then register the services in 
wsdl/helloworld.wsdl to jUDDI.
+it creates a businessEntity with businessKey 
'uddi:uddi.joepublisher.com:business-for-wsdl'
+
+mvn -Ppublish test
+
+You should see the following output being written to the console:
+
+[INFO] --- exec-maven-plugin:1.1.1:java (default) @ wsdl2uddi ---
+May 08, 2013 12:14:41 PM org.apache.juddi.v3.client.config.ClientConfig 
loadConfiguration
+INFO: Reading UDDI Client properties file 
file:/Users/kstam/osc/apache/dev/juddi-patch/juddi-examples/wsdl2uddi/target/classes/META-INF/wsdl2uddi-uddi.xml
+root AUTHTOKEN = authtoken:459d0ac2-cb6c-4dde-813f-1ddba4b99f20
+May 08, 2013 12:14:48 PM org.apache.juddi.v3.client.config.UDDIClerk register
+INFO: Registering tModel with key uddi:uddi.joepublisher.com:keygenerator
+May 08, 2013 12:14:49 PM org.apache.juddi.v3.client.config.UDDIClerk register
+INFO: Registering business WSDL-Business with key 
uddi:uddi.joepublisher.com:business-for-wsdl
+Retrieving document at 
'file:/Users/kstam/osc/apache/dev/juddi-patch/juddi-examples/wsdl2uddi/target/classes/wsdl/helloworld.wsdl'.
+May 08, 2013 12:14:49 PM org.uddi.JAXBContextUtil getContext
+INFO: Creating JAXB Context for org.uddi.api_v3
+May 08, 2013 12:14:49 PM org.apache.juddi.v3.client.config.UDDIClerk 
checkForErrorInDispositionReport
+INFO: entityKey uddi:uddi.joepublisher.com:service_helloworld was not found in 
the registry
+May 08, 2013 12:14:49 PM org.apache.juddi.v3.client.config.UDDIClerk register
+INFO: Registering tModel with key uddi:uddi.joepublisher.com:HelloWorld
+May 08, 2013 12:14:49 PM org.apache.juddi.v3.client.config.UDDIClerk register
+INFO: Registering tModel with key 
uddi:uddi.joepublisher.com:HelloWorldSoapBinding
+May 08, 2013 12:14:49 PM org.apache.juddi.v3.client.config.UDDIClerk register
+INFO: Registering service HelloWorld with key 
uddi:uddi.joepublisher.com:service_helloworld
+May 08, 2013 12:14:49 PM org.apache.juddi.v3.client.config.UDDIClerk register
+INFO: Registering bindingTemplate with key 
uddi:uddi.joepublisher.com:binding_localhost_helloworld_helloworldimplport_8080
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESS
+[INFO] ------------------------------------------------------------------------
+
+4. Check that we can find this business in the registry by running from Queries
+
+mvn -Pfind test
+
+[INFO] --- exec-maven-plugin:1.1.1:java (default) @ wsdl2uddi ---
+May 08, 2013 12:18:14 PM org.apache.juddi.v3.client.config.ClientConfig 
loadConfiguration
+INFO: Reading UDDI Client properties file 
file:/Users/kstam/osc/apache/dev/juddi-patch/juddi-examples/wsdl2uddi/target/classes/META-INF/wsdl2uddi-uddi.xml
+Found business with name WSDL-Business
+Number of services: 1
+Service Name        = 'HelloWorld'
+Service Key         = 'uddi:uddi.joepublisher.com:service_helloworld'
+Service Description = 'The Hello World Service registered using WSDL2UDDI'
+BindingTemplates: 1
+--BindingTemplate 0:
+  bindingKey          = 
uddi:uddi.joepublisher.com:binding_localhost_helloworld_helloworldimplport_8080
+  accessPoint useType = endPoint
+  accessPoint value   = 
http://localhost:8080/uddi-annotations/services/helloworld
+  description         = The Hello World Binding registered using WSDL2UDDI
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESS
+[INFO] ------------------------------------------------------------------------
+
+So we got one Service, which one binding. Note that the descriptions were 
provided in the wsdl file
+using <wsdl:documentation> elements.
+
+5. Finally to remove all data structures call 
+
+mvn -Pdelete test
+
+This cleans up the business and the wsdl2uddi data structures.
+

Added: juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/pom.xml
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/pom.xml?rev=1480357&view=auto
==============================================================================
--- juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/pom.xml (added)
+++ juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/pom.xml Wed May  8 17:07:25 
2013
@@ -0,0 +1,115 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+     <groupId>org.apache.juddi.example</groupId>
+     <artifactId>juddi-examples</artifactId>
+     <version>3.1.5-SNAPSHOT</version>
+     <relativePath>../pom.xml</relativePath>
+  </parent>
+  <artifactId>wsdl2uddi-lifecycle</artifactId>
+  <name>jUDDI Example WSDL2UDDI Deployment Lifecycle</name>
+  <description>Demonstrates the steps taken to publish a webservice using the 
WSDL file</description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.juddi</groupId>
+      <artifactId>uddi-ws</artifactId>
+      <version>3.1.5-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.juddi</groupId>
+      <artifactId>juddi-client</artifactId>
+      <version>3.1.5-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+  
+    <profiles>
+        <profile>
+            <id>default</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration>
+                            <skip>true</skip>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>publish</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <version>1.1.1</version>
+                        <executions>
+                            <execution>
+                                <phase>test</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    
<mainClass>org.apache.juddi.example.wsdl2uddi.Publish</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>find</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <version>1.1.1</version>
+                        <executions>
+                            <execution>
+                                <phase>test</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    
<mainClass>org.apache.juddi.example.wsdl2uddi.Find</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+         <profile>
+            <id>delete</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <version>1.1.1</version>
+                        <executions>
+                            <execution>
+                                <phase>test</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    
<mainClass>org.apache.juddi.example.wsdl2uddi.Delete</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+</project>
+

Added: 
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/apache/juddi/example/wsdl2uddi/Delete.java
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/apache/juddi/example/wsdl2uddi/Delete.java?rev=1480357&view=auto
==============================================================================
--- 
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/apache/juddi/example/wsdl2uddi/Delete.java
 (added)
+++ 
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/apache/juddi/example/wsdl2uddi/Delete.java
 Wed May  8 17:07:25 2013
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2001-2010 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.juddi.example.wsdl2uddi;
+
+import org.apache.juddi.v3.client.config.UDDIClerk;
+import org.apache.juddi.v3.client.config.UDDIClerkManager;
+
+public class Delete {
+       
+       static UDDIClerkManager clerkManager;
+       
+       public void deleteBusiness(UDDIClerk clerk) {
+               // Deleting the parent business entity that contains our 
service.
+               
clerk.unRegisterBusiness("uddi:uddi.joepublisher.com:business-for-wsdl");
+       }       
+       
+       public void deleteWSDL(UDDIClerk clerk) {
+               // Register the wsdls for this clerk, referenced in the 
wsdl2uddi-uddi.xml
+               clerk.unRegisterWsdls();
+       }
+
+       public static void main (String args[]) {
+               
+               Delete sp = new Delete();
+               try {
+                       clerkManager = new 
UDDIClerkManager("META-INF/wsdl2uddi-uddi.xml");
+                       UDDIClerk clerk = clerkManager.getClerk("joe");
+                       
+                       sp.deleteWSDL(clerk);
+                       sp.deleteBusiness(clerk);
+                       
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+       
+       
+}

Added: 
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/apache/juddi/example/wsdl2uddi/Find.java
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/apache/juddi/example/wsdl2uddi/Find.java?rev=1480357&view=auto
==============================================================================
--- 
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/apache/juddi/example/wsdl2uddi/Find.java
 (added)
+++ 
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/apache/juddi/example/wsdl2uddi/Find.java
 Wed May  8 17:07:25 2013
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2001-2010 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.juddi.example.wsdl2uddi;
+
+import org.apache.juddi.v3.client.config.UDDIClerk;
+import org.apache.juddi.v3.client.config.UDDIClerkManager;
+import org.apache.juddi.v3.client.config.UDDIClientContainer;
+import org.uddi.api_v3.BindingTemplate;
+import org.uddi.api_v3.BusinessEntity;
+import org.uddi.api_v3.BusinessService;
+
+public class Find {
+       
+       public void find() {
+               try {
+                       UDDIClerkManager clerkManager = new 
UDDIClerkManager("META-INF/wsdl2uddi-uddi.xml");
+                       UDDIClerk clerk = clerkManager.getClerk("joe");
+               // register the clerkManager with the client side container
+               UDDIClientContainer.addClerkManager(clerkManager);
+               
+               BusinessEntity businessEntity = 
clerk.findBusiness("uddi:uddi.joepublisher.com:business-for-wsdl");
+               //
+               if (businessEntity!=null) {
+                       System.out.println("Found business with name " + 
businessEntity.getName().get(0).getValue());
+                       System.out.println("Number of services: " + 
businessEntity.getBusinessServices().getBusinessService().size());
+                       
+                       for (BusinessService businessService: 
businessEntity.getBusinessServices().getBusinessService()) {
+                               System.out.println("Service Name        = '" + 
businessService.getName().get(0).getValue() + "'");
+                               System.out.println("Service Key         = '" + 
businessService.getServiceKey() + "'");
+                               System.out.println("Service Description = '" + 
businessService.getDescription().get(0).getValue() + "'");
+                               System.out.println("BindingTemplates: " + 
businessService.getBindingTemplates().getBindingTemplate().size());
+                               
+                               for (int i=0; 
i<businessService.getBindingTemplates().getBindingTemplate().size(); i++) {
+                                       BindingTemplate bindingTemplate = 
businessService.getBindingTemplates().getBindingTemplate().get(i);
+                                       System.out.println("--BindingTemplate" 
+ " " + i + ":");
+                                       System.out.println("  bindingKey        
  = " + bindingTemplate.getBindingKey());
+                                       System.out.println("  accessPoint 
useType = " + bindingTemplate.getAccessPoint().getUseType());
+                                       System.out.println("  accessPoint value 
  = " + bindingTemplate.getAccessPoint().getValue());
+                                       System.out.println("  description       
  = " + bindingTemplate.getDescription().get(0).getValue());
+                               }
+                       }
+               }
+                               
+               businessEntity.getBusinessServices();
+               
+               //TODO JUDDI-610
+                       //FindTModel findBindingTModel = 
WSDL2UDDI.createFindBindingTModelForPortType(portType, namespace);
+                       
+               } 
+               catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }               
+
+       public static void main (String args[]) {
+               Find sp = new Find();
+               sp.find();      
+       }
+}

Added: 
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/apache/juddi/example/wsdl2uddi/Publish.java
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/apache/juddi/example/wsdl2uddi/Publish.java?rev=1480357&view=auto
==============================================================================
--- 
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/apache/juddi/example/wsdl2uddi/Publish.java
 (added)
+++ 
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/java/org/apache/juddi/example/wsdl2uddi/Publish.java
 Wed May  8 17:07:25 2013
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2001-2010 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.juddi.example.wsdl2uddi;
+
+import java.rmi.RemoteException;
+
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.juddi.api_v3.Publisher;
+import org.apache.juddi.api_v3.SavePublisher;
+import org.apache.juddi.v3.client.config.UDDIClerk;
+import org.apache.juddi.v3.client.config.UDDIClerkManager;
+import org.apache.juddi.v3.client.transport.TransportException;
+import org.apache.juddi.v3_service.JUDDIApiPortType;
+import org.uddi.api_v3.AuthToken;
+import org.uddi.api_v3.BusinessEntity;
+import org.uddi.api_v3.CategoryBag;
+import org.uddi.api_v3.Description;
+import org.uddi.api_v3.GetAuthToken;
+import org.uddi.api_v3.KeyedReference;
+import org.uddi.api_v3.Name;
+import org.uddi.api_v3.OverviewDoc;
+import org.uddi.api_v3.OverviewURL;
+import org.uddi.api_v3.TModel;
+import org.uddi.v3_service.DispositionReportFaultMessage;
+import org.uddi.v3_service.UDDISecurityPortType;
+
+public class Publish {
+       
+       static UDDIClerkManager clerkManager;
+       
+       public void publishBusiness(UDDIClerk clerk) {
+               // Creating the parent business entity that will contain our 
service.
+               BusinessEntity myBusEntity = new BusinessEntity();
+               Name myBusName = new Name();
+               myBusName.setValue("WSDL-Business");
+               myBusEntity.getName().add(myBusName);
+               
myBusEntity.setBusinessKey("uddi:uddi.joepublisher.com:business-for-wsdl");
+               clerk.register(myBusEntity);
+       }       
+       
+       public void publishWSDL(UDDIClerk clerk) {
+               // Register the wsdls for this clerk, referenced in the 
wsdl2uddi-uddi.xml
+               clerk.registerWsdls();
+       }
+
+       public static void main (String args[]) {
+               
+               Publish sp = new Publish();
+               try {
+                       clerkManager = new 
UDDIClerkManager("META-INF/wsdl2uddi-uddi.xml");
+                       UDDIClerk clerk = clerkManager.getClerk("joe");
+                       
+                       //setting up the publisher
+                       sp.setupJoePublisher(clerk);
+                       //publish the business
+                       sp.publishBusiness(clerk);
+                       //and the wsdl
+                       sp.publishWSDL(clerk);
+                       
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+       
+       // This setup needs to be done once, either using the console or using 
code like this
+       private void setupJoePublisher(UDDIClerk clerk) throws 
DispositionReportFaultMessage, RemoteException, ConfigurationException, 
TransportException {
+               
+               UDDISecurityPortType security = 
clerkManager.getTransport("default").getUDDISecurityService();
+               
+               //login as root so we can create joe publisher
+               GetAuthToken getAuthTokenRoot = new GetAuthToken();
+               getAuthTokenRoot.setUserID("root");
+               getAuthTokenRoot.setCred("");
+               // Making API call that retrieves the authentication token for 
the 'root' user.
+               AuthToken rootAuthToken = 
security.getAuthToken(getAuthTokenRoot);
+               System.out.println ("root AUTHTOKEN = " + 
rootAuthToken.getAuthInfo());
+               //Creating joe publisher
+               JUDDIApiPortType juddiApi = 
clerkManager.getTransport("default").getJUDDIApiService();
+               Publisher p = new Publisher();
+               p.setAuthorizedName("joepublisher");
+               p.setPublisherName("Joe Publisher");
+               // Adding the publisher to the "save" structure, using the 
'root' user authentication info and saving away. 
+               SavePublisher sp = new SavePublisher();
+               sp.getPublisher().add(p);
+               sp.setAuthInfo(rootAuthToken.getAuthInfo());
+               juddiApi.savePublisher(sp);
+               
+               //Joe should have a keyGenerator
+               TModel keyGenerator = new TModel();
+               
keyGenerator.setTModelKey("uddi:uddi.joepublisher.com:keygenerator");
+               Name name = new Name();
+               name.setValue("Joe Publisher's Key Generator");
+               keyGenerator.setName(name);
+               Description description = new Description();
+               description.setValue("This is the key generator for Joe 
Publisher's UDDI entities!");
+               keyGenerator.getDescription().add(description);
+               OverviewDoc overviewDoc = new OverviewDoc();
+               OverviewURL overviewUrl = new OverviewURL();
+               overviewUrl.setUseType("text");
+               overviewUrl.setValue("http://uddi.org/pubs/uddi_v3.htm#keyGen";);
+               overviewDoc.setOverviewURL(overviewUrl);
+               keyGenerator.getOverviewDoc().add(overviewDoc);
+               CategoryBag categoryBag = new CategoryBag();
+               KeyedReference keyedReference = new KeyedReference();
+               keyedReference.setKeyName("uddi-org:types:keyGenerator");
+               keyedReference.setKeyValue("keyGenerator");
+               
keyedReference.setTModelKey("uddi:uddi.org:categorization:types");
+               categoryBag.getKeyedReference().add(keyedReference);
+               keyGenerator.setCategoryBag(categoryBag);
+               clerk.register(keyGenerator);
+       }
+}

Added: 
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/resources/META-INF/wsdl2uddi-uddi.xml
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/resources/META-INF/wsdl2uddi-uddi.xml?rev=1480357&view=auto
==============================================================================
--- 
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/resources/META-INF/wsdl2uddi-uddi.xml
 (added)
+++ 
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/resources/META-INF/wsdl2uddi-uddi.xml
 Wed May  8 17:07:25 2013
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<uddi>
+    <reloadDelay>5000</reloadDelay>
+    <manager name="example-manager">
+               <nodes>
+                       <node>
+                           <!-- required 'default' node -->
+                               <name>default</name> 
+                <properties>
+                    <property name="serverName" value="localhost"/>
+                    <property name="serverPort" value="8080"/>
+                </properties>
+                               <description>Main jUDDI node</description>
+                               <!-- JAX-WS Transport -->
+                               
<proxyTransport>org.apache.juddi.v3.client.transport.JAXWSTransport</proxyTransport>
+                               
<custodyTransferUrl>http://${serverName}:${serverPort}/juddiv3/services/custody-transfer</custodyTransferUrl>
+                               
<inquiryUrl>http://${serverName}:${serverPort}/juddiv3/services/inquiry</inquiryUrl>
+                       
<publishUrl>http://${serverName}:${serverPort}/juddiv3/services/publish</publishUrl>
+                       
<securityUrl>http://${serverName}:${serverPort}/juddiv3/services/security</securityUrl>
+                               
<subscriptionUrl>http://${serverName}:${serverPort}/juddiv3/services/subscription</subscriptionUrl>
+                               
<subscriptionListenerUrl>http://${serverName}:${serverPort}/juddiv3/services/subscription-listener</subscriptionListenerUrl>
+                               
<juddiApiUrl>http://${serverName}:${serverPort}/juddiv3/services/juddi-api</juddiApiUrl>
+                       </node>
+               </nodes>
+               <clerks registerOnStartup="false">
+           <clerk name="joe" node="default" publisher="joepublisher" 
password="joepublisher">
+              <wsdl 
businessKey="uddi:uddi.joepublisher.com:business-for-wsdl">wsdl/helloworld.wsdl</wsdl>
+           </clerk>
+        </clerks>
+       </manager>
+</uddi>

Added: 
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/resources/wsdl/helloworld.wsdl
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/resources/wsdl/helloworld.wsdl?rev=1480357&view=auto
==============================================================================
--- 
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/resources/wsdl/helloworld.wsdl
 (added)
+++ 
juddi/trunk/juddi-examples/wsdl2uddi-lifecyle/src/main/resources/wsdl/helloworld.wsdl
 Wed May  8 17:07:25 2013
@@ -0,0 +1,53 @@
+<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions name="HelloWorld" 
targetNamespace="http://samples.juddi.apache.org/"; 
xmlns:ns1="http://schemas.xmlsoap.org/soap/http"; 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:tns="http://samples.juddi.apache.org/"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
+<wsdl:types>
+<xs:schema elementFormDefault="unqualified" 
targetNamespace="http://samples.juddi.apache.org/"; version="1.0" 
xmlns:tns="http://samples.juddi.apache.org/"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema";>
+<xs:element name="sayHi" type="tns:sayHi"/>
+<xs:element name="sayHiResponse" type="tns:sayHiResponse"/>
+<xs:complexType name="sayHi">
+    <xs:sequence>
+      <xs:element minOccurs="0" name="text" type="xs:string"/>
+    </xs:sequence>
+  </xs:complexType>
+<xs:complexType name="sayHiResponse">
+    <xs:sequence>
+      <xs:element minOccurs="0" name="return" type="xs:string"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>
+  </wsdl:types>
+  <wsdl:message name="sayHiResponse">
+    <wsdl:part element="tns:sayHiResponse" name="parameters">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="sayHi">
+    <wsdl:part element="tns:sayHi" name="parameters">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="HelloWorld">
+    <wsdl:operation name="sayHi">
+      <wsdl:input message="tns:sayHi" name="sayHi">
+    </wsdl:input>
+      <wsdl:output message="tns:sayHiResponse" name="sayHiResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
+    <wsdl:documentation>The Hello World Binding registered using 
WSDL2UDDI</wsdl:documentation>
+    <soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="sayHi">
+      <soap:operation soapAction="" style="document"/>
+      <wsdl:input name="sayHi">
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output name="sayHiResponse">
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="HelloWorld">
+    <wsdl:documentation>The Hello World Service registered using 
WSDL2UDDI</wsdl:documentation>
+    <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldImplPort">
+      <soap:address 
location="http://localhost:8080/uddi-annotations/services/helloworld"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to