juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexo...@apache.org
Subject svn commit: r1488804 [2/2] - in /juddi/trunk: juddi-examples/uddi-createbulk/src/uddi/createbulk/ juddi-examples/uddi-createbulk/src/uddi/examples/ uddi-ws/src/main/java/org/apache/juddi/api_v3/
Date Sun, 02 Jun 2013 22:37:32 GMT
Copied: juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiDigitalSignatureTmodel.java (from r1486692, juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiDigitalSignatureTmodel.java)
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiDigitalSignatureTmodel.java?p2=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiDigitalSignatureTmodel.java&p1=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiDigitalSignatureTmodel.java&r1=1486692&r2=1488804&rev=1488804&view=diff
==============================================================================
--- juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiDigitalSignatureTmodel.java (original)
+++ juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiDigitalSignatureTmodel.java Sun Jun  2 22:37:31 2013
@@ -2,25 +2,22 @@
  * To change this template, choose Tools | Templates
  * and open the template in the editor.
  */
-package uddi.createbulk;
+package uddi.examples;
 
-import java.util.List;
-import java.util.Properties;
 import java.util.concurrent.atomic.AtomicReference;
-
-import org.apache.juddi.api_v3.AccessPointType;
-import org.apache.juddi.api_v3.Publisher;
-import org.apache.juddi.v3.client.UDDIConstants;
 import org.apache.juddi.v3.client.config.UDDIClient;
 import org.apache.juddi.v3.client.config.UDDIClientContainer;
 import org.apache.juddi.v3.client.crypto.DigSigUtil;
 import org.apache.juddi.v3.client.transport.Transport;
 import org.uddi.api_v3.*;
-import org.uddi.v3_service.DispositionReportFaultMessage;
 import org.uddi.v3_service.UDDIInquiryPortType;
 import org.uddi.v3_service.UDDIPublicationPortType;
 import org.uddi.v3_service.UDDISecurityPortType;
 
+/**
+ * This class shows you how to digitally sign a tmodel and verify the signature
+ * @author Alex O'Ree
+ */
 public class UddiDigitalSignatureTmodel {
 
     private static UDDISecurityPortType security = null;
@@ -64,90 +61,25 @@ public class UddiDigitalSignatureTmodel 
             return;
         }
         UddiDigitalSignatureTmodel sp = new UddiDigitalSignatureTmodel();
-        sp.Browse(args);
+        sp.Fire(args);
     }
 
-    public void Browse(String[] args) {
+    public void Fire(String[] args) {
         try {
-            Properties prop = ParseArgs(args);
-            if (prop.containsKey("AuthStyle")) {
-                //TODO, determine a way to pass parameters from the command line, hardcoded for now
-                //UDDI Token
-                //HTTP Username/Password (basic or digest)
-                //HTTP Client Cert
-            }
             org.apache.juddi.v3.client.crypto.DigSigUtil ds = new DigSigUtil();
             ds.put(DigSigUtil.SIGNATURE_KEYSTORE_FILE, "keystore.jks");
             ds.put(DigSigUtil.SIGNATURE_KEYSTORE_FILETYPE, "JKS");
             ds.put(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD, "password");
             ds.put(DigSigUtil.SIGNATURE_KEYSTORE_KEY_ALIAS, "selfsigned");
+            
+            //obmit this statement if you don't need the certificate to be included.
             ds.put(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_BASE64, "t");
-            String token = GetAuthKey("root", "root", AuthStyle.UDDI_AUTH);
-            /*BusinessList findBusiness = GetBusinessList(token);
-             BusinessEntity be = GetBusinessDetails(findBusiness.getBusinessInfos().getBusinessInfo().get(0));
+            String token = GetAuthKey("root", "root");
             
-             //todo provider name
-             /*ds.put(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_SERIAL, "t");
-             ds.put(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_SUBJECTDN, "t");
-             ds.put(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_THUMBPRINT, "t");
-             ds.put(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_X500_PRINICPAL, "t");
-
-             * /
-             ds.put(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_BASE64, "t");
-
-             // org.apache.xml.security.utils.
-             System.out.println("signing");
-             BusinessEntity signUDDI_JAXBObject = ds.signUddiEntity(be);
-             System.out.println("signed");
-             DigSigUtil.JAXB_ToStdOut(signUDDI_JAXBObject);
-             AtomicReference<String> msg = new AtomicReference<String>();
-             boolean verifySigned_UDDI_JAXB_Object = ds.verifySignedUddiEntity(signUDDI_JAXBObject, msg);
-             if (verifySigned_UDDI_JAXB_Object) {
-             System.out.println("signature validation passed (as expected)");
-             } else {
-             System.out.println("signature validation failed");
-             }
-             System.out.println(msg.get());
-             msg = new AtomicReference<String>();
-             System.out.println("signing it again for the hell of it");
-             signUDDI_JAXBObject = ds.signUddiEntity(signUDDI_JAXBObject);
-             DigSigUtil.JAXB_ToStdOut(signUDDI_JAXBObject);
-
-             verifySigned_UDDI_JAXB_Object = ds.verifySignedUddiEntity(signUDDI_JAXBObject, msg);
-             if (verifySigned_UDDI_JAXB_Object) {
-             System.out.println("signature validation passed (as expected)");
-             } else {
-             System.out.println("signature validation failed");
-             }
-             System.out.println(msg.get());
-             msg = new AtomicReference<String>();
-             System.out.println("signing");
-             //start from scratcha again
-             signUDDI_JAXBObject = ds.signUddiEntity(be);
-             System.out.println("signed");
-             //tweak it, then revalidate
-             System.out.println("tweak it, then verify again");
-             Description d = new Description();
-             d.setValue("Hello world");
-             signUDDI_JAXBObject.getDescription().add(d);
-             DigSigUtil.JAXB_ToStdOut(signUDDI_JAXBObject);
-
-             verifySigned_UDDI_JAXB_Object = ds.verifySignedUddiEntity(signUDDI_JAXBObject, msg);
-             if (verifySigned_UDDI_JAXB_Object) {
-             System.out.println("signature validation passed (not expected)");
-             } else {
-             System.out.println("signature validation failed (expected)");
-             }
-             System.out.println(msg.get());
-             //PrintBusinessInfo(findBusiness.getBusinessInfos());
-             //PrintBusinessDetails(findBusiness.getBusinessInfos(), token);
-             //Pr                    intServiceDetailsByBusiness(findBusiness.getBusinessInfos(), token);
-             */
-            System.out.println("this is the real test =====================");
-
-            // BusinessList findBusiness = GetBusinessList(token);
-
-            TModel be = GetBusinessDetails();//findBusiness.getBusinessInfos().getBusinessInfo().get(0));
+            String key ="uddi:juddi.apache.org:23748881-bb2f-4896-8283-4a15be1d0bc1";
+            
+            
+            TModel be = GetTmodelDetails(key);
             be.getSignature().clear();
             //DigSigUtil.JAXB_ToStdOut(be);
             System.out.println("signing");
@@ -161,8 +93,8 @@ public class UddiDigitalSignatureTmodel 
             publish.saveTModel(sb);
             System.out.println("saved, fetching");
 
-            // findBusiness = GetBusinessList(token);
-            be = GetBusinessDetails();//findBusiness.getBusinessInfos().getBusinessInfo().get(0));
+
+            be = GetTmodelDetails(key);
             DigSigUtil.JAXB_ToStdOut(be);
             System.out.println("verifing");
             AtomicReference<String> msg = new AtomicReference<String>();
@@ -179,173 +111,15 @@ public class UddiDigitalSignatureTmodel 
         }
     }
 
-    /**
-     * Find all of the registered businesses. This list may be filtered based on
-     * access control rules
-     *
-     * @param token
-     * @return
-     * @throws Exception
-     */
-    private BusinessList GetBusinessList(String token) throws Exception {
-        FindBusiness fb = new FindBusiness();
-        fb.setAuthInfo(token);
-        Name n = new Name();
-        n.setValue("My Business 0 2013-04-11T12:40:52.753-04:00");
-        fb.getName().add(n);
-        org.uddi.api_v3.FindQualifiers fq = new org.uddi.api_v3.FindQualifiers();
-        fq.getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
-
-        fb.setFindQualifiers(fq);
-        Name searchname = new Name();
-        searchname.setValue(UDDIConstants.WILDCARD);
-        //fb.getName().add(searchname);
-        BusinessList findBusiness = inquiry.findBusiness(fb);
-        return findBusiness;
-
-    }
-
-    /**
-     * Converts category bags of tmodels to a readable string
-     *
-     * @param categoryBag
-     * @return
-     */
-    private String CatBagToString(CategoryBag categoryBag) {
-        StringBuilder sb = new StringBuilder();
-        if (categoryBag == null) {
-            return "no data";
-        }
-        for (int i = 0; i < categoryBag.getKeyedReference().size(); i++) {
-            sb.append(KeyedReferenceToString(categoryBag.getKeyedReference().get(i)));
-        }
-        for (int i = 0; i < categoryBag.getKeyedReferenceGroup().size(); i++) {
-            sb.append("Key Ref Grp: TModelKey=");
-            for (int k = 0; k < categoryBag.getKeyedReferenceGroup().get(i).getKeyedReference().size(); k++) {
-                sb.append(KeyedReferenceToString(categoryBag.getKeyedReferenceGroup().get(i).getKeyedReference().get(k)));
-            }
-        }
-        return sb.toString();
-    }
-
-    private String KeyedReferenceToString(KeyedReference item) {
-        StringBuilder sb = new StringBuilder();
-        sb.append("Key Ref: Name=").
-                append(item.getKeyName()).
-                append(" Value=").
-                append(item.getKeyValue()).
-                append(" tModel=").
-                append(item.getTModelKey()).
-                append(System.getProperty("line.separator"));
-        return sb.toString();
-    }
-
-    private void PrintContacts(Contacts contacts) {
-        if (contacts == null) {
-            return;
-        }
-        for (int i = 0; i < contacts.getContact().size(); i++) {
-            System.out.println("Contact " + i + " type:" + contacts.getContact().get(i).getUseType());
-            for (int k = 0; k < contacts.getContact().get(i).getPersonName().size(); k++) {
-                System.out.println("Name: " + contacts.getContact().get(i).getPersonName().get(k).getValue());
-            }
-            for (int k = 0; k < contacts.getContact().get(i).getEmail().size(); k++) {
-                System.out.println("Email: " + contacts.getContact().get(i).getEmail().get(k).getValue());
-            }
-            for (int k = 0; k < contacts.getContact().get(i).getAddress().size(); k++) {
-                System.out.println("Address sort code " + contacts.getContact().get(i).getAddress().get(k).getSortCode());
-                System.out.println("Address use type " + contacts.getContact().get(i).getAddress().get(k).getUseType());
-                System.out.println("Address tmodel key " + contacts.getContact().get(i).getAddress().get(k).getTModelKey());
-                for (int x = 0; x < contacts.getContact().get(i).getAddress().get(k).getAddressLine().size(); x++) {
-                    System.out.println("Address line value " + contacts.getContact().get(i).getAddress().get(k).getAddressLine().get(x).getValue());
-                    System.out.println("Address line key name " + contacts.getContact().get(i).getAddress().get(k).getAddressLine().get(x).getKeyName());
-                    System.out.println("Address line key value " + contacts.getContact().get(i).getAddress().get(k).getAddressLine().get(x).getKeyValue());
-                }
-            }
-            for (int k = 0; k < contacts.getContact().get(i).getDescription().size(); k++) {
-                System.out.println("Desc: " + contacts.getContact().get(i).getDescription().get(k).getValue());
-            }
-            for (int k = 0; k < contacts.getContact().get(i).getPhone().size(); k++) {
-                System.out.println("Phone: " + contacts.getContact().get(i).getPhone().get(k).getValue());
-            }
-        }
-
-    }
-
-    private void PrintServiceDetail(BusinessService get) {
-        if (get == null) {
-            return;
-        }
-        System.out.println("Name " + ListToString(get.getName()));
-        System.out.println("Desc " + ListToDescString(get.getDescription()));
-        System.out.println("Key " + (get.getServiceKey()));
-        System.out.println("Cat bag " + CatBagToString(get.getCategoryBag()));
-        if (!get.getSignature().isEmpty()) {
-            System.out.println("Item is digitally signed");
-        } else {
-            System.out.println("Item is not digitally signed");
-        }
-        PrintBindingTemplates(get.getBindingTemplates());
-    }
-
-    /**
-     * This function is useful for translating UDDI's somewhat complex data
-     * format to something that is more useful.
-     *
-     * @param bindingTemplates
-     */
-    private void PrintBindingTemplates(BindingTemplates bindingTemplates) {
-        if (bindingTemplates == null) {
-            return;
-        }
-        for (int i = 0; i < bindingTemplates.getBindingTemplate().size(); i++) {
-            System.out.println("Binding Key: " + bindingTemplates.getBindingTemplate().get(i).getBindingKey());
-            //TODO The UDDI spec is kind of strange at this point.
-            //An access point could be a URL, a reference to another UDDI binding key, a hosting redirector (which is 
-            //esscentially a pointer to another UDDI registry) or a WSDL Deployment
-            //From an end client's perspective, all you really want is the endpoint.
-            //http://uddi.org/pubs/uddi_v3.htm#_Ref8977716
-            //So if you have a wsdlDeployment useType, fetch the wsdl and parse for the invocation URL
-            //If its hosting director, you'll have to fetch that data from uddi recursively until the leaf node is found
-            //Consult the UDDI specification for more information
-
-            if (bindingTemplates.getBindingTemplate().get(i).getAccessPoint() != null) {
-                System.out.println("Access Point: " + bindingTemplates.getBindingTemplate().get(i).getAccessPoint().getValue() + " type " + bindingTemplates.getBindingTemplate().get(i).getAccessPoint().getUseType());
-                if (bindingTemplates.getBindingTemplate().get(i).getAccessPoint().getUseType() != null) {
-                    if (bindingTemplates.getBindingTemplate().get(i).getAccessPoint().getUseType().equalsIgnoreCase(AccessPointType.END_POINT.toString())) {
-                        System.out.println("Use this access point value as an invocation endpoint.");
-                    }
-                    if (bindingTemplates.getBindingTemplate().get(i).getAccessPoint().getUseType().equalsIgnoreCase(AccessPointType.BINDING_TEMPLATE.toString())) {
-                        System.out.println("Use this access point value as a reference to another binding template.");
-                    }
-                    if (bindingTemplates.getBindingTemplate().get(i).getAccessPoint().getUseType().equalsIgnoreCase(AccessPointType.WSDL_DEPLOYMENT.toString())) {
-                        System.out.println("Use this access point value as a URL to a WSDL document, which presumably will have a real access point defined.");
-                    }
-                    if (bindingTemplates.getBindingTemplate().get(i).getAccessPoint().getUseType().equalsIgnoreCase(AccessPointType.HOSTING_REDIRECTOR.toString())) {
-                        System.out.println("Use this access point value as an Inquiry URL of another UDDI registry, look up the same binding template there (usage varies).");
-                    }
-                }
-            }
-
-        }
-    }
-
-    private TModel GetBusinessDetails() throws Exception {
+    
+    private TModel GetTmodelDetails(String key) throws Exception {
         //   BusinessInfo get
         GetTModelDetail r = new GetTModelDetail();
-        r.getTModelKey().add("uddi:juddi.apache.org:23748881-bb2f-4896-8283-4a15be1d0bc1");
+        r.getTModelKey().add(key);
         return inquiry.getTModelDetail(r).getTModel().get(0);
     }
 
-    private enum AuthStyle {
-
-        HTTP_BASIC,
-        HTTP_DIGEST,
-        HTTP_NTLM,
-        UDDI_AUTH,
-        HTTP_CLIENT_CERT
-    }
-
+    
     /**
      * Gets a UDDI style auth token, otherwise, appends credentials to the ws
      * proxies (not yet implemented)
@@ -355,7 +129,7 @@ public class UddiDigitalSignatureTmodel 
      * @param style
      * @return
      */
-    private String GetAuthKey(String username, String password, AuthStyle style) {
+    private String GetAuthKey(String username, String password) {
         try {
 
             GetAuthToken getAuthTokenRoot = new GetAuthToken();
@@ -372,96 +146,6 @@ public class UddiDigitalSignatureTmodel 
         return null;
     }
 
-    /**
-     * Converts command line args into a simple property structure
-     *
-     * @param args
-     * @return
-     */
-    private Properties ParseArgs(String[] args) {
-
-        Properties p = new Properties();
-        if (args == null) {
-            return p;
-        }
-        for (int i = 0; i < args.length; i++) {
-            if (args[i] != null && args[i].length() >= 3) {
-                p.put(args[i].split("=")[0], args[i].split("=")[1]);
-            }
-        }
-        return p;
-    }
-
-    private void PrintBusinessInfo(BusinessInfos businessInfos) {
-        if (businessInfos == null) {
-            System.out.println("No data returned");
-        } else {
-            for (int i = 0; i < businessInfos.getBusinessInfo().size(); i++) {
-                System.out.println("===============================================");
-                System.out.println("Business Key: " + businessInfos.getBusinessInfo().get(i).getBusinessKey());
-                System.out.println("Name: " + ListToString(businessInfos.getBusinessInfo().get(i).getName()));
-
-                System.out.println("Description: " + ListToDescString(businessInfos.getBusinessInfo().get(i).getDescription()));
-                System.out.println("Services:");
-                PrintServiceInfo(businessInfos.getBusinessInfo().get(i).getServiceInfos());
-            }
-        }
-    }
-
-    private String ListToString(List<Name> name) {
-        StringBuilder sb = new StringBuilder();
-        for (int i = 0; i < name.size(); i++) {
-            sb.append(name.get(i).getValue()).append(" ");
-        }
-        return sb.toString();
-    }
-
-    private String ListToDescString(List<Description> name) {
-        StringBuilder sb = new StringBuilder();
-        for (int i = 0; i < name.size(); i++) {
-            sb.append(name.get(i).getValue()).append(" ");
-        }
-        return sb.toString();
-    }
-
-    private void PrintServiceInfo(ServiceInfos serviceInfos) {
-        for (int i = 0; i < serviceInfos.getServiceInfo().size(); i++) {
-            System.out.println("-------------------------------------------");
-            System.out.println("Service Key: " + serviceInfos.getServiceInfo().get(i).getServiceKey());
-            System.out.println("Owning Business Key: " + serviceInfos.getServiceInfo().get(i).getBusinessKey());
-            System.out.println("Name: " + ListToString(serviceInfos.getServiceInfo().get(i).getName()));
-        }
-    }
-
-    private void PrintBusinessDetails(BusinessInfos businessInfos, String token) throws Exception {
-        GetBusinessDetail gbd = new GetBusinessDetail();
-        gbd.setAuthInfo(token);
-        for (int i = 0; i < businessInfos.getBusinessInfo().size(); i++) {
-            gbd.getBusinessKey().add(businessInfos.getBusinessInfo().get(i).getBusinessKey());
-        }
-        BusinessDetail businessDetail = inquiry.getBusinessDetail(gbd);
-        for (int i = 0; i < businessDetail.getBusinessEntity().size(); i++) {
-            System.out.println("Business Detail - key: " + businessDetail.getBusinessEntity().get(i).getBusinessKey());
-            System.out.println("Name: " + ListToString(businessDetail.getBusinessEntity().get(i).getName()));
-            System.out.println("CategoryBag: " + CatBagToString(businessDetail.getBusinessEntity().get(i).getCategoryBag()));
-            PrintContacts(businessDetail.getBusinessEntity().get(i).getContacts());
-        }
-    }
+    
 
-    private void PrintServiceDetailsByBusiness(BusinessInfos businessInfos, String token) throws Exception {
-        for (int i = 0; i < businessInfos.getBusinessInfo().size(); i++) {
-            GetServiceDetail gsd = new GetServiceDetail();
-            for (int k = 0; k < businessInfos.getBusinessInfo().get(i).getServiceInfos().getServiceInfo().size(); k++) {
-                gsd.getServiceKey().add(businessInfos.getBusinessInfo().get(i).getServiceInfos().getServiceInfo().get(k).getServiceKey());
-            }
-            gsd.setAuthInfo(token);
-            System.out.println("Fetching data for business " + businessInfos.getBusinessInfo().get(i).getBusinessKey());
-            ServiceDetail serviceDetail = inquiry.getServiceDetail(gsd);
-            for (int k = 0; k < serviceDetail.getBusinessService().size(); k++) {
-                PrintServiceDetail(serviceDetail.getBusinessService().get(k));
-            }
-            System.out.println("................");
-
-        }
-    }
 }

Copied: juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiFindBinding.java (from r1486692, juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiFindBinding.java)
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiFindBinding.java?p2=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiFindBinding.java&p1=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiFindBinding.java&r1=1486692&r2=1488804&rev=1488804&view=diff
==============================================================================
--- juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiFindBinding.java (original)
+++ juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiFindBinding.java Sun Jun  2 22:37:31 2013
@@ -2,12 +2,8 @@
  * To change this template, choose Tools | Templates
  * and open the template in the editor.
  */
-package uddi.createbulk;
+package uddi.examples;
 
-import java.util.GregorianCalendar;
-import javax.xml.datatype.DatatypeFactory;
-import javax.xml.datatype.XMLGregorianCalendar;
-import org.apache.juddi.api_v3.AccessPointType;
 import org.apache.juddi.v3.client.UDDIConstants;
 import org.apache.juddi.v3.client.config.UDDIClient;
 import org.apache.juddi.v3.client.config.UDDIClientContainer;
@@ -19,7 +15,7 @@ import org.uddi.v3_service.UDDIPublicati
 import org.uddi.v3_service.UDDISecurityPortType;
 
 /**
- *
+ * This class shows you how to find an endpoint by searching through all services
  * @author Alex
  */
 public class UddiFindBinding {

Copied: juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiFindEndpoints.java (from r1486692, juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiFindService.java)
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiFindEndpoints.java?p2=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiFindEndpoints.java&p1=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiFindService.java&r1=1486692&r2=1488804&rev=1488804&view=diff
==============================================================================
--- juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiFindService.java (original)
+++ juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiFindEndpoints.java Sun Jun  2 22:37:31 2013
@@ -2,30 +2,44 @@
  * To change this template, choose Tools | Templates
  * and open the template in the editor.
  */
-package uddi.createbulk;
+package uddi.examples;
 
-import javax.xml.bind.JAXB;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.wsdl.Definition;
+import javax.wsdl.PortType;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import org.apache.juddi.api_v3.AccessPointType;
 import org.apache.juddi.v3.client.config.UDDIClient;
 import org.apache.juddi.v3.client.config.UDDIClientContainer;
+import org.apache.juddi.v3.client.mapping.ReadWSDL;
+import org.apache.juddi.v3.client.mapping.URLLocalizerDefaultImpl;
+import org.apache.juddi.v3.client.mapping.WSDL2UDDI;
 import org.apache.juddi.v3.client.transport.Transport;
-import org.apache.juddi.v3_service.JUDDIApiPortType;
 import org.uddi.api_v3.*;
 import org.uddi.v3_service.UDDIInquiryPortType;
-import org.uddi.v3_service.UDDIPublicationPortType;
 import org.uddi.v3_service.UDDISecurityPortType;
 
 /**
+ * This class show you how get all available Access Points/Endpoints for a
+ * service. This is harder than it sounds due to the complexity of UDDI's data
+ * structure. The output is the list of URLs given a service's key
  *
  * @author Alex
  */
-public class UddiFindService {
+public class UddiFindEndpoints {
 
     private static UDDISecurityPortType security = null;
-    private static JUDDIApiPortType juddiApi = null;
-    private static UDDIPublicationPortType publish = null;
     private static UDDIInquiryPortType inquiry = null;
 
-    public UddiFindService() {
+    public UddiFindEndpoints() {
         try {
             // create a manager and read the config in the archive; 
             // you can use your config file name
@@ -38,8 +52,6 @@ public class UddiFindService {
             Transport transport = clerkManager.getTransport("default");
             // Now you create a reference to the UDDI API
             security = transport.getUDDISecurityService();
-            juddiApi = transport.getJUDDIApiService();
-            publish = transport.getUDDIPublishService();
             inquiry = transport.getUDDIInquiryService();
         } catch (Exception e) {
             e.printStackTrace();
@@ -60,12 +72,19 @@ public class UddiFindService {
 
             GetServiceDetail fs = new GetServiceDetail();
             fs.setAuthInfo(rootAuthToken.getAuthInfo());
-            fs.getServiceKey().add("mykey");
+
+            //TODO Key! insert your key here!
+            String key = "uddi:juddi.apache.org:services-inquiry";
+
+            fs.getServiceKey().add(key);
             ServiceDetail serviceDetail = inquiry.getServiceDetail(fs);
             if (serviceDetail == null || serviceDetail.getBusinessService().isEmpty()) {
-                System.out.println("mykey is not registered");
+                System.out.println(key + " is not registered");
             } else {
-                JAXB.marshal(serviceDetail, System.out);
+                List<String> endpoints = GetEndpoints(serviceDetail, rootAuthToken.getAuthInfo());
+                for (int i = 0; i < endpoints.size(); i++) {
+                    System.out.println(endpoints.get(i));
+                }
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -73,7 +92,108 @@ public class UddiFindService {
     }
 
     public static void main(String args[]) {
-        UddiFindService sp = new UddiFindService();
+        UddiFindEndpoints sp = new UddiFindEndpoints();
         sp.find();
     }
+
+    private List<String> GetEndpoints(ServiceDetail serviceDetail, String authInfo) throws Exception {
+        List<String> items = new ArrayList<String>();
+        if (serviceDetail == null) {
+            return items;
+        }
+        for (int i = 0; i < serviceDetail.getBusinessService().size(); i++) {
+            if (serviceDetail.getBusinessService().get(i).getBindingTemplates() != null) {
+                for (int k = 0; k < serviceDetail.getBusinessService().get(i).getBindingTemplates().getBindingTemplate().size(); k++) {
+                    items.addAll(ParseBinding(serviceDetail.getBusinessService().get(i).getBindingTemplates().getBindingTemplate().get(k), authInfo));
+                }
+            }
+        }
+        return items;
+    }
+
+    private List<String> GetBindingInfo(String value, String cred) throws Exception {
+        List<String> items = new ArrayList<String>();
+        if (value == null) {
+            return items;
+        }
+        GetBindingDetail b = new GetBindingDetail();
+        b.setAuthInfo(cred);
+        b.getBindingKey().add(value);
+        BindingDetail bindingDetail = inquiry.getBindingDetail(b);
+        for (int i = 0; i < bindingDetail.getBindingTemplate().size(); i++) {
+            items.addAll(ParseBinding(bindingDetail.getBindingTemplate().get(i), cred));
+        }
+        return items;
+    }
+
+    private List<String> FetchWSDL(String value) {
+        List<String> items = new ArrayList<String>();
+
+        if (value.startsWith("http://") || value.startsWith("https://")) {
+            //here, we need an HTTP Get for WSDLs
+            org.apache.juddi.v3.client.mapping.ReadWSDL r = new ReadWSDL();
+            r.setIgnoreSSLErrors(true);
+            try {
+                Definition wsdlDefinition = r.readWSDL(new URL(value));
+                Properties properties = new Properties();
+
+
+                properties.put("keyDomain", "domain");
+                properties.put("businessName", "biz");
+                properties.put("serverName", "localhost");
+                properties.put("serverPort", "80");
+
+                WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, new URLLocalizerDefaultImpl(), properties);
+                BusinessServices businessServices = wsdl2UDDI.createBusinessServices(wsdlDefinition);
+                for (int i = 0; i < businessServices.getBusinessService().size(); i++) {
+                    if (businessServices.getBusinessService().get(i).getBindingTemplates() != null) {
+                        for (int k = 0; k < businessServices.getBusinessService().get(i).getBindingTemplates().getBindingTemplate().size(); k++) {
+                            items.addAll(ParseBinding(businessServices.getBusinessService().get(i).getBindingTemplates().getBindingTemplate().get(k), null));
+                        }
+                    }
+                }
+            } catch (Exception ex) {
+                Logger.getLogger(UddiFindEndpoints.class.getName()).log(Level.SEVERE, null, ex);
+            }
+
+        }
+        return items;
+    }
+
+    private List<String> ParseBinding(BindingTemplate get, String authInfo) throws Exception {
+        List<String> items = new ArrayList<String>();
+        if (get == null || get.getAccessPoint() == null) {
+            return items;
+        }
+        if (get.getHostingRedirector() != null) {
+            //hosting Redirector is the same as "reference this other binding template". It's actually deprecated so 
+            //don't expect to see this too often
+            items.addAll(GetBindingInfo(get.getHostingRedirector().getBindingKey(), authInfo));
+        }
+        if (get.getAccessPoint() != null) {
+            String usetype = get.getAccessPoint().getUseType();
+            if (usetype == null) {
+                //this is unexpected, usetype is a required field
+                items.add(get.getAccessPoint().getValue());
+            } else if (usetype.equalsIgnoreCase(AccessPointType.BINDING_TEMPLATE.toString())) {
+                //referencing another binding template
+                items.addAll(GetBindingInfo(get.getAccessPoint().getValue(), authInfo));
+            } else if (usetype.equalsIgnoreCase(AccessPointType.HOSTING_REDIRECTOR.toString())) {
+                //this one is a bit strange. the value should be a binding template
+                
+                items.addAll(GetBindingInfo(get.getAccessPoint().getValue(), authInfo));
+                
+            } else if (usetype.equalsIgnoreCase(AccessPointType.WSDL_DEPLOYMENT.toString())) {
+                //fetch wsdl and parse
+                items.addAll(FetchWSDL(get.getAccessPoint().getValue()));
+            } else if (usetype.equalsIgnoreCase(AccessPointType.END_POINT.toString())) {
+                items.add(get.getAccessPoint().getValue());
+            } else {
+                //treat it has an extension or whatever
+                items.add(get.getAccessPoint().getValue());
+            }
+
+        }
+        return items;
+    }
 }

Copied: juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiGetServiceDetails.java (from r1486692, juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiFindService.java)
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiGetServiceDetails.java?p2=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiGetServiceDetails.java&p1=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiFindService.java&r1=1486692&r2=1488804&rev=1488804&view=diff
==============================================================================
--- juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiFindService.java (original)
+++ juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiGetServiceDetails.java Sun Jun  2 22:37:31 2013
@@ -2,7 +2,7 @@
  * To change this template, choose Tools | Templates
  * and open the template in the editor.
  */
-package uddi.createbulk;
+package uddi.examples;
 
 import javax.xml.bind.JAXB;
 import org.apache.juddi.v3.client.config.UDDIClient;
@@ -15,17 +15,17 @@ import org.uddi.v3_service.UDDIPublicati
 import org.uddi.v3_service.UDDISecurityPortType;
 
 /**
- *
+ * This class show you how to get all available information for service (excluding OperationalInfo)
  * @author Alex
  */
-public class UddiFindService {
+public class UddiGetServiceDetails {
 
     private static UDDISecurityPortType security = null;
     private static JUDDIApiPortType juddiApi = null;
     private static UDDIPublicationPortType publish = null;
     private static UDDIInquiryPortType inquiry = null;
 
-    public UddiFindService() {
+    public UddiGetServiceDetails() {
         try {
             // create a manager and read the config in the archive; 
             // you can use your config file name
@@ -73,7 +73,7 @@ public class UddiFindService {
     }
 
     public static void main(String args[]) {
-        UddiFindService sp = new UddiFindService();
+        UddiGetServiceDetails sp = new UddiGetServiceDetails();
         sp.find();
     }
 }

Copied: juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiKeyGenerator.java (from r1486692, juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiKeyGenerator.java)
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiKeyGenerator.java?p2=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiKeyGenerator.java&p1=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiKeyGenerator.java&r1=1486692&r2=1488804&rev=1488804&view=diff
==============================================================================
--- juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiKeyGenerator.java (original)
+++ juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiKeyGenerator.java Sun Jun  2 22:37:31 2013
@@ -2,7 +2,7 @@
  * To change this template, choose Tools | Templates
  * and open the template in the editor.
  */
-package uddi.createbulk;
+package uddi.examples;
 
 import javax.xml.bind.JAXB;
 import org.apache.juddi.v3.client.config.UDDIClerk;
@@ -59,15 +59,19 @@ public class UddiKeyGenerator {
             AuthToken rootAuthToken = security.getAuthToken(getAuthTokenRoot);
             System.out.println("uddi AUTHTOKEN = " + rootAuthToken.getAuthInfo());
             SaveTModel st = new SaveTModel();
-           /*st.setAuthInfo(rootAuthToken.getAuthInfo());
+            st.setAuthInfo(rootAuthToken.getAuthInfo());
             st.getTModel().add(UDDIClerk.createKeyGenator("uddi:bea.com:keygenerator", "uddi:bea.com:keygenerator", "en"));
             publish.saveTModel(st);
 
+            //Hey! tModel Key Generators can be nested too!
+
             st = new SaveTModel();
             st.setAuthInfo(rootAuthToken.getAuthInfo());
             st.getTModel().add(UDDIClerk.createKeyGenator("uddi:bea.com:servicebus.default:keygenerator", "bea.com:servicebus.default", "en"));
             publish.saveTModel(st);
-*/
+
+
+            // This code block proves that you can create tModels based on a nested keygen
             st = new SaveTModel();
             TModel m = new TModel();
             m.setTModelKey("uddi:bea.com:servicebus.default.proxytest2");
@@ -77,7 +81,6 @@ public class UddiKeyGenerator {
             publish.saveTModel(st);
 
 
-
         } catch (Exception e) {
             e.printStackTrace();
         }

Copied: juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiRelatedBusinesses.java (from r1486692, juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiRelatedBusinesses.java)
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiRelatedBusinesses.java?p2=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiRelatedBusinesses.java&p1=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiRelatedBusinesses.java&r1=1486692&r2=1488804&rev=1488804&view=diff
==============================================================================
--- juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiRelatedBusinesses.java (original)
+++ juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiRelatedBusinesses.java Sun Jun  2 22:37:31 2013
@@ -2,7 +2,7 @@
  * To change this template, choose Tools | Templates
  * and open the template in the editor.
  */
-package uddi.createbulk;
+package uddi.examples;
 
 import java.util.ArrayList;
 import java.util.GregorianCalendar;
@@ -20,7 +20,7 @@ import org.uddi.v3_service.UDDIPublicati
 import org.uddi.v3_service.UDDISecurityPortType;
 
 /**
- *
+ * This will create two businesses under different users, then setup a relationship between the two
  * @author Alex
  */
 public class UddiRelatedBusinesses {
@@ -55,10 +55,18 @@ public class UddiRelatedBusinesses {
             GetAuthToken getAuthTokenRoot = new GetAuthToken();
             getAuthTokenRoot.setUserID("root");
             getAuthTokenRoot.setCred("root");
+            
+            
+            GetAuthToken getAuthTokenUDDI = new GetAuthToken();
+            getAuthTokenRoot.setUserID("uddi");
+            getAuthTokenRoot.setCred("uddi");
 
             // Making API call that retrieves the authentication token for the 'root' user.
             AuthToken rootAuthToken = security.getAuthToken(getAuthTokenRoot);
             System.out.println("root AUTHTOKEN = " + rootAuthToken.getAuthInfo());
+            
+            AuthToken UDDIAuthToken = security.getAuthToken(getAuthTokenUDDI);
+            System.out.println("UDDI AUTHTOKEN = " + rootAuthToken.getAuthInfo());
 
 
 
@@ -66,7 +74,7 @@ public class UddiRelatedBusinesses {
             GregorianCalendar gcal = new GregorianCalendar();
             gcal.setTimeInMillis(System.currentTimeMillis());
             XMLGregorianCalendar xcal = df.newXMLGregorianCalendar(gcal);
-            for (int i = 0; i < 1; i++) {
+            for (int i = 0; i < 1; i++) {   //this loop is used for testing at scale
                 // Creating the parent business entity that will contain our service.
                 BusinessEntity myBusEntity = new BusinessEntity();
                 Name myBusName = new Name();
@@ -92,11 +100,14 @@ public class UddiRelatedBusinesses {
                 // Adding the business entity to the "save" structure, using our publisher's authentication info and saving away.
                 sb = new SaveBusiness();
                 sb.getBusinessEntity().add(myBusEntity);
-                sb.setAuthInfo(rootAuthToken.getAuthInfo());
+                sb.setAuthInfo(UDDIAuthToken.getAuthInfo());
                 bd = publish.saveBusiness(sb);
                 String myBusKey2 = bd.getBusinessEntity().get(0).getBusinessKey();
                 System.out.println("myBusiness key:  " + myBusKey2);
 
+                //ROOT creates half of the relationship
+                
+                //create a business relationship (publisher assertion)
                 Holder<List<PublisherAssertion>> x = new Holder<List<PublisherAssertion>>();
                 PublisherAssertion pa = new PublisherAssertion();
                 pa.setFromKey(myBusKey2);
@@ -110,7 +121,9 @@ public class UddiRelatedBusinesses {
                 x.value.add(pa);
                 publish.setPublisherAssertions(rootAuthToken.getAuthInfo(), x);
 
-
+                //now "UDDI" the user, creates the other half. It has to be mirrored exactly
+                
+                
                 x = new Holder<List<PublisherAssertion>>();
                 pa = new PublisherAssertion();
                 pa.setFromKey(myBusKey1);
@@ -122,8 +135,17 @@ public class UddiRelatedBusinesses {
                 pa.getKeyedReference().setTModelKey("uddi:uddi.org:relationships");
                 x.value = new ArrayList<PublisherAssertion>();
                 x.value.add(pa);
-                publish.setPublisherAssertions(rootAuthToken.getAuthInfo(), x);
-
+                publish.setPublisherAssertions(UDDIAuthToken.getAuthInfo(), x);
+                
+                /*
+                 * Here's some notes:
+                 * You can use
+                 * List<AssertionStatusItem> assertionStatusReport = publish.getAssertionStatusReport(UDDIAuthToken.getAuthInfo(), CompletionStatus.STATUS_FROM_KEY_INCOMPLETE);
+                 * to determine if there's any assertions/relationships requests that are pending
+                 * this should have one item it in, the relationship that's incomplete
+                 * 
+                 * There's also publish.deletePublisherAssertions();
+                 */
 
             }
         } catch (Exception e) {

Copied: juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiSubscribe.java (from r1486692, juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiSubscribe.java)
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiSubscribe.java?p2=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiSubscribe.java&p1=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiSubscribe.java&r1=1486692&r2=1488804&rev=1488804&view=diff
==============================================================================
--- juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiSubscribe.java (original)
+++ juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiSubscribe.java Sun Jun  2 22:37:31 2013
@@ -2,7 +2,7 @@
  * To change this template, choose Tools | Templates
  * and open the template in the editor.
  */
-package uddi.createbulk;
+package uddi.examples;
 
 import java.util.ArrayList;
 import java.util.GregorianCalendar;
@@ -26,7 +26,7 @@ import org.uddi.v3_service.UDDISecurityP
 import org.uddi.v3_service.UDDISubscriptionPortType;
 
 /**
- *
+ * Thie class shows you how to create a business and a subscription using UDDI Subscription asynchronous callbacks
  * @author Alex
  */
 public class UddiSubscribe {
@@ -59,77 +59,9 @@ public class UddiSubscribe {
         }
     }
 
-    public void publish() {
-        try {
-            // Setting up the values to get an authentication token for the 'root' user ('root' user has admin privileges
-            // and can save other publishers).
-
-
-
-            GetAuthToken getAuthTokenRoot = new GetAuthToken();
-            getAuthTokenRoot.setUserID("root");
-            getAuthTokenRoot.setCred("root");
-
-            // Making API call that retrieves the authentication token for the 'root' user.
-            AuthToken rootAuthToken = security.getAuthToken(getAuthTokenRoot);
-            System.out.println("root AUTHTOKEN = " + rootAuthToken.getAuthInfo());
-
-
-            getAuthTokenRoot = new GetAuthToken();
-            getAuthTokenRoot.setUserID("uddi");
-            getAuthTokenRoot.setCred("uddi");
-
-            // Making API call that retrieves the authentication token for the 'root' user.
-            AuthToken uddiAuthToken = security.getAuthToken(getAuthTokenRoot);
-            System.out.println("uddi AUTHTOKEN = " + rootAuthToken.getAuthInfo());
-
-
-
-
-
-
-            DatatypeFactory df = DatatypeFactory.newInstance();
-            GregorianCalendar gcal = new GregorianCalendar();
-            gcal.setTimeInMillis(System.currentTimeMillis());
-            XMLGregorianCalendar xcal = df.newXMLGregorianCalendar(gcal);
-
-            // Creating the parent business entity that will contain our service.
-            BusinessEntity myBusEntity = new BusinessEntity();
-            Name myBusName = new Name();
-            myBusName.setLang("en");
-            myBusName.setValue("My Business Dept 1" + " " + xcal.toString());
-            myBusEntity.getName().add(myBusName);
-
-            // Adding the business entity to the "save" structure, using our publisher's authentication info and saving away.
-            SaveBusiness sb = new SaveBusiness();
-            sb.getBusinessEntity().add(myBusEntity);
-            sb.setAuthInfo(rootAuthToken.getAuthInfo());
-            BusinessDetail bd = publish.saveBusiness(sb);
-            String myBusKey1 = bd.getBusinessEntity().get(0).getBusinessKey();
-            System.out.println("myBusiness key:  " + myBusKey1);
-
-            Holder<List<Subscription>> subs = new Holder<List<Subscription>>();
-            subs.value = new ArrayList<Subscription>();
-            Subscription sub = new Subscription();
-            sub.setMaxEntities(20);
-            sub.setSubscriptionFilter(new SubscriptionFilter());
-            sub.getSubscriptionFilter().setGetBusinessDetail(new GetBusinessDetail());
-            sub.getSubscriptionFilter().getGetBusinessDetail().getBusinessKey().add(myBusKey1);
-            sub.getSubscriptionFilter().setGetAssertionStatusReport(new GetAssertionStatusReport());
-            //  sub.getSubscriptionFilter().s
-            //uddi:juddi.apache.org:72619170-d391-41cb-99a0-238cb0b76eb9
-            subs.value.add(sub);
-            uddiSubscriptionService.saveSubscription(rootAuthToken.getAuthInfo(), subs);
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
     public static void main(String args[]) throws Exception {
         UddiSubscribe sp = new UddiSubscribe();
         sp.SetupAndRegisterCallback();
-        //sp.publish();
     }
 
     private void SetupAndRegisterCallback() throws Exception {

Copied: juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiSubscribeGet.java (from r1486692, juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiSubscribeGet.java)
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiSubscribeGet.java?p2=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiSubscribeGet.java&p1=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiSubscribeGet.java&r1=1486692&r2=1488804&rev=1488804&view=diff
==============================================================================
--- juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiSubscribeGet.java (original)
+++ juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiSubscribeGet.java Sun Jun  2 22:37:31 2013
@@ -2,32 +2,23 @@
  * To change this template, choose Tools | Templates
  * and open the template in the editor.
  */
-package uddi.createbulk;
+package uddi.examples;
 
-import java.util.ArrayList;
-import java.util.GregorianCalendar;
 import java.util.List;
 import javax.xml.bind.JAXB;
-import javax.xml.datatype.DatatypeFactory;
-import javax.xml.datatype.XMLGregorianCalendar;
-import javax.xml.ws.Endpoint;
-import javax.xml.ws.Holder;
-import org.apache.juddi.v3.client.UDDIConstants;
 import org.apache.juddi.v3.client.config.UDDIClient;
 import org.apache.juddi.v3.client.config.UDDIClientContainer;
 import org.apache.juddi.v3.client.transport.Transport;
 import org.apache.juddi.v3_service.JUDDIApiPortType;
 import org.uddi.api_v3.*;
-import org.uddi.sub_v3.DeleteSubscription;
 import org.uddi.sub_v3.Subscription;
-import org.uddi.sub_v3.SubscriptionFilter;
 import org.uddi.v3_service.UDDIInquiryPortType;
 import org.uddi.v3_service.UDDIPublicationPortType;
 import org.uddi.v3_service.UDDISecurityPortType;
 import org.uddi.v3_service.UDDISubscriptionPortType;
 
 /**
- *
+ * This class shows you how to retrieve all defined subscriptions (just the definition, not the content/results) given a user/pass
  * @author Alex
  */
 public class UddiSubscribeGet {

Copied: juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiSubscribeValidate.java (from r1486692, juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiSubscribeValidate.java)
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiSubscribeValidate.java?p2=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiSubscribeValidate.java&p1=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiSubscribeValidate.java&r1=1486692&r2=1488804&rev=1488804&view=diff
==============================================================================
--- juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/UddiSubscribeValidate.java (original)
+++ juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/UddiSubscribeValidate.java Sun Jun  2 22:37:31 2013
@@ -2,7 +2,7 @@
  * To change this template, choose Tools | Templates
  * and open the template in the editor.
  */
-package uddi.createbulk;
+package uddi.examples;
 
 import java.util.ArrayList;
 import java.util.Calendar;
@@ -28,7 +28,7 @@ import org.uddi.v3_service.UDDISubscript
 import org.uddi.v3_service.UDDISubscriptionPortType;
 
 /**
- *
+ * This class shows you how to get the results of an existing subscription in UDDI.
  * @author Alex
  */
 public class UddiSubscribeValidate {
@@ -62,7 +62,7 @@ public class UddiSubscribeValidate {
         }
     }
 
-    public void publish() {
+    private void publish() {
         try {
             // Setting up the values to get an authentication token for the 'root' user ('root' user has admin privileges
             // and can save other publishers).
@@ -74,8 +74,6 @@ public class UddiSubscribeValidate {
             AuthToken rootAuthToken = security.getAuthToken(getAuthTokenRoot);
             System.out.println("root AUTHTOKEN = " + rootAuthToken.getAuthInfo());
 
-//uddiSubscriptionListenerService.notifySubscriptionListener()
-
             DatatypeFactory df = DatatypeFactory.newInstance();
             GregorianCalendar gcal = new GregorianCalendar();
             gcal.setTimeInMillis(System.currentTimeMillis());
@@ -84,12 +82,14 @@ public class UddiSubscribeValidate {
                 //
                 GetSubscriptionResults req = new GetSubscriptionResults();
                 req.setAuthInfo(rootAuthToken.getAuthInfo());
+                //TODO insert your subscription key values here
                 req.setSubscriptionKey("uddi:juddi.apache.org:72619170-d391-41cb-99a0-238cb0b76eb9");
                 req.setCoveragePeriod(new CoveragePeriod());
                 req.getCoveragePeriod().setEndPoint(xcal);
 
 
                 gcal = new GregorianCalendar();
+                //Time range that we want change logs on
                 gcal.add(Calendar.MONTH, -1);
                 req.getCoveragePeriod().setStartPoint(df.newXMLGregorianCalendar(gcal));
                 SubscriptionResultsList subscriptionResults = uddiSubscriptionService.getSubscriptionResults(req);

Copied: juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/WsdlImport.java (from r1486692, juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/WsdlImport.java)
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/WsdlImport.java?p2=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/WsdlImport.java&p1=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/WsdlImport.java&r1=1486692&r2=1488804&rev=1488804&view=diff
==============================================================================
--- juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/WsdlImport.java (original)
+++ juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/WsdlImport.java Sun Jun  2 22:37:31 2013
@@ -2,7 +2,7 @@
  * To change this template, choose Tools | Templates
  * and open the template in the editor.
  */
-package uddi.createbulk;
+package uddi.examples;
 
 import java.io.File;
 import java.net.URL;
@@ -34,6 +34,8 @@ import org.uddi.v3_service.UDDIPublicati
 import org.uddi.v3_service.UDDISecurityPortType;
 
 /**
+ * This class shows how to perform a WSDL2UDDI import manually. More
+ * specifically, this is WSDL2UDDI without using annotations.
  *
  * @author Alex O'Ree
  */
@@ -74,10 +76,11 @@ public class WsdlImport {
         //step two, identify the key used for all your stuff
         //you must have a key generator created already
         //here, we are assuming that you don't have one
+        //NOTE: these are some of the publically available WSDLs that were used to test WSDL2UDDI
         URL url = new URL("http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL");
         //http://www.bccs.uni.no/~pve002/wsdls/ebi-mafft.wsdl");
         //http://www.webservicex.net/GenericNAICS.asmx?WSDL");
-//http://www.webservicex.net/stockquote.asmx?WSDL");
+        //http://www.webservicex.net/stockquote.asmx?WSDL");
         //http://www.webservicex.com/globalweather.asmx?WSDL");
         //http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl");
         String domain = url.getHost();
@@ -134,7 +137,8 @@ public class WsdlImport {
             tms.getTModel().add(tmodels[i]);
         }
 
-        //publish.saveTModel(stm);
+        //important, you'll need to save your new tModels, or else saving the business/service may fail
+        publish.saveTModel(stm);
 
 
 
@@ -153,45 +157,17 @@ public class WsdlImport {
         BusinessEntity be = new BusinessEntity();
         be.setBusinessKey(businessServices.getBusinessService().get(0).getBusinessKey());
         be.getName().add(new Name());
+        //TODO, use some relevant here
         be.getName().get(0).setValue(domain);
         be.getName().get(0).setLang("en");
         be.setBusinessServices(businessServices);
         sb.getBusinessEntity().add(be);
         PrintUDDI<SaveBusiness> sbp = new PrintUDDI<SaveBusiness>();
         System.out.println("Request " + sbp.print(sb));
-        // publish.saveBusiness(sb);
+        publish.saveBusiness(sb);
 
         //and we're done
-
         //Be sure to report any problems to the jUDDI JIRA bug tracker at 
         //https://issues.apache.org/jira/browse/JUDDI
     }
-
-    private static void StripKeys(BusinessServices businessServices) {
-
-        for (int i = 0; i < businessServices.getBusinessService().size(); i++) {
-            businessServices.getBusinessService().get(i).setBusinessKey(null);
-            for (int k = 0; k < businessServices.getBusinessService().get(i).getBindingTemplates().getBindingTemplate().size(); k++) {
-                businessServices.getBusinessService().get(i).getBindingTemplates().getBindingTemplate().get(k).setBindingKey(null);
-            }
-        }
-    }
-
-    private void someting() throws Exception {
-        URL url = new URL("http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl");
-        String domain = url.getHost();
-        ReadWSDL rw = new ReadWSDL();
-        Definition wsdlDefinition = rw.readWSDL(url);
-        properties.put("keyDomain", domain);
-        properties.put("businessName", domain);
-        properties.put("serverName", url.getHost());
-        properties.put("serverPort", url.getPort());
-        wsdlURL = wsdlDefinition.getDocumentBaseURI();
-        WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, new URLLocalizerDefaultImpl(), properties);
-        BusinessServices businessServices = wsdl2UDDI.createBusinessServices(wsdlDefinition);
-        Map<QName, PortType> portTypes = (Map<QName, PortType>) wsdlDefinition.getAllPortTypes();
-        Set<TModel> portTypeTModels = wsdl2UDDI.createWSDLPortTypeTModels(wsdlURL, portTypes);
-        Map allBindings = wsdlDefinition.getAllBindings();
-        Set<TModel> createWSDLBindingTModels = wsdl2UDDI.createWSDLBindingTModels(wsdlURL, allBindings);
-    }
 }

Copied: juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/testStrings.java (from r1486692, juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/testStrings.java)
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/testStrings.java?p2=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/testStrings.java&p1=juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/testStrings.java&r1=1486692&r2=1488804&rev=1488804&view=diff
==============================================================================
--- juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/createbulk/testStrings.java (original)
+++ juddi/trunk/juddi-examples/uddi-createbulk/src/uddi/examples/testStrings.java Sun Jun  2 22:37:31 2013
@@ -2,7 +2,7 @@
  * To change this template, choose Tools | Templates
  * and open the template in the editor.
  */
-package uddi.createbulk;
+package uddi.examples;
 
 import java.util.concurrent.atomic.AtomicReference;
 import javax.xml.ws.Holder;

Modified: juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/api_v3/AccessPointType.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/api_v3/AccessPointType.java?rev=1488804&r1=1488803&r2=1488804&view=diff
==============================================================================
--- juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/api_v3/AccessPointType.java (original)
+++ juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/api_v3/AccessPointType.java Sun Jun  2 22:37:31 2013
@@ -35,6 +35,7 @@ public enum AccessPointType {
 	HOSTING_REDIRECTOR("hostingDirector"),
         /**
          * wsdlDeployment: designates that the accessPoint points to a remotely hosted WSDL document that already contains the necessary binding information, including the actual service endpoint.
+         *  The bindingTemplate of a Web service making use of indirection via a hostingRedirector Web service contains the bindingKey of the hosting redirector service’s bindingTemplate.  The hosting redirector’s bindingTemplate contains the accessPoint of the Hosting Redirector Web service
          */
 	WSDL_DEPLOYMENT ("wsdlDeployment");
 	



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org


Mime
View raw message