Author: kstam
Date: Wed May  8 17:01:31 2013
New Revision: 1480355

URL: http://svn.apache.org/r1480355
Log: (empty)

Added:
    
juddi/trunk/juddi-examples/wsdl2uddi/src/main/java/org/apache/juddi/example/wsdl2uddi/Find.java
      - copied, changed from r1480323, 
juddi/trunk/juddi-examples/wsdl2uddi/src/main/java/org/apache/juddi/example/wsdl2uddi/FindService.java
Removed:
    
juddi/trunk/juddi-examples/wsdl2uddi/src/main/java/org/apache/juddi/example/wsdl2uddi/FindService.java
Modified:
    juddi/trunk/juddi-examples/wsdl2uddi/README.txt
    juddi/trunk/juddi-examples/wsdl2uddi/pom.xml
    
juddi/trunk/juddi-examples/wsdl2uddi/src/main/java/org/apache/juddi/example/wsdl2uddi/Publish.java

Modified: juddi/trunk/juddi-examples/wsdl2uddi/README.txt
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/wsdl2uddi/README.txt?rev=1480355&r1=1480354&r2=1480355&view=diff
==============================================================================
--- juddi/trunk/juddi-examples/wsdl2uddi/README.txt (original)
+++ juddi/trunk/juddi-examples/wsdl2uddi/README.txt Wed May  8 17:01:31 2013
@@ -2,16 +2,68 @@ This example is a command line demonstra
 
 1. Start the jUDDI-server (juddi-tomcat or juddi-bundle)
 
-2. Check the settings of the META-INF/uddi.xml, to make sure the serverName 
and serverPort are set correctly.
+2. Check the settings of the META-INF/wsdl2uddi-uddi.xml, to make sure the 
serverName and serverPort are set correctly.
 
-3. mvn -Pdemo test
+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:
 
-root AUTHTOKEN = authtoken:0494e382-1ad3-4c52-8806-ae70a0ed37ad
-myPub AUTHTOKEN = authtoken:bf973e5f-7361-4c57-92f7-7b499b886b6d
-myBusiness key:  uddi:juddi.apache.org:6f3e4e62-e483-48ff-a1b3-6855310505c6
-myService key:  uddi:juddi.apache.org:549a9580-cd7b-4969-9b77-527ab9f8f261
+[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
 
-However since the keys are being generated in this case your keys will differ.
+This cleans up the business and the wsdl2uddi data structures.
 

Modified: juddi/trunk/juddi-examples/wsdl2uddi/pom.xml
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/wsdl2uddi/pom.xml?rev=1480355&r1=1480354&r2=1480355&view=diff
==============================================================================
--- juddi/trunk/juddi-examples/wsdl2uddi/pom.xml (original)
+++ juddi/trunk/juddi-examples/wsdl2uddi/pom.xml Wed May  8 17:01:31 2013
@@ -79,7 +79,7 @@
                                     <goal>java</goal>
                                 </goals>
                                 <configuration>
-                                    
<mainClass>org.apache.juddi.example.wsdl2uddi.FindService</mainClass>
+                                    
<mainClass>org.apache.juddi.example.wsdl2uddi.Find</mainClass>
                                 </configuration>
                             </execution>
                         </executions>

Copied: 
juddi/trunk/juddi-examples/wsdl2uddi/src/main/java/org/apache/juddi/example/wsdl2uddi/Find.java
 (from r1480323, 
juddi/trunk/juddi-examples/wsdl2uddi/src/main/java/org/apache/juddi/example/wsdl2uddi/FindService.java)
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/wsdl2uddi/src/main/java/org/apache/juddi/example/wsdl2uddi/Find.java?p2=juddi/trunk/juddi-examples/wsdl2uddi/src/main/java/org/apache/juddi/example/wsdl2uddi/Find.java&p1=juddi/trunk/juddi-examples/wsdl2uddi/src/main/java/org/apache/juddi/example/wsdl2uddi/FindService.java&r1=1480323&r2=1480355&rev=1480355&view=diff
==============================================================================
--- 
juddi/trunk/juddi-examples/wsdl2uddi/src/main/java/org/apache/juddi/example/wsdl2uddi/FindService.java
 (original)
+++ 
juddi/trunk/juddi-examples/wsdl2uddi/src/main/java/org/apache/juddi/example/wsdl2uddi/Find.java
 Wed May  8 17:01:31 2013
@@ -23,7 +23,7 @@ import org.uddi.api_v3.BindingTemplate;
 import org.uddi.api_v3.BusinessEntity;
 import org.uddi.api_v3.BusinessService;
 
-public class FindService {
+public class Find {
        
        public void find() {
                try {
@@ -56,8 +56,9 @@ public class FindService {
                }
                                
                businessEntity.getBusinessServices();
+               
+               //TODO JUDDI-610
                        //FindTModel findBindingTModel = 
WSDL2UDDI.createFindBindingTModelForPortType(portType, namespace);
-                       //clerk.fin
                        
                } 
                catch (Exception e) {
@@ -66,7 +67,7 @@ public class FindService {
        }               
 
        public static void main (String args[]) {
-               FindService sp = new FindService();
+               Find sp = new Find();
                sp.find();      
        }
 }

Modified: 
juddi/trunk/juddi-examples/wsdl2uddi/src/main/java/org/apache/juddi/example/wsdl2uddi/Publish.java
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/wsdl2uddi/src/main/java/org/apache/juddi/example/wsdl2uddi/Publish.java?rev=1480355&r1=1480354&r2=1480355&view=diff
==============================================================================
--- 
juddi/trunk/juddi-examples/wsdl2uddi/src/main/java/org/apache/juddi/example/wsdl2uddi/Publish.java
 (original)
+++ 
juddi/trunk/juddi-examples/wsdl2uddi/src/main/java/org/apache/juddi/example/wsdl2uddi/Publish.java
 Wed May  8 17:01:31 2013
@@ -34,10 +34,8 @@ 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.SaveTModel;
 import org.uddi.api_v3.TModel;
 import org.uddi.v3_service.DispositionReportFaultMessage;
-import org.uddi.v3_service.UDDIPublicationPortType;
 import org.uddi.v3_service.UDDISecurityPortType;
 
 public class Publish {
@@ -67,9 +65,10 @@ public class Publish {
                        UDDIClerk clerk = clerkManager.getClerk("joe");
                        
                        //setting up the publisher
-                       sp.setupJoePublisher();
-                       //publish the business and the wsdl
+                       sp.setupJoePublisher(clerk);
+                       //publish the business
                        sp.publishBusiness(clerk);
+                       //and the wsdl
                        sp.publishWSDL(clerk);
                        
                } catch (Exception e) {
@@ -78,7 +77,7 @@ public class Publish {
        }
        
        // This setup needs to be done once, either using the console or using 
code like this
-       private void setupJoePublisher() throws DispositionReportFaultMessage, 
RemoteException, ConfigurationException, TransportException {
+       private void setupJoePublisher(UDDIClerk clerk) throws 
DispositionReportFaultMessage, RemoteException, ConfigurationException, 
TransportException {
                
                UDDISecurityPortType security = 
clerkManager.getTransport("default").getUDDISecurityService();
                
@@ -89,7 +88,6 @@ public class Publish {
                // 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();
@@ -101,14 +99,7 @@ public class Publish {
                sp.setAuthInfo(rootAuthToken.getAuthInfo());
                juddiApi.savePublisher(sp);
                
-               getAuthTokenRoot = new GetAuthToken();
-               getAuthTokenRoot.setUserID("joepublisher");
-               getAuthTokenRoot.setCred("joepublisher");
-               // Making API call that retrieves the authentication token for 
the 'root' user.
-               AuthToken authToken = security.getAuthToken(getAuthTokenRoot);
-               
-               //Add a keygenerater for this publisher
-               UDDIPublicationPortType publish = 
clerkManager.getTransport("default").getUDDIPublishService(); 
+               //Joe should have a keyGenerator
                TModel keyGenerator = new TModel();
                
keyGenerator.setTModelKey("uddi:uddi.joepublisher.com:keygenerator");
                Name name = new Name();
@@ -130,10 +121,6 @@ public class Publish {
                
keyedReference.setTModelKey("uddi:uddi.org:categorization:types");
                categoryBag.getKeyedReference().add(keyedReference);
                keyGenerator.setCategoryBag(categoryBag);
-               
-               SaveTModel saveTModel = new SaveTModel();
-               saveTModel.setAuthInfo(authToken.getAuthInfo());
-               saveTModel.getTModel().add(keyGenerator);
-               publish.saveTModel(saveTModel);
+               clerk.register(keyGenerator);
        }
 }



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

Reply via email to