ws-scout-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r492257 [2/2] - in /webservices/scout/archives/trunk: ./ modules/scout/ modules/scout/src/java/org/apache/ws/scout/registry/ modules/scout/src/java/org/apache/ws/scout/transport/ modules/scout/src/java/org/apache/ws/scout/util/ modules/scou...
Date Wed, 03 Jan 2007 19:05:34 GMT
Modified: webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/registry/RegistryException.java
URL: http://svn.apache.org/viewvc/webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/registry/RegistryException.java?view=diff&rev=492257&r1=383275&r2=492257
==============================================================================
--- webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/registry/RegistryException.java (original)
+++ webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/registry/RegistryException.java Wed Jan  3 11:05:33 2007
@@ -13,57 +13,19 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.ws.scout.registry;
+package org.apache.ws.scout.registry; 
 
-import uddiOrgApiV2.DispositionReport;
-import uddiOrgApiV2.DispositionReportDocument;
-import uddiOrgApiV2.ErrInfo;
-import uddiOrgApiV2.Result;
+import java.io.IOException;
+
+import org.apache.ws.scout.uddi.v2.datatypes.*;
 
 /**
  * Thrown to indicate that a UDDI Exception was encountered.
- * 
- * <i>Borrowed from jUDDI project.</i>
  *
  * @author Steve Viens (sviens@apache.org)
  */
-public class RegistryException extends Exception
+public class RegistryException extends Exception implements RegistryObject
 {
-
-	public static final int E_ASSERTION_NOT_FOUND = 30000;
-	public static final int E_AUTH_TOKEN_EXPIRED = 10110;
-	public static final int E_AUTH_TOKEN_REQUIRED = 10120;
-	public static final int E_ACCOUNT_LIMIT_EXCEEDED = 10160;
-	public static final int E_BUSY = 10400;
-	public static final int E_CATEGORIZATION_NOT_ALLOWED = 20100;
-	public static final int E_FATAL_ERROR = 10500;
-	public static final int E_INVALID_KEY_PASSED = 10210;
-	public static final int E_INVALID_PROJECTION = 20230;
-	public static final int E_INVALID_CATEGORY = 20000;
-	public static final int E_INVALID_COMPLETION_STATUS = 30100;
-	public static final int E_INVALID_URL_PASSED = 10220;
-	public static final int E_INVALID_VALUE = 20200;
-	public static final int E_KEY_RETIRED = 10310;
-	public static final int E_LANGUAGE_ERROR = 10060;
-	public static final int E_MESSAGE_TOO_LARGE = 30110;
-	public static final int E_NAME_TOO_LONG = 10020;
-	public static final int E_OPERATOR_MISMATCH = 10130;
-	public static final int E_PUBLISHER_CANCELLED = 30220;
-	public static final int E_REQUEST_DENIED = 30210;
-	public static final int E_SECRET_UNKNOWN = 30230;
-	public static final int E_SUCCESS = 0;
-	public static final int E_TOO_MANY_OPTIONS = 10030;
-	public static final int E_TRANSFER_ABORTED = 30200;
-	public static final int E_UNRECOGNIZED_VERSION = 10040;
-	public static final int E_UNKNOWN_USER = 10150;
-	public static final int E_UNSUPPORTED = 10050;
-	public static final int E_USER_MISMATCH = 10140;
-	public static final int E_VALUE_NOT_ALLOWED = 20210;
-	public static final int E_UNVALIDATABLE = 20220;
-	public static final int E_REQUEST_TIMEOUT = 20240;
-	public static final int E_INVALID_TIME = 40030;
-	public static final int E_RESULT_SET_TOO_LARGE = 40300;
-
   // SOAP SOAPFault Actor
   private String faultActor;
 
@@ -136,35 +98,17 @@
   /**
    * Constructs a RegistryException instance.
    * @param ex the original exception
+ * @throws IOException 
    */
-  RegistryException(String fCode,int errno,String msg)
+  RegistryException(String fCode,int errno,String msg) throws IOException
   {
     super(buildMessage(errno,msg));
 
-    String errCode = lookupErrCode(errno);
+    String errCode = org.apache.ws.scout.uddi.v2.datatypes.Result.lookupErrCode(errno);
 
-    if (fCode != null) {
-    	setFaultCode(fCode);
-    }
-    
+    setFaultCode(fCode);
     setFaultString(getMessage());
-    
-    Result r = Result.Factory.newInstance();
-    ErrInfo ei = ErrInfo.Factory.newInstance();
-
-    if (errCode != null) {
-    	ei.setErrCode(errCode);
-    }
-
-    ei.setStringValue(getMessage());
-
-   	r.setErrno(errno);
-
-    if (ei != null) {
-    	r.setErrInfo(ei);
-    }
-
-    addResult(r);
+    addResult(new org.apache.ws.scout.uddi.v2.datatypes.Result(errno,errCode,getMessage()));
   }
 
   /**
@@ -247,18 +191,11 @@
    * Adds a result instance to this Exception. Multiple result objects
    * may exist within a DispositionReport
    */
-  public void addResult(Result result)
+  public void addResult(org.apache.ws.scout.uddi.v2.datatypes.Result result)
   {
-    if (this.dispReport==null) {
-  	  DispositionReportDocument doc = DispositionReportDocument.Factory.newInstance();
-      this.dispReport = doc.addNewDispositionReport();
-    }
-
-    Result r = this.dispReport.addNewResult();
-    
-    if (result.getErrInfo() != null) r.setErrInfo(result.getErrInfo());
-    if (result.getKeyType() != null) r.setKeyType(result.getKeyType());
-    r.setErrno(result.getErrno());
+    if (this.dispReport==null)
+      this.dispReport = new DispositionReport();
+    this.dispReport.addResult(result);
   }
 
   /**
@@ -273,11 +210,11 @@
       return getMessage();
   }
   
-  private static final String buildMessage(int errno,String msg)
+  private static final String buildMessage(int errno,String msg) throws IOException
   {
     StringBuffer buffer = new StringBuffer();
     
-    String errCode = lookupErrCode(errno);
+    String errCode = org.apache.ws.scout.uddi.v2.datatypes.Result.lookupErrCode(errno);
     if (errCode != null)
     {
       buffer.append(errCode);
@@ -288,9 +225,7 @@
     buffer.append(errno);
     buffer.append(") ");
     
-    //String errText = lookupErrText(errno);
-    // FIXME: What should error text be?
-    String errText = "";
+    String errText = org.apache.ws.scout.uddi.v2.datatypes.Result.lookupErrText(errno);
     if (errText != null)
     {
       buffer.append(errText);
@@ -303,46 +238,5 @@
     }
     
     return buffer.toString();
-  }
-
-  public static final String lookupErrCode(int errno)
-  {
-	  switch (errno)
-	  {
-	  case E_ACCOUNT_LIMIT_EXCEEDED     : return "E_accountLimitExceeded";
-	  case E_ASSERTION_NOT_FOUND        : return "E_assertionNotFound"; 
-	  case E_AUTH_TOKEN_EXPIRED         : return "E_authTokenExpired";
-	  case E_AUTH_TOKEN_REQUIRED        : return "E_authTokenRequired";
-	  case E_BUSY                       : return "E_busy";
-	  case E_CATEGORIZATION_NOT_ALLOWED : return "E_categorizationNotAllowed";
-	  case E_FATAL_ERROR                : return "E_fatalError";
-	  case E_INVALID_CATEGORY           : return "E_invalidCategory";
-	  case E_INVALID_COMPLETION_STATUS  : return "E_invalidCompletionStatus";
-	  case E_INVALID_KEY_PASSED         : return "E_invalidKeyPassed";
-	  case E_INVALID_PROJECTION         : return "E_invalidProjection";
-	  case E_INVALID_TIME               : return "E_invalidTime";
-	  case E_INVALID_URL_PASSED         : return "E_invalidURLPassed";
-	  case E_INVALID_VALUE              : return "E_invalidValue";
-	  case E_KEY_RETIRED                : return "E_keyRetired";
-	  case E_LANGUAGE_ERROR             : return "E_languageError";
-	  case E_MESSAGE_TOO_LARGE          : return "E_messageTooLarge";
-	  case E_NAME_TOO_LONG              : return "E_nameTooLong";
-	  case E_OPERATOR_MISMATCH          : return "E_operatorMismatch";
-	  case E_PUBLISHER_CANCELLED        : return "E_publisherCancelled";
-	  case E_REQUEST_DENIED             : return "E_requestDenied";
-	  case E_REQUEST_TIMEOUT            : return "E_requestTimeout";
-	  case E_RESULT_SET_TOO_LARGE       : return "E_resultSetTooLarge";
-	  case E_SECRET_UNKNOWN             : return "E_secretUnknown";
-	  case E_SUCCESS                    : return "E_success";
-	  case E_TOO_MANY_OPTIONS           : return "E_tooManyOptions";
-	  case E_TRANSFER_ABORTED           : return "E_transferAborted";
-	  case E_UNKNOWN_USER               : return "E_unknownUser";
-	  case E_UNRECOGNIZED_VERSION       : return "E_unrecognizedVersion";
-	  case E_UNSUPPORTED                : return "E_unsupported";
-	  case E_UNVALIDATABLE              : return "E_unvalidatable";
-	  case E_USER_MISMATCH              : return "E_userMismatch";
-	  case E_VALUE_NOT_ALLOWED          : return "E_valueNotAllowed";
-	  default                           : return null;
-	  }
-  }  
+  } 
 }

Modified: webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/registry/RegistryServiceImpl.java
URL: http://svn.apache.org/viewvc/webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/registry/RegistryServiceImpl.java?view=diff&rev=492257&r1=383275&r2=492257
==============================================================================
--- webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/registry/RegistryServiceImpl.java (original)
+++ webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/registry/RegistryServiceImpl.java Wed Jan  3 11:05:33 2007
@@ -39,7 +39,7 @@
  */
 public class RegistryServiceImpl implements RegistryService
 {
-    private final RegistryImpl registry;
+    private final RegistryProxy registry;
     private final BusinessQueryManagerImpl queryManager;
     private final BusinessLifeCycleManagerImpl lifeCycleManager;
 
@@ -49,9 +49,10 @@
 
     private ConnectionImpl connection;
 
-    public RegistryServiceImpl(RegistryImpl registry, String postalScheme, int maxRows)
+    public RegistryServiceImpl(IRegistryUddiV2 registry, 
+    		String postalScheme, int maxRows)
     {
-        this.registry = registry;
+        this.registry = (RegistryProxy) registry;
         this.maxRows = maxRows;
         queryManager = new BusinessQueryManagerImpl(this);
         lifeCycleManager = new BusinessLifeCycleManagerImpl(this);
@@ -65,7 +66,7 @@
         }
     }
 
-    IRegistry getRegistry()
+    IRegistryUddiV2 getRegistry()
     {
         return registry;
     }

Modified: webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/transport/AxisTransport.java
URL: http://svn.apache.org/viewvc/webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/transport/AxisTransport.java?view=diff&rev=492257&r1=383275&r2=492257
==============================================================================
--- webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/transport/AxisTransport.java (original)
+++ webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/transport/AxisTransport.java Wed Jan  3 11:05:33 2007
@@ -25,10 +25,10 @@
 import org.apache.axis.Message;
 import org.apache.axis.client.Call;
 import org.apache.axis.client.Service;
-import org.apache.axis.message.SOAPBodyElement;
+import org.apache.axis.message.SOAPBodyElement; 
 import org.apache.axis.utils.XMLUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+ 
+import org.apache.log4j.Logger;
 import org.w3c.dom.Element;
 
 /**
@@ -41,7 +41,7 @@
 public class AxisTransport implements Transport
 {
   // private reference to the jUDDI logger
-  private static Log log = LogFactory.getLog(AxisTransport.class);
+  private static Logger log = Logger.getLogger(AxisTransport.class);
 
   public Element send(Element request,URL endpointURL)
     throws RegistryException

Modified: webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java
URL: http://svn.apache.org/viewvc/webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java?view=diff&rev=492257&r1=383275&r2=492257
==============================================================================
--- webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java (original)
+++ webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java Wed Jan  3 11:05:33 2007
@@ -1,678 +1,510 @@
-/**
- *
- * Copyright 2004 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.ws.scout.util;
-
-import uddiOrgApiV2.Address;
-import uddiOrgApiV2.AddressLine;
-import uddiOrgApiV2.DiscoveryURL;
-import uddiOrgApiV2.DiscoveryURLs;
-import uddiOrgApiV2.Email;
-import uddiOrgApiV2.KeyedReference;
-import uddiOrgApiV2.Name;
-import uddiOrgApiV2.Phone;
-import uddiOrgApiV2.PublisherAssertion;
-import uddiOrgApiV2.BusinessEntity;
-import uddiOrgApiV2.Contacts;
-import uddiOrgApiV2.Contact;
-import uddiOrgApiV2.BusinessService;
-import uddiOrgApiV2.BusinessServices;
-import uddiOrgApiV2.TModel;
-import uddiOrgApiV2.AccessPoint;
-import uddiOrgApiV2.BindingTemplate;
-import uddiOrgApiV2.Description;
-import uddiOrgApiV2.HostingRedirector;
-import uddiOrgApiV2.IdentifierBag;
-import uddiOrgApiV2.URLType;
-import uddiOrgApiV2.TModelInstanceDetails;
-import uddiOrgApiV2.TModelInstanceInfo;
-
-import org.apache.ws.scout.registry.infomodel.InternationalStringImpl;
-
-import javax.xml.registry.infomodel.*;
-import javax.xml.registry.JAXRException;
-import java.util.Locale;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.StringTokenizer;
-
-/**
- * Helper class that does Jaxr->UDDI Mapping
- *
- * @author <a href="mailto:anil@apache.org">Anil Saldhana</a>
- * @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
- */
-public class ScoutJaxrUddiHelper {
-    /**
-     * Get UDDI Address given JAXR Postal Address
-     */
-	public static Address getAddress(PostalAddress post) throws JAXRException {
-		Address address = Address.Factory.newInstance();
-
-		AddressLine[] addarr = new AddressLine[6];
-
-        String stnum = post.getStreetNumber();
-        String st = post.getStreet();
-        String city = post.getCity();
-        String country = post.getCountry();
-        String code = post.getPostalCode();
-        String state = post.getStateOrProvince();
-
-		AddressLine stnumAL = AddressLine.Factory.newInstance();
-        stnumAL.setKeyName("STREET_NUMBER");
-		if (stnum != null) {
-        stnumAL.setKeyValue(stnum);
-		}
-
-		AddressLine stAL = AddressLine.Factory.newInstance();
-        stAL.setKeyName("STREET");
-		if (st != null) {
-        stAL.setKeyValue(st);
-		}
-
-		AddressLine cityAL = AddressLine.Factory.newInstance();
-        cityAL.setKeyName("CITY");
-		if (city != null) {
-        cityAL.setKeyValue(city);
-		}
-
-		AddressLine countryAL = AddressLine.Factory.newInstance();
-        countryAL.setKeyName("COUNTRY");
-		if (country != null) {
-        countryAL.setKeyValue(country);
-		}
-
-		AddressLine codeAL = AddressLine.Factory.newInstance();
-        codeAL.setKeyName("POSTALCODE");
-		if (code != null) {
-        codeAL.setKeyValue(code);
-		}
-
-		AddressLine stateAL = AddressLine.Factory.newInstance();
-        stateAL.setKeyName("STATE");
-		if (state != null) {
-        stateAL.setKeyValue(state);
-		}
-
-		// Add the AddressLine to vector
-		addarr[0] = stnumAL;
-		addarr[1] = stAL;
-		addarr[2] = cityAL;
-		addarr[3] = countryAL;
-		addarr[4] = codeAL;
-		addarr[5] = stateAL;
-
-		address.setAddressLineArray(addarr);
-
-        return address;
-    }
-
-	public static BindingTemplate getBindingTemplateFromJAXRSB(
-			ServiceBinding serve) throws JAXRException {
-		BindingTemplate bt = BindingTemplate.Factory.newInstance();
-		if (serve.getKey() != null && serve.getKey().getId() != null)
-			bt.setBindingKey(serve.getKey().getId());
-		try {
-			// Set Access URI
-            String accessuri = serve.getAccessURI();
-			if (accessuri != null) {
-				AccessPoint ap = AccessPoint.Factory.newInstance();
-                ap.setURLType(getURLType(accessuri));
-				ap.setStringValue(accessuri);
-                bt.setAccessPoint(ap);
-            }
-            ServiceBinding sb = serve.getTargetBinding();
-			if (sb != null) {
-				HostingRedirector red = HostingRedirector.Factory.newInstance();
-                Key key = sb.getKey();
-				if (key != null && key.getId() != null)
-					red.setBindingKey(key.getId());
-                bt.setHostingRedirector(red);
-            }
-			// TODO:Need to look further at the mapping b/w BindingTemplate and
-			// Jaxr ServiceBinding
-
-			// Get Service information
-           Service svc = serve.getService();
-			if (svc != null && svc.getKey() != null && svc.getKey().getId() != null) {
-              bt.setServiceKey(svc.getKey().getId());
-           }
-
-			Description emptyDesc = bt.addNewDescription();
-
-			if (((RegistryObject) serve).getDescription() != null && 
-				((RegistryObject) serve).getDescription().getValue() != null) {
-
-				emptyDesc.setStringValue(((RegistryObject) serve)
-						.getDescription().getValue());
-
-			}
-
-			// SpecificationLink
-           Collection slcol = serve.getSpecificationLinks();
-			TModelInstanceDetails tid = TModelInstanceDetails.Factory
-					.newInstance();
-			if (slcol != null && slcol.isEmpty() != false) {
-              Iterator iter = slcol.iterator();
-				while (iter.hasNext()) {
-					SpecificationLink slink = (SpecificationLink) iter.next();
-
-					TModelInstanceInfo emptyTInfo = tid
-							.addNewTModelInstanceInfo();
-
-					if (slink.getSpecificationObject().getKey() != null && 
-						slink.getSpecificationObject().getKey().getId() != null) {
-						emptyTInfo.setTModelKey(slink.getSpecificationObject()
-								.getKey().getId());
-					}
-              }
-              bt.setTModelInstanceDetails(tid);
-           }
-            System.out.println("BindingTemplate=" + bt.toString());
-		} catch (Exception ud) {
-            throw new JAXRException("Apache JAXR Impl:", ud);
-        }
-        return bt;
-    }
-
-	public static PublisherAssertion getPubAssertionFromJAXRAssociation(
-			Association assc) throws JAXRException {
-		PublisherAssertion pa = PublisherAssertion.Factory.newInstance();
-		try {
-			if (assc.getSourceObject().getKey() != null && 
-				assc.getSourceObject().getKey().getId() != null) {
-            pa.setFromKey(assc.getSourceObject().getKey().getId());
-			}
-			
-			if (assc.getTargetObject().getKey() != null &&
-				assc.getTargetObject().getKey().getId() != null) {
-            pa.setToKey(assc.getTargetObject().getKey().getId());
-			}
-            Concept c = assc.getAssociationType();
-            String v = c.getValue();
-			KeyedReference kr = KeyedReference.Factory.newInstance();
-            Key key = c.getKey();
-			if (key == null) {
-				// TODO:Need to check this. If the concept is a predefined
-				// enumeration, the key can be the parent classification scheme
-                key = c.getClassificationScheme().getKey();
-            }
-			if (key == null || key.getId() == null) {
-				// The parent classification scheme may not always contain the
-				// key. It is okay if it doesn't, since the UDDI v2 spec allows
-				// TModelKey to be absent.
-
-				// TODO: This setting to "" should not be needed at all.
-				// However, a bug in jUDDI needs it to be there. See:
-				// http://issues.apache.org/jira/browse/JUDDI-78
-				kr.setTModelKey("");
-			} else {
-            kr.setTModelKey(key.getId());
-			}
-            kr.setKeyName("Concept");
-
-			if (v != null) {
-            kr.setKeyValue(v);
-			}
-
-            pa.setKeyedReference(kr);
-		} catch (Exception ud) {
-            throw new JAXRException("Apache JAXR Impl:", ud);
-        }
-        return pa;
-    }
-
-	public static PublisherAssertion getPubAssertionFromJAXRAssociationKey(
-			String key) throws JAXRException {
-		PublisherAssertion pa = PublisherAssertion.Factory.newInstance();
-		try {
-			StringTokenizer token = new StringTokenizer(key, ":");
-			if (token.hasMoreTokens()) {
-               pa.setFromKey(getToken(token.nextToken()));
-               pa.setToKey(getToken(token.nextToken()));
-				KeyedReference kr = KeyedReference.Factory.newInstance();
-				// Sometimes the Key is UUID:something
-               String str = getToken(token.nextToken());
-				if ("UUID".equals(str))
-					str += ":" + getToken(token.nextToken());
-               kr.setTModelKey(str);
-               kr.setKeyName(getToken(token.nextToken()));
-               kr.setKeyValue(getToken(token.nextToken()));
-               pa.setKeyedReference(kr);
-            }
-
-		} catch (Exception ud) {
-            throw new JAXRException("Apache JAXR Impl:", ud);
-        }
-        return pa;
-    }
-
-	public static BusinessService getBusinessServiceFromJAXRService(
-			Service serve) throws JAXRException {
-		BusinessService bs = BusinessService.Factory.newInstance();
-		try {
-			InternationalStringImpl iname = (InternationalStringImpl) ((RegistryObject) serve)
-					.getName();
-            String name = iname.getValue();
-			// bs.setDefaultNameString( name,
-			// Locale.getDefault().getLanguage());
-			Name emptyName = bs.addNewName();
-			
-			if (name != null) emptyName.setStringValue(name);
-			emptyName.setLang(Locale.getDefault().getLanguage());
-
-			Description emptyDesc = bs.addNewDescription();
-			
-			if (((RegistryObject) serve).getDescription() != null && 
-				((RegistryObject) serve).getDescription().getValue() != null) {
-
-				emptyDesc.setStringValue(((RegistryObject) serve).getDescription()
-						.getValue());
-			}
-
-            Organization o = serve.getProvidingOrganization();
-
-            /*
-             * there may not always be a key...
-             */
-            if (o != null) {
-                Key k = o.getKey();
-
-				if (k != null && k.getId() != null) {
-                    bs.setBusinessKey(k.getId());
-                }
-			} else {
-                /*
-                 * gmj - I *think* this is the right thing to do
-                 */
-				throw new JAXRException(
-						"Service has no associated organization");
-            }
-
-			if (serve.getKey() != null && serve.getKey().getId() != null) {
-                bs.setServiceKey(serve.getKey().getId());
-            }
-
-            System.out.println("BusinessService=" + bs.toString());
-		} catch (Exception ud) {
-            throw new JAXRException("Apache JAXR Impl:", ud);
-        }
-        return bs;
-    }
-
-	public static TModel getTModelFromJAXRClassificationScheme(
-			ClassificationScheme scheme) throws JAXRException {
-		TModel tm = TModel.Factory.newInstance();
-		try {
-            /*
-             * a fresh scheme might not have a key
-             */
-
-            Key k = scheme.getKey();
-
-			if (k != null && k.getId() != null) {
-                tm.setTModelKey(k.getId());
-
-            }
-
-            /*
-             * There's no reason to believe these are here either
-             */
-
-            Slot s = scheme.getSlot("authorizedName");
-
-			if (s != null && s.getName() != null) {
-                tm.setAuthorizedName(s.getName());
-            }
-
-            s = scheme.getSlot("operator");
-
-			if (s != null && s.getName() != null) {
-                tm.setOperator(s.getName());
-            }
-
-			InternationalStringImpl iname = (InternationalStringImpl) ((RegistryObject) scheme)
-					.getName();
-            String name = iname.getValue();
-
-			Name emptyName = tm.addNewName();
-			
-			if (name != null) {
-				emptyName.setStringValue(name);
-			}
-			emptyName.setLang(Locale.getDefault().getLanguage());
-
-			Description emptyDesc = tm.addNewDescription();
-			
-			if (scheme.getDescription() != null && scheme.getDescription().getValue() != null) {
-				emptyDesc.setStringValue(scheme.getDescription().getValue());
-			}
-			// ToDO: overviewDoc,identifierBag,categoryBag
-		} catch (Exception ud) {
-            throw new JAXRException("Apache JAXR Impl:", ud);
-        }
-        return tm;
-    }
-
-    public static TModel getTModelFromJAXRConcept(Concept scheme)
-			throws JAXRException {
-		TModel tm = TModel.Factory.newInstance();
-		if (scheme == null)
-			return null;
-		try {
-            Key key = scheme.getKey();
-			if (key != null && key.getId() != null)
-				tm.setTModelKey(key.getId());
-            Slot sl1 = scheme.getSlot("authorizedName");
-			if (sl1 != null && sl1.getName() != null)
-				tm.setAuthorizedName(sl1.getName());
-
-            Slot sl2 = scheme.getSlot("operator");
-			if (sl2 != null && sl2.getName() != null)
-				tm.setOperator(sl2.getName());
-
-			InternationalStringImpl iname = (InternationalStringImpl) ((RegistryObject) scheme)
-					.getName();
-            String name = iname.getValue();
-
-			Name emptyName = tm.addNewName();
-			
-			if (name != null) {
-				emptyName.setStringValue(name);
-			}
-			emptyName.setLang(Locale.getDefault().getLanguage());
-
-			Description emptyDesc = tm.addNewDescription();
-			
-			if (scheme.getDescription() != null && scheme.getDescription().getValue() != null) {
-				emptyDesc.setStringValue(scheme.getDescription().getValue());
-			}
-
-			// ToDO: overviewDoc,identifierBag,categoryBag
-		} catch (Exception ud) {
-            throw new JAXRException("Apache JAXR Impl:", ud);
-        }
-        return tm;
-    }
-
-    public static BusinessEntity getBusinessEntityFromJAXROrg(Organization org)
-			throws JAXRException {
-		BusinessEntity biz = BusinessEntity.Factory.newInstance();
-		BusinessServices bss = BusinessServices.Factory.newInstance();
-		BusinessService[] barr = new BusinessService[0];
-
-		try {
-			// It may just be an update
-            Key key = org.getKey();
-			if (key != null && key.getId() != null)
-				biz.setBusinessKey(key.getId());
-			// Lets get the Organization attributes at the top level
-            String language = Locale.getDefault().getLanguage();
-
-			Name emptyName = biz.addNewName();
-			
-			if (org.getName() != null && org.getName().getValue() != null) {
-				emptyName.setStringValue(org.getName().getValue());
-			}
-			emptyName.setLang(language);
-
-			Description emptyDesc = biz.addNewDescription();
-			
-			if (org.getDescription() != null && org.getDescription().getValue() != null) {
-				emptyDesc.setStringValue(org.getDescription().getValue());
-			}
-
-			if (org.getPrimaryContact() != null && 
-				org.getPrimaryContact().getPersonName()!= null &&
-				org.getPrimaryContact().getPersonName().getFullName() != null) {
-
-				biz.setAuthorizedName(org.getPrimaryContact().getPersonName()
-						.getFullName());
-			}
-
-            Collection s = org.getServices();
-            System.out.println("?Org has services=" + s.isEmpty());
-
-			barr = new BusinessService[s.size()];
-
-            Iterator iter = s.iterator();
-			int barrPos = 0;
-			while (iter.hasNext()) {
-				BusinessService bs = ScoutJaxrUddiHelper
-						.getBusinessServiceFromJAXRService((Service) iter
-								.next());
-				barr[barrPos] = bs;
-				barrPos++;
-            }
-
-            /*
-             * map users : JAXR has concept of 'primary contact', which is a
-             * special designation for one of the users, and D6.1 seems to say
-             * that the first UDDI user is the primary contact
-             */
-
-			Contacts cts = Contacts.Factory.newInstance();
-			Contact[] carr = new Contact[0];
-
-            User primaryContact = org.getPrimaryContact();
-            Collection users = org.getUsers();
-
-            // Expand array to necessary size only (xmlbeans does not like
-            // null items in cases like this)
-
-            int carrSize = 0;
-
-            if (primaryContact != null) {
-                carrSize += 1;
-            }
-
-            // TODO: Clean this up and make it more efficient
-            Iterator it = users.iterator();
-            while (it.hasNext()) {
-                User u = (User) it.next();
-                if (u != primaryContact) {
-                    carrSize++;
-                }
-            }
-
-            carr = new Contact[carrSize];
-
-            // TODO - remove this
-            System.out.println("?Org has users=" + users.isEmpty());
-
-            /*
-             * first do primary, and then filter that out in the loop
-             */
-            if (primaryContact != null) {
-                Contact ct = getContactFromJAXRUser(primaryContact);
-                carr[0] = ct;
-            }
-
-            it = users.iterator();
-            int carrPos = 1;
-            while (it.hasNext()) {
-                User u = (User) it.next();
-
-                if (u != primaryContact) {
-                    Contact ct = getContactFromJAXRUser(u);
-                    carr[carrPos] = ct;
-                    carrPos++;
-                }
-            }
-
-			bss.setBusinessServiceArray(barr);
-			cts.setContactArray(carr);
-            biz.setContacts(cts);
-
-            biz.setBusinessServices(bss);
-
-			// External Links
-            Iterator exiter = org.getExternalLinks().iterator();
-			while (exiter.hasNext()) {
-				ExternalLink link = (ExternalLink) exiter.next();
-				/** Note: jUDDI adds its own discoverURL as the businessEntity* */
-				DiscoveryURLs emptyDUs = biz.addNewDiscoveryURLs();
-				DiscoveryURL emptyDU = emptyDUs.addNewDiscoveryURL();
-				emptyDU.setUseType("businessEntityExt");
-				
-				if (link.getExternalURI() != null) {
-					emptyDU.setStringValue(link.getExternalURI());
-				}
-            }
-			// External Identifiers
-           Collection exid = org.getExternalIdentifiers();
-           Iterator exiditer = exid.iterator();
-			while (exiditer.hasNext()) {
-				ExternalIdentifier ei = (ExternalIdentifier) exiditer.next();
-
-				IdentifierBag ibag = biz.addNewIdentifierBag();
-				KeyedReference keyr = ibag.addNewKeyedReference();
-              Key ekey = ei.getKey();
-				if (ekey != null && ekey.getId() != null)
-					keyr.setTModelKey(ekey.getId());
-				
-				if (ei.getValue() != null) {
-              keyr.setKeyValue(ei.getValue());
-				}
-				
-				if (ei.getName() != null && ei.getName().getValue() != null) {
-              keyr.setKeyName(ei.getName().getValue());
-           }
-			}
-		} catch (Exception ud) {
-            throw new JAXRException("Apache JAXR Impl:", ud);
-        }
-        return biz;
-    }
-
-    /**
-	 * TODO - should we really return new Contact() rather than null on null
-	 * input?
-     *
-     * Convert JAXR User Object to UDDI  Contact
-     */
-    public static Contact getContactFromJAXRUser(User user)
-			throws JAXRException {
-		Contact ct = Contact.Factory.newInstance();
-
-        if (user == null) {
-            return ct;
-        }
-
-		Address[] addarr = new Address[0];
-		Phone[] phonearr = new Phone[0];
-		Email[] emailarr = new Email[0];
-		try {
-			
-			if (user.getPersonName() != null && user.getPersonName().getFullName() != null) {
-				ct.setPersonName(user.getPersonName().getFullName());
-			}
-			
-			if (user.getType() != null) {
-            ct.setUseType(user.getType());
-			}
-			// Postal Address
-            Collection postc = user.getPostalAddresses();
-
-			addarr = new Address[postc.size()];
-
-            Iterator iterator = postc.iterator();
-			int addarrPos = 0;
-			while (iterator.hasNext()) {
-                PostalAddress post = (PostalAddress) iterator.next();
-				addarr[addarrPos] = ScoutJaxrUddiHelper.getAddress(post);
-				addarrPos++;
-            }
-			// Phone Numbers
-            Collection ph = user.getTelephoneNumbers(null);
-
-			phonearr = new Phone[ph.size()];
-
-            Iterator it = ph.iterator();
-			int phonearrPos = 0;
-			while (it.hasNext()) {
-                TelephoneNumber t = (TelephoneNumber) it.next();
-				Phone phone = Phone.Factory.newInstance();
-                String str = t.getNumber();
-                System.out.println("Telephone=" + str);
-				
-				// FIXME: If phone number is null, should the phone 
-				// not be set at all, or set to empty string?
-				if (str != null) {
-					phone.setStringValue(str);
-				} else {
-					phone.setStringValue("");
-				}
-
-				phonearr[phonearrPos] = phone;
-				phonearrPos++;
-            }
-
-			// Email Addresses
-            Collection ec = user.getEmailAddresses();
-
-			emailarr = new Email[ec.size()];
-
-            Iterator iter = ec.iterator();
-			int emailarrPos = 0;
-			while (iter.hasNext()) {
-                EmailAddress ea = (EmailAddress) iter.next();
-				Email email = Email.Factory.newInstance();
-				
-				if (ea.getAddress() != null) {
-					email.setStringValue(ea.getAddress());
-				}
-				// email.setText( ea.getAddress() );
-				
-				if (ea.getType() != null) {
-                email.setUseType(ea.getType());
-            }
-
-				emailarr[emailarrPos] = email;
-				emailarrPos++;
-			}
-			ct.setAddressArray(addarr);
-			ct.setPhoneArray(phonearr);
-			ct.setEmailArray(emailarr);
-		} catch (Exception ud) {
-            throw new JAXRException("Apache JAXR Impl:", ud);
-        }
-        return ct;
-    }
-
-	private static String getToken(String tokenstr) {
-		// Token can have the value NULL which need to be converted into null
-		if (tokenstr.equals("NULL"))
-			tokenstr = "";
-      return tokenstr;
-   }
-
-	private static URLType.Enum getURLType(String accessuri) {
-       String acc = accessuri.toLowerCase();
-		URLType.Enum uri = URLType.OTHER;
-		if (acc.startsWith("http:"))
-			uri = URLType.HTTP;
-		else if (acc.startsWith("https:"))
-			uri = URLType.HTTPS;
-		else if (acc.startsWith("ftp:"))
-			uri = URLType.FTP;
-		else if (acc.startsWith("phone:"))
-			uri = URLType.PHONE;// TODO:Handle this better
-
-       return uri;
-   }
-
-}
+/**
+ *
+ * Copyright 2004 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.ws.scout.util;
+ 
+import org.apache.ws.scout.registry.infomodel.InternationalStringImpl;
+import org.apache.ws.scout.uddi.v2.datatypes.*;
+import org.apache.ws.scout.uddi.v2.datatypes.PersonName;
+
+import javax.xml.registry.infomodel.*; 
+import javax.xml.registry.infomodel.RegistryObject;
+import javax.xml.registry.JAXRException;
+import java.util.Vector;
+import java.util.Locale;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.StringTokenizer;
+
+/**
+ * Helper class that does Jaxr->UDDI Mapping
+ *
+ * @author <a href="mailto:anil@apache.org">Anil Saldhana</a>
+ * @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
+ */
+public class ScoutJaxrUddiHelper
+{
+    /**
+     * Get UDDI Address given JAXR Postal Address
+     */
+    public static Address getAddress(PostalAddress post)
+            throws JAXRException
+    {
+        Address address = new Address();
+
+        Vector addvect = new Vector();
+
+        String stnum = post.getStreetNumber();
+        String st = post.getStreet();
+        String city = post.getCity();
+        String country = post.getCountry();
+        String code = post.getPostalCode();
+        String state = post.getStateOrProvince();
+
+        AddressLine stnumAL = new AddressLine();
+        stnumAL.setKeyName("STREET_NUMBER");
+        stnumAL.setKeyValue(stnum);
+
+        AddressLine stAL = new AddressLine();
+        stAL.setKeyName("STREET");
+        stAL.setKeyValue(st);
+
+        AddressLine cityAL = new AddressLine();
+        cityAL.setKeyName("CITY");
+        cityAL.setKeyValue(city);
+
+        AddressLine countryAL = new AddressLine();
+        countryAL.setKeyName("COUNTRY");
+        countryAL.setKeyValue(country);
+
+        AddressLine codeAL = new AddressLine();
+        codeAL.setKeyName("POSTALCODE");
+        codeAL.setKeyValue(code);
+
+        AddressLine stateAL = new AddressLine();
+        stateAL.setKeyName("STATE");
+        stateAL.setKeyValue(state);
+
+        //Add the AddressLine to vector
+        addvect.add(stnumAL);
+        addvect.add(stAL);
+        addvect.add(cityAL);
+        addvect.add(countryAL);
+        addvect.add(codeAL);
+        addvect.add(stateAL);
+
+        address.setAddressLineVector(addvect);
+
+        return address;
+    }
+
+    public static BindingTemplate getBindingTemplateFromJAXRSB(ServiceBinding serve)
+            throws JAXRException
+    {
+        BindingTemplate bt = new BindingTemplate();
+        if( serve.getKey() != null) bt.setBindingKey(serve.getKey().getId());
+        try
+        {
+            //Set Access URI
+            String accessuri = serve.getAccessURI();
+            if (accessuri != null)
+            {
+                AccessPoint ap = new AccessPoint();
+                ap.setURLType(getURLType(accessuri));
+                ap.setURL(accessuri);
+                bt.setAccessPoint(ap);
+            }
+            ServiceBinding sb = serve.getTargetBinding();
+            if (sb != null)
+            {
+                HostingRedirector red = new HostingRedirector();
+                Key key = sb.getKey();
+                if( key != null) red.setBindingKey(key.getId());
+                bt.setHostingRedirector(red);
+            }
+            //TODO:Need to look further at the mapping b/w BindingTemplate and Jaxr ServiceBinding
+
+           //Get Service information
+           Service svc = serve.getService();
+           if( svc != null)
+           {
+              bt.setServiceKey(svc.getKey().getId());
+           }
+
+            bt.addDescription(new Description(((RegistryObject) serve).getDescription().getValue()));
+
+           //SpecificationLink
+           Collection slcol = serve.getSpecificationLinks();
+           TModelInstanceDetails tid = new TModelInstanceDetails();
+           if(slcol != null && slcol.isEmpty() != false)
+           {
+              Iterator iter = slcol.iterator();
+              while(iter.hasNext())
+              {
+                 SpecificationLink slink = (SpecificationLink)iter.next();
+
+                 TModelInstanceInfo tinfo = new TModelInstanceInfo();
+                 tinfo.setTModelKey(slink.getSpecificationObject().getKey().getId());
+                 tid.addTModelInstanceInfo(tinfo); 
+              }
+              bt.setTModelInstanceDetails(tid);
+           }
+            System.out.println("BindingTemplate=" + bt.toString());
+        } catch (Exception ud)
+        {
+            throw new JAXRException("Apache JAXR Impl:", ud);
+        }
+        return bt;
+    }
+
+    public static PublisherAssertion getPubAssertionFromJAXRAssociation(Association assc)
+            throws JAXRException
+    {
+        PublisherAssertion pa = new PublisherAssertion();
+        try
+        {
+            pa.setFromKey(assc.getSourceObject().getKey().getId());
+            pa.setToKey(assc.getTargetObject().getKey().getId());
+            Concept c = assc.getAssociationType();
+            String v = c.getValue();
+            KeyedReference kr = new KeyedReference();
+            Key key = c.getKey();
+            if(key == null )
+            {
+                //TODO:Need to check this.  If the concept is a predefined
+                //enumeration, the key can be the parent classification scheme
+                key = c.getClassificationScheme().getKey();
+            }
+            kr.setTModelKey(key.getId());
+            kr.setKeyName("Concept");
+            kr.setKeyValue(v);
+            pa.setKeyedReference(kr);
+        } catch (Exception ud)
+        {
+            throw new JAXRException("Apache JAXR Impl:", ud);
+        }
+        return pa;
+    }
+
+    public static PublisherAssertion getPubAssertionFromJAXRAssociationKey(String key)
+            throws JAXRException
+    {
+        PublisherAssertion pa = new PublisherAssertion();
+        try
+        {
+            StringTokenizer token = new  StringTokenizer(key,":");
+            if(token.hasMoreTokens())
+            {
+               pa.setFromKey(getToken(token.nextToken()));
+               pa.setToKey(getToken(token.nextToken()));
+               KeyedReference kr = new KeyedReference();
+               //Sometimes the Key is UUID:something
+               String str = getToken(token.nextToken());
+               if("UUID".equals(str)) str += ":" + getToken(token.nextToken());
+               kr.setTModelKey(str);
+               kr.setKeyName(getToken(token.nextToken()));
+               kr.setKeyValue(getToken(token.nextToken()));
+               pa.setKeyedReference(kr);
+            }
+
+        } catch (Exception ud)
+        {
+            throw new JAXRException("Apache JAXR Impl:", ud);
+        }
+        return pa;
+    }
+
+    public static BusinessService getBusinessServiceFromJAXRService(Service serve)
+            throws JAXRException
+    {
+        BusinessService bs = new BusinessService();
+        try
+        {
+            InternationalStringImpl iname = (InternationalStringImpl) ((RegistryObject) serve).getName();
+            String name = iname.getValue();
+            //bs.setDefaultNameString( name, Locale.getDefault().getLanguage());
+            bs.addName(new Name(name, Locale.getDefault().getLanguage()));
+            bs.addDescription(new Description(((RegistryObject) serve).getDescription().getValue()));
+
+            Organization o = serve.getProvidingOrganization();
+
+            /*
+             * there may not always be a key...
+             */
+            if (o != null) {
+                Key k = o.getKey();
+
+                if (k != null) {
+                    bs.setBusinessKey(k.getId());
+                }
+            }
+            else {
+                /*
+                 * gmj - I *think* this is the right thing to do
+                 */
+                throw new JAXRException("Service has no associated organization");
+            }
+
+            if (serve.getKey() != null) {
+                bs.setServiceKey(serve.getKey().getId());
+            }
+
+            System.out.println("BusinessService=" + bs.toString());
+        } catch (Exception ud)
+        {
+            throw new JAXRException("Apache JAXR Impl:", ud);
+        }
+        return bs;
+    }
+
+    public static TModel getTModelFromJAXRClassificationScheme(ClassificationScheme scheme)
+            throws JAXRException
+    {
+        TModel tm = new TModel();
+        try
+        {
+            /*
+             * a fresh scheme might not have a key
+             */
+
+            Key k = scheme.getKey();
+
+            if(k != null) {
+                tm.setTModelKey(k.getId());
+
+            }
+
+            /*
+             * There's no reason to believe these are here either
+             */
+
+            Slot s = scheme.getSlot("authorizedName");
+
+            if (s != null) {
+                tm.setAuthorizedName(s.getName());
+            }
+
+            s = scheme.getSlot("operator");
+
+            if (s != null) {
+                tm.setOperator(s.getName());
+            }
+
+            InternationalStringImpl iname = (InternationalStringImpl) ((RegistryObject) scheme).getName();
+            String name = iname.getValue();
+            tm.setName(new Name(name, Locale.getDefault().getLanguage()));
+            tm.addDescription(new Description( scheme.getDescription().getValue()));
+            //ToDO:  overviewDoc,identifierBag,categoryBag
+        } catch (Exception ud)
+        {
+            throw new JAXRException("Apache JAXR Impl:", ud);
+        }
+        return tm;
+    }
+
+    public static TModel getTModelFromJAXRConcept(Concept scheme)
+            throws JAXRException
+    {
+        TModel tm = new TModel();
+        if(scheme == null ) return null;
+        try
+        {
+            Key key = scheme.getKey();
+            if(key != null) tm.setTModelKey(key.getId());
+            Slot sl1 = scheme.getSlot("authorizedName");
+            if( sl1 != null ) tm.setAuthorizedName(sl1.getName());
+
+            Slot sl2 = scheme.getSlot("operator");
+            if( sl2 != null ) tm.setOperator(sl2.getName());
+
+
+            InternationalStringImpl iname = (InternationalStringImpl) ((RegistryObject) scheme).getName();
+            String name = iname.getValue();
+            tm.setName(new Name(name, Locale.getDefault().getLanguage()));
+            tm.addDescription(new Description( scheme.getDescription().getValue()));
+            //ToDO:  overviewDoc,identifierBag,categoryBag
+        } catch (Exception ud)
+        {
+            throw new JAXRException("Apache JAXR Impl:", ud);
+        }
+        return tm;
+    }
+
+    public static BusinessEntity getBusinessEntityFromJAXROrg(Organization org)
+            throws JAXRException
+    {
+        BusinessEntity biz = new BusinessEntity();
+        BusinessServices bss = new BusinessServices();
+        Vector bvect = new Vector();
+
+        try
+        {
+            //It may just be an update
+            Key key = org.getKey();
+            if(key  != null ) biz.setBusinessKey(key.getId());
+            //Lets get the Organization attributes at the top level
+            String language = Locale.getDefault().getLanguage();
+
+            biz.addName(new Name(org.getName().getValue(), language));
+            biz.addDescription(new Description(org.getDescription().getValue()));
+            if(org.getPrimaryContact() != null )
+                biz.setAuthorizedName(org.getPrimaryContact().getPersonName().getFullName());
+
+            Collection s = org.getServices();
+            System.out.println("?Org has services=" + s.isEmpty());
+            Iterator iter = s.iterator();
+            while (iter.hasNext())
+            {
+                BusinessService bs =
+                        ScoutJaxrUddiHelper.getBusinessServiceFromJAXRService((Service) iter.next());
+                bvect.add(bs);
+            }
+
+            /*
+             * map users : JAXR has concept of 'primary contact', which is a
+             * special designation for one of the users, and D6.1 seems to say
+             * that the first UDDI user is the primary contact
+             */
+
+            Contacts cts = new Contacts();
+            Vector cvect = new Vector();
+
+            User primaryContact = org.getPrimaryContact();
+            Collection users = org.getUsers();
+
+            // TODO - remove this
+            System.out.println("?Org has users=" + users.isEmpty());
+
+            /*
+             * first do primary, and then filter that out in the loop
+             */
+            if (primaryContact != null) {
+                Contact ct = getContactFromJAXRUser(primaryContact);
+                cvect.add(ct);
+            }
+
+            Iterator it = users.iterator();
+            while (it.hasNext())
+            {
+                User u = (User) it.next();
+
+                if (u != primaryContact) {
+                    Contact ct = getContactFromJAXRUser(u);
+                    cvect.add(ct);
+                }
+            }
+
+            bss.setBusinessServiceVector(bvect);
+            cts.setContactVector(cvect);
+            biz.setContacts(cts);
+
+            biz.setBusinessServices(bss);
+
+            //External Links
+            Iterator exiter = org.getExternalLinks().iterator();
+            while(exiter.hasNext())
+            {
+               ExternalLink link = (ExternalLink)exiter.next();
+               /**Note: jUDDI adds its own discoverURL as the businessEntity**/
+               biz.addDiscoveryURL(new DiscoveryURL("businessEntityExt",link.getExternalURI()));
+            }
+           //External Identifiers
+           Collection exid = org.getExternalIdentifiers();
+           Iterator exiditer = exid.iterator();
+           while(exiditer.hasNext())
+           {
+              ExternalIdentifier ei = (ExternalIdentifier)exiditer.next();
+
+              KeyedReference keyr = new KeyedReference();
+              Key ekey = ei.getKey();
+              if(ekey != null ) keyr.setTModelKey(ekey.getId());
+              keyr.setKeyValue(ei.getValue());
+              keyr.setKeyName(ei.getName().getValue());
+              biz.addIdentifier(keyr);
+           }
+        } catch (Exception ud)
+        {
+            throw new JAXRException("Apache JAXR Impl:", ud);
+        }
+        return biz;
+    }
+
+    /**
+     *  TODO - should we really return new Contact() rather than null on
+     *     null input?
+     *
+     * Convert JAXR User Object to UDDI  Contact
+     */
+    public static Contact getContactFromJAXRUser(User user)
+            throws JAXRException
+    {
+        Contact ct = new Contact();
+
+        if (user == null) {
+            return ct;
+        }
+
+        Vector addvect = new Vector();
+        Vector phonevect = new Vector();
+        Vector emailvect = new Vector();
+        try
+        {
+            ct.setPersonName(new PersonName(user.getPersonName().getFullName()));
+            ct.setUseType(user.getType());
+            //Postal Address
+            Collection postc = user.getPostalAddresses();
+            Iterator iterator = postc.iterator();
+            while (iterator.hasNext())
+            {
+                PostalAddress post = (PostalAddress) iterator.next();
+                addvect.add(ScoutJaxrUddiHelper.getAddress(post));
+            }
+            //Phone Numbers
+            Collection ph = user.getTelephoneNumbers(null);
+            Iterator it = ph.iterator();
+            while (it.hasNext())
+            {
+                TelephoneNumber t = (TelephoneNumber) it.next();
+                Phone phone = new Phone();
+                String str = t.getNumber();
+                System.out.println("Telephone=" + str);
+                phone.setValue(str);
+                // phone.setText( str );
+                phonevect.add(phone);
+            }
+
+            //Email Addresses
+            Collection ec = user.getEmailAddresses();
+            Iterator iter = ec.iterator();
+            while (iter.hasNext())
+            {
+                EmailAddress ea = (EmailAddress) iter.next();
+                Email email = new Email();
+                email.setValue(ea.getAddress());
+                //email.setText( ea.getAddress() );
+                email.setUseType(ea.getType());
+                emailvect.add(email);
+            }
+            ct.setAddressVector(addvect);
+            ct.setPhoneVector(phonevect);
+            ct.setEmailVector(emailvect);
+        } catch (Exception ud)
+        {
+            throw new JAXRException("Apache JAXR Impl:", ud);
+        }
+        return ct;
+    }
+
+   private static String getToken(String tokenstr)
+   {
+      //Token can have the value NULL which need to be converted into null
+      if(tokenstr.equals("NULL")) tokenstr="";
+      return tokenstr;
+   }
+
+   private static String getURLType( String accessuri)
+   {
+       String acc = accessuri.toLowerCase();
+       String uri = "other";
+       if( acc.startsWith("http:")) uri = "http";
+       else if(acc.startsWith("https:")) uri = "https";
+       else if(acc.startsWith("ftp:")) uri = "ftp";
+       else if(acc.startsWith("phone:")) uri = "phone";//TODO:Handle this better
+
+       return uri;
+   }
+
+}
\ No newline at end of file

Modified: webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutUddiJaxrHelper.java
URL: http://svn.apache.org/viewvc/webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutUddiJaxrHelper.java?view=diff&rev=492257&r1=383275&r2=492257
==============================================================================
--- webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutUddiJaxrHelper.java (original)
+++ webservices/scout/archives/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutUddiJaxrHelper.java Wed Jan  3 11:05:33 2007
@@ -17,30 +17,33 @@
 package org.apache.ws.scout.util;
 
 import org.apache.ws.scout.registry.infomodel.*;
-
-import uddiOrgApiV2.AccessPoint;
-import uddiOrgApiV2.BindingTemplate;
-import uddiOrgApiV2.BusinessDetail;
-import uddiOrgApiV2.BusinessEntity;
-import uddiOrgApiV2.BusinessService;
-import uddiOrgApiV2.BusinessServices;
-import uddiOrgApiV2.Contact;
-import uddiOrgApiV2.Contacts;
-import uddiOrgApiV2.Description;
-import uddiOrgApiV2.DiscoveryURL;
-import uddiOrgApiV2.DiscoveryURLs;
-import uddiOrgApiV2.IdentifierBag;
-import uddiOrgApiV2.KeyedReference;
-import uddiOrgApiV2.Name;
-import uddiOrgApiV2.ServiceInfo;
-import uddiOrgApiV2.TModel;
-import uddiOrgApiV2.TModelDetail;
-import uddiOrgApiV2.TModelInfo;
+import org.apache.ws.scout.uddi.v2.datatypes.AccessPoint;
+import org.apache.ws.scout.uddi.v2.datatypes.BindingTemplate;
+import org.apache.ws.scout.uddi.v2.datatypes.BusinessDetail;
+import org.apache.ws.scout.uddi.v2.datatypes.BusinessEntity;
+import org.apache.ws.scout.uddi.v2.datatypes.BusinessService;
+import org.apache.ws.scout.uddi.v2.datatypes.BusinessServices;
+import org.apache.ws.scout.uddi.v2.datatypes.Contact;
+import org.apache.ws.scout.uddi.v2.datatypes.Contacts;
+import org.apache.ws.scout.uddi.v2.datatypes.Description;
+import org.apache.ws.scout.uddi.v2.datatypes.DiscoveryURL;
+import org.apache.ws.scout.uddi.v2.datatypes.DiscoveryURLs;
+import org.apache.ws.scout.uddi.v2.datatypes.IdentifierBag;
+import org.apache.ws.scout.uddi.v2.datatypes.KeyedReference;
+import org.apache.ws.scout.uddi.v2.datatypes.Name;
+import org.apache.ws.scout.uddi.v2.datatypes.ServiceInfo;
+import org.apache.ws.scout.uddi.v2.datatypes.TModel;
+import org.apache.ws.scout.uddi.v2.datatypes.TModelDetail;
+import org.apache.ws.scout.uddi.v2.datatypes.TModelInfo;
+import org.apache.ws.scout.uddi.v2.datatypes.TModelInstanceDetails;
+import org.apache.ws.scout.uddi.v2.datatypes.TModelInstanceInfo;
+ 
 
 import javax.xml.registry.JAXRException;
 import javax.xml.registry.LifeCycleManager;
 import javax.xml.registry.infomodel.*;
 import java.util.Collection;
+import java.util.Vector;
 
 /**
  * Helper class that does UDDI->Jaxr Mapping
@@ -65,88 +68,80 @@
                                               LifeCycleManager lcm)
            throws JAXRException
    {
-      Name[] namearray = entity.getNameArray();
-      Name n = namearray != null && namearray.length > 0 ? namearray[0] : null;
-      String name = n != null ? n.getStringValue() : null;
-      Description[] descarray = entity.getDescriptionArray();
-      Description desc = descarray != null && descarray.length > 0 ? descarray[0]: null;
-
-      Organization org = new OrganizationImpl(lcm);
-      if(name != null ) org.setName(getIString(name, lcm));
-      if( desc != null) org.setDescription(getIString((String)desc.getStringValue(), lcm));
-      org.setKey(lcm.createKey(entity.getBusinessKey()));
-
-      //Set Services also
-      BusinessServices services = entity.getBusinessServices();
-      BusinessService[] sarr = services != null ? services.getBusinessServiceArray() : null;
-      for (int i = 0; sarr != null && i < sarr.length; i++)
-      {
-         BusinessService s = (BusinessService)sarr[i];
-         org.addService(getService(s, lcm));
-      }
-
-      /*
-       *  Users
-       *
-       *  we need to take the first contact and designate as the
-       *  'primary contact'.  Currently, the OrganizationImpl
-       *  class does that automatically as a safety in case
-       *  user forgets to set - lets be explicit here as to not
-       *  depend on that behavior
-       */
-
-      Contacts contacts = entity.getContacts();
-      Contact[] carr = contacts != null ? contacts.getContactArray() : null;
-
-      for (int i = 0; carr != null && i < carr.length; i++)
-      {
-         Contact contact = (Contact)carr[i];
-         User user = new UserImpl(null);
-         String pname = contact.getPersonName();
-         user.setPersonName(new PersonNameImpl(pname));
-
-         if (i == 0)
-         {
-            org.setPrimaryContact(user);
-         }
-         else
-         {
-            org.addUser(user);
-         }
-      }
-
-      //External Links
-      DiscoveryURLs durls = entity.getDiscoveryURLs();
-      if (durls != null)
-      {
-         DiscoveryURL[] darr = durls.getDiscoveryURLArray();
-         for (int j = 0; darr != null && j < darr.length; j++)
-         {
-            DiscoveryURL durl = (DiscoveryURL)darr[j];
-            ExternalLink link = new ExternalLinkImpl(lcm);
-            link.setExternalURI(durl.getStringValue());
-            org.addExternalLink(link);
-         }
-      }
-
-
-      //External Identifiers
-      IdentifierBag ibag = entity.getIdentifierBag();
-      if (ibag != null)
-      {
-         KeyedReference[] keyrarr = ibag.getKeyedReferenceArray();
-         for (int i = 0; keyrarr != null && i < keyrarr.length; i++)
-         {
-            KeyedReference keyr = (KeyedReference)keyrarr[i];
-            ExternalIdentifier eid = new ExternalIdentifierImpl(lcm);
-            String kkey = keyr.getTModelKey();
-            if (kkey != null) eid.setKey(new KeyImpl(kkey));
-            eid.setValue(keyr.getKeyValue());
-            eid.setName(new InternationalStringImpl(keyr.getKeyName()));
-            org.addExternalIdentifier(eid);
-         }
-      }
-      return org;
+	   Vector namevect = entity.getNameVector();
+	   Name n = namevect != null ? (Name) namevect.elementAt(0) : null;
+	   String name = n != null ? n.getValue() : null;
+	   Vector descvect = entity.getDescriptionVector();
+	   Description desc = descvect != null ? (Description) descvect.elementAt(0) : null;
+	   
+	   Organization org = new OrganizationImpl(lcm);
+	   if (name != null)
+		   org.setName(getIString(name, lcm));
+	   if (desc != null)
+		   org.setDescription(getIString((String) desc.getValue(), lcm));
+	   org.setKey(lcm.createKey(entity.getBusinessKey()));
+	   
+	   // Set Services also
+	   BusinessServices services = entity.getBusinessServices();
+	   Vector svect = services.getBusinessServiceVector();
+	   for (int i = 0; svect != null && i < svect.size(); i++) {
+		   BusinessService s = (BusinessService) svect.elementAt(i);
+		   org.addService(getService(s, lcm));
+	   }
+	   
+	   /*
+	    * Users
+	    * 
+	    * we need to take the first contact and designate as the 'primary
+	    * contact'. Currently, the OrganizationImpl class does that
+	    * automatically as a safety in case user forgets to set - lets be
+	    * explicit here as to not depend on that behavior
+	    */
+	   
+	   Contacts contacts = entity.getContacts();
+	   Vector cvect = contacts.getContactVector();
+	   
+	   for (int i = 0; cvect != null && i < cvect.size(); i++) {
+		   Contact contact = (Contact) cvect.elementAt(i);
+		   User user = new UserImpl(null);
+		   String pname = contact.getPersonName().getValue();
+		   user.setPersonName(new PersonNameImpl(pname));
+		   
+		   if (i == 0) {
+			   org.setPrimaryContact(user);
+		   } else {
+			   org.addUser(user);
+		   }
+	   }
+	   
+	   // External Links
+	   DiscoveryURLs durls = entity.getDiscoveryURLs();
+	   if (durls != null) {
+		   Vector dvect = durls.getDiscoveryURLVector();
+		   for (int j = 0; j < dvect.size(); j++) {
+			   DiscoveryURL durl = (DiscoveryURL) dvect.elementAt(j);
+			   ExternalLink link = new ExternalLinkImpl(lcm);
+			   link.setExternalURI(durl.getValue());
+			   org.addExternalLink(link);
+		   }
+	   }
+	   
+	   // External Identifiers
+	   IdentifierBag ibag = entity.getIdentifierBag();
+	   if (ibag != null) {
+		   Vector keyrvect = ibag.getKeyedReferenceVector();
+		   for (int i = 0; i < keyrvect.size(); i++) {
+			   KeyedReference keyr = (KeyedReference) keyrvect.elementAt(i);
+			   ExternalIdentifier eid = new ExternalIdentifierImpl(lcm);
+			   String kkey = keyr.getTModelKey();
+			   if (kkey != null)
+				   eid.setKey(new KeyImpl(kkey));
+			   eid.setValue(keyr.getKeyValue());
+			   eid.setName(new InternationalStringImpl(keyr.getKeyName()));
+			   org.addExternalIdentifier(eid);
+		   }
+	   }
+	   return org;
    }
 
 
@@ -154,89 +149,89 @@
                                               LifeCycleManager lcm)
            throws JAXRException
    {
-      BusinessEntity[] bz = bizdetail.getBusinessEntityArray();
-
-      BusinessEntity entity = bz[0];
-      Name[] namearr = entity.getNameArray();
-      Name n = namearr != null && namearr.length > 0 ? namearr[0] : null;
-      String name = n != null ? n.getStringValue(): null;
-      Description[] descarr = entity.getDescriptionArray();
-      Description desc = descarr != null && descarr.length > 0 ? descarr[0] : null;
-
-      Organization org = new OrganizationImpl(lcm);
-      if( name != null ) org.setName(getIString(name, lcm));
-      if( desc != null ) org.setDescription(getIString(desc.getStringValue(), lcm));
-      org.setKey(lcm.createKey(entity.getBusinessKey()));
-
-      //Set Services also
-      BusinessServices services = entity.getBusinessServices();
-      BusinessService[] sarr = services != null ? services.getBusinessServiceArray() : null;
-      for (int i = 0; sarr != null && i < sarr.length; i++)
-      {
-         BusinessService s = (BusinessService)sarr[i];
-         org.addService(getService(s, lcm));
-      }
-
-      /*
-       *  Users
-       *
-       *  we need to take the first contact and designate as the
-       *  'primary contact'.  Currently, the OrganizationImpl
-       *  class does that automatically as a safety in case
-       *  user forgets to set - lets be explicit here as to not
-       *  depend on that behavior
-       */
-      Contacts contacts = entity.getContacts();
-      Contact[] carr = contacts != null ? contacts.getContactArray():null;
-      for (int i = 0; carr != null && i < carr.length; i++)
-      {
-         Contact contact = carr[i];
-         User user = new UserImpl(null);
-         String pname = contact.getPersonName();
-         user.setType(contact.getUseType());
-         user.setPersonName(new PersonNameImpl(pname));
-
-         if (i == 0)
-         {
-            org.setPrimaryContact(user);
-         }
-         else
-         {
-            org.addUser(user);
-         }
-      }
-
-      //External Links
-      DiscoveryURLs durls = entity.getDiscoveryURLs();
-      if (durls != null)
-      {
-         DiscoveryURL[] darr = durls.getDiscoveryURLArray();
-         for (int j = 0; darr != null && j < darr.length; j++)
-         {
-            DiscoveryURL durl = darr[j];
-            ExternalLink link = new ExternalLinkImpl(lcm);
-            link.setExternalURI(durl.getStringValue());
-            org.addExternalLink(link);
-         }
-      }
-
-      //External Identifiers
-      IdentifierBag ibag = entity.getIdentifierBag();
-      if (ibag != null)
-      {
-         KeyedReference[] keyrarr = ibag.getKeyedReferenceArray();
-         for (int i = 0; keyrarr != null && i < keyrarr.length; i++)
-         {
-            KeyedReference keyr = (KeyedReference)keyrarr[i];
-            ExternalIdentifier eid = new ExternalIdentifierImpl(lcm);
-            String kkey = keyr.getTModelKey();
-            if (kkey != null) eid.setKey(new KeyImpl(kkey));
-            eid.setValue(keyr.getKeyValue());
-            eid.setName(new InternationalStringImpl(keyr.getKeyName()));
-            org.addExternalIdentifier(eid);
-         }
-      }
-      return org;
+	   Vector bz = bizdetail.getBusinessEntityVector();
+	   
+	   BusinessEntity entity = (BusinessEntity)bz.elementAt(0);
+	   Vector namevect = entity.getNameVector();
+	   Name n = namevect != null ? (Name)namevect.elementAt(0) : null;
+	   String name = n != null ? n.getValue(): null;
+	   Vector descvect = entity.getDescriptionVector();
+	   Description desc = descvect != null? (Description)descvect.elementAt(0) : null;
+	   
+	   Organization org = new OrganizationImpl(lcm);
+	   if( name != null ) org.setName(getIString(name, lcm));
+	   if( desc != null ) org.setDescription(getIString((String)desc.getValue(), lcm));
+	   org.setKey(lcm.createKey(entity.getBusinessKey()));
+	   
+	   //Set Services also
+	   BusinessServices services = entity.getBusinessServices();
+	   Vector svect = services.getBusinessServiceVector();
+	   for (int i = 0; svect != null && i < svect.size(); i++)
+	   {
+		   BusinessService s = (BusinessService)svect.elementAt(i);
+		   org.addService(getService(s, lcm));
+	   }
+	   
+	   /*
+	    *  Users
+	    *
+	    *  we need to take the first contact and designate as the
+	    *  'primary contact'.  Currently, the OrganizationImpl
+	    *  class does that automatically as a safety in case
+	    *  user forgets to set - lets be explicit here as to not
+	    *  depend on that behavior
+	    */
+	   Contacts contacts = entity.getContacts();
+	   Vector cvect = contacts != null ? contacts.getContactVector():null;
+	   for (int i = 0; cvect != null && i < cvect.size(); i++)
+	   {
+		   Contact contact = (Contact)cvect.elementAt(i);
+		   User user = new UserImpl(null);
+		   String pname = contact.getPersonName().getValue();
+		   user.setType(contact.getUseType());
+		   user.setPersonName(new PersonNameImpl(pname));
+		   
+		   if (i == 0)
+		   {
+			   org.setPrimaryContact(user);
+		   }
+		   else
+		   {
+			   org.addUser(user);
+		   }
+	   }
+	   
+	   //External Links
+	   DiscoveryURLs durls = entity.getDiscoveryURLs();
+	   if (durls != null)
+	   {
+		   Vector dvect = durls.getDiscoveryURLVector();
+		   for (int j = 0; j < dvect.size(); j++)
+		   {
+			   DiscoveryURL durl = (DiscoveryURL)dvect.elementAt(j);
+			   ExternalLink link = new ExternalLinkImpl(lcm);
+			   link.setExternalURI(durl.getValue());
+			   org.addExternalLink(link);
+		   }
+	   }
+	   
+	   //External Identifiers
+	   IdentifierBag ibag = entity.getIdentifierBag();
+	   if (ibag != null)
+	   {
+		   Vector keyrvect = ibag.getKeyedReferenceVector();
+		   for (int i = 0; i < keyrvect.size(); i++)
+		   {
+			   KeyedReference keyr = (KeyedReference)keyrvect.elementAt(i);
+			   ExternalIdentifier eid = new ExternalIdentifierImpl(lcm);
+			   String kkey = keyr.getTModelKey();
+			   if (kkey != null) eid.setKey(new KeyImpl(kkey));
+			   eid.setValue(keyr.getKeyValue());
+			   eid.setName(new InternationalStringImpl(keyr.getKeyName()));
+			   org.addExternalIdentifier(eid);
+		   }
+	   }
+	   return org;
    }
 
    public static InternationalString getIString(String str, LifeCycleManager blm)
@@ -248,130 +243,128 @@
    public static Service getService(BusinessService bs, LifeCycleManager lcm)
            throws JAXRException
    {
-      Service serve = new ServiceImpl(lcm);
-
-      String keystr = bs.getServiceKey();
-
-      if (keystr != null)
-      {
-         serve.setKey(lcm.createKey(keystr));
-      }
-
-      Name[] namearr = bs.getNameArray();
-
-      Name n = namearr != null && namearr.length > 0 ? namearr[0] : null;
-
-      if (n != null) {
-    	  String name = n.getStringValue();
-      serve.setName(lcm.createInternationalString(name));
-      }
-
-      Description[] descarr = bs.getDescriptionArray();
-      Description desc = descarr != null && descarr.length > 0 ? descarr[0] : null;
-      if(desc != null ) serve.setDescription(lcm.createInternationalString(desc.getStringValue()));
-      return serve;
+	   Service serve = new ServiceImpl(lcm);
+	   
+	   String keystr = bs.getServiceKey();
+	   
+	   if (keystr != null)
+	   {
+		   serve.setKey(lcm.createKey(keystr));
+	   }
+	   
+	   Vector namevect = bs.getNameVector();
+	   
+	   Name n = (Name)namevect.elementAt(0);
+	   String name = n.getValue();
+	   serve.setName(lcm.createInternationalString(name));
+	   Vector descvect = bs.getDescriptionVector();
+	   Description desc = descvect != null ? (Description)descvect.elementAt(0) : null;
+	   if(desc != null ) serve.setDescription(lcm.createInternationalString(desc.getValue()));
+	   return serve;
    }
 
    public static Service getService(ServiceInfo si, LifeCycleManager lcm)
            throws JAXRException
    {
-      Service service = new ServiceImpl(lcm);
-
-      String keystr = si.getServiceKey();
-
-      if (keystr != null)
-      {
-         service.setKey(lcm.createKey(keystr));
-      }
-
-      Name[] namearr = si.getNameArray();
-      Name n = namearr != null && namearr.length > 0 ? namearr[0] : null;
-
-      if (n != null) {
-    	  String name = n.getStringValue();
-      service.setName(lcm.createInternationalString(name));
-      }
-
-      return service;
+	   Service service = new ServiceImpl(lcm);
+	   
+	   String keystr = si.getServiceKey();
+	   
+	   if (keystr != null)
+	   {
+		   service.setKey(lcm.createKey(keystr));
+	   }
+	   
+	   Vector namevect = si.getNameVector();
+	   Name n = (Name)namevect.elementAt(0);
+	   String name = n.getValue();
+	   service.setName(lcm.createInternationalString(name));
+	   
+	   return service;
    }
 
    public static ServiceBinding getServiceBinding(BindingTemplate bs, LifeCycleManager lcm)
            throws JAXRException
    {
-      ServiceBinding serve = new ServiceBindingImpl(lcm);
-
-      String keystr = bs.getServiceKey();
-      if (keystr != null)
-      {
-         Service svc = new ServiceImpl(lcm);
-         svc.setKey(lcm.createKey(keystr));
-         ((ServiceBindingImpl)serve).setService(svc);
-      }
-      String bindingKey = bs.getBindingKey();
-      if(bindingKey != null) serve.setKey(new KeyImpl(bindingKey));
-      //TODO:Add more stuff
-      //Access URI
-      AccessPoint access = bs.getAccessPoint();
-      //FIXME: accesspoint should have a getURL? 
-      if (access != null) serve.setAccessURI(access.getStringValue());
-
-      //Description
-      Description[] da = bs.getDescriptionArray();
-      if (da != null && da.length > 0)
-      {
-         Description des = da[0];
-         serve.setDescription(new InternationalStringImpl(des.getStringValue()));
-      }
-
-      return serve;
+	   ServiceBinding serve = new ServiceBindingImpl(lcm);
+	   
+	   
+	   TModelInstanceDetails details = bs.getTModelInstanceDetails();
+	   Vector tiv = details.getTModelInstanceInfoVector();
+	   for (int i = 0; tiv != null && i < tiv.size(); i++)
+	   {
+		   TModelInstanceInfo info = (TModelInstanceInfo)tiv.elementAt(i);
+	   }
+	   String keystr = bs.getServiceKey();
+	   if (keystr != null)
+	   {
+		   Service svc = new ServiceImpl(lcm);
+		   svc.setKey(lcm.createKey(keystr));
+		   ((ServiceBindingImpl)serve).setService(svc);
+	   }
+	   String bindingKey = bs.getBindingKey();
+	   if(bindingKey != null) serve.setKey(new KeyImpl(bindingKey));
+	   //TODO:Add more stuff
+	   //Access URI
+	   AccessPoint access = bs.getAccessPoint();
+	   if (access != null) serve.setAccessURI(access.getURL());
+	   
+	   //Description
+	   Vector dv = bs.getDescriptionVector();
+	   if (dv != null)
+	   {
+		   Description des = (Description)dv.elementAt(0);
+		   serve.setDescription(new InternationalStringImpl(des.getValue()));
+	   }
+	   
+	   return serve;
    }
 
    public static Concept getConcept(TModelDetail tm, LifeCycleManager lcm)
            throws JAXRException
    {
-      Concept concept = new ConceptImpl(lcm);
-      TModel[] tc = tm.getTModelArray();
-      TModel tmodel = tc != null && tc.length > 0 ? tc[0] : null;
-      
-      if (tmodel != null) {
-      concept.setKey(lcm.createKey(tmodel.getTModelKey()));
-    	  concept.setName(lcm.createInternationalString(tmodel.getName().getStringValue()));
-
-      Description desc = getDescription(tmodel);
-    	  if( desc != null ) concept.setDescription(lcm.createInternationalString(desc.getStringValue()));
-      }
-
-      return concept;
+	   Concept concept = new ConceptImpl(lcm);
+	   Vector tc = tm.getTModelVector();
+	   TModel tmodel = (TModel)tc.elementAt(0);
+	   concept.setKey(lcm.createKey(tmodel.getTModelKey()));
+	   concept.setName(lcm.createInternationalString(tmodel.getName()));
+	   
+	   Vector descvect = tmodel.getDescriptionVector();
+	   Description desc = getDescription(tmodel);
+	   if( desc != null ) concept.setDescription(lcm.createInternationalString(desc.getValue()));
+	   
+	   return concept;
    }
 
    public static Concept getConcept(TModel tmodel, LifeCycleManager lcm)
            throws JAXRException
    {
-      Concept concept = new ConceptImpl(lcm);
-      concept.setKey(lcm.createKey(tmodel.getTModelKey()));
-      concept.setName(lcm.createInternationalString(tmodel.getName().getStringValue()));
-
-      Description desc = getDescription(tmodel);
-      concept.setDescription(lcm.createInternationalString(desc.getStringValue()));
-
-      return concept;
+	   Concept concept = new ConceptImpl(lcm);
+	   concept.setKey(lcm.createKey(tmodel.getTModelKey()));
+	   concept.setName(lcm.createInternationalString(tmodel.getName()));
+	   
+	   Vector descvect = tmodel.getDescriptionVector();
+	   Description desc = getDescription(tmodel);
+	   concept.setDescription(lcm.createInternationalString(desc.getValue()));
+	   
+	   return concept;
    }
 
    public static Concept getConcept(TModelInfo tm, LifeCycleManager lcm)
            throws JAXRException
    {
-      Concept concept = new ConceptImpl(lcm);
-      concept.setKey(lcm.createKey(tm.getTModelKey()));
-      concept.setName(lcm.createInternationalString(tm.getName().getStringValue()));
-
-      return concept;
+	   Concept concept = new ConceptImpl(lcm);
+	   concept.setKey(lcm.createKey(tm.getTModelKey()));
+	   concept.setName(lcm.createInternationalString(tm.getName().getValue()));
+	   
+	   return concept;
    }
 
    private static Description getDescription( TModel tmodel )
    {
-      Description[] descarr = tmodel.getDescriptionArray();
-      Description desc = descarr != null && descarr.length > 0 ? descarr[0] : null;
-      return desc;
+	   Vector descvect = tmodel.getDescriptionVector();
+	   Description desc = descvect != null ? (Description)descvect.elementAt(0) : null;
+	   return desc;
    }
 
 }

Modified: webservices/scout/archives/trunk/modules/scout/src/test/org/apache/ws/scout/JAXRQueryTest.java
URL: http://svn.apache.org/viewvc/webservices/scout/archives/trunk/modules/scout/src/test/org/apache/ws/scout/JAXRQueryTest.java?view=diff&rev=492257&r1=383275&r2=492257
==============================================================================
--- webservices/scout/archives/trunk/modules/scout/src/test/org/apache/ws/scout/JAXRQueryTest.java (original)
+++ webservices/scout/archives/trunk/modules/scout/src/test/org/apache/ws/scout/JAXRQueryTest.java Wed Jan  3 11:05:33 2007
@@ -54,7 +54,7 @@
         // To query, you need only the query URL
         Properties props = new Properties();
         props.setProperty("javax.xml.registry.queryManagerURL",
-                //        "http://uddi.microsoft.com:80/inquire");
+                        //"http://uddi.microsoft.com:80/inquire");
                 "http://localhost:8080/juddi/inquiry");
         props.setProperty("javax.xml.registry.factoryClass",
                 "org.apache.ws.scout.registry.ConnectionFactoryImpl");

Modified: webservices/scout/archives/trunk/project.xml
URL: http://svn.apache.org/viewvc/webservices/scout/archives/trunk/project.xml?view=diff&rev=492257&r1=383275&r2=492257
==============================================================================
--- webservices/scout/archives/trunk/project.xml (original)
+++ webservices/scout/archives/trunk/project.xml Wed Jan  3 11:05:33 2007
@@ -16,15 +16,146 @@
  * limitations under the License.
  */
  -->
+
+
 <project>
-    <pomVersion>3</pomVersion>
-    <extend>etc/project.xml</extend>
+  <!-- the version of maven's project object model -->
+
+  <pomVersion>3</pomVersion>
+  <extend>etc/project.xml</extend>
+
+  <!-- a unique name for this project -->
+  <id>scout</id>
+  <groupId>scout</groupId>
+  <!-- a short but descriptive name for the project -->
+
+  <name>Apache Scout</name>
+  <!-- The version of the project under development, e.g.
+       1.1, 1.2, 2.0-SNAPSHOT -->
+
+  <currentVersion>1.0</currentVersion>
+  <!-- details about the organization that 'owns' the project -->
+
+  <organization>
+    <name>Apache Web Services</name>
+    <url>http://ws.apache.org/</url>
+    <logo>http://ws.apache.org/images/project-logo.jpg</logo>
+  </organization>
+  <!-- the year the project started -->
+
+  <inceptionYear>2004</inceptionYear>
+  <package>org.apache.ws.scout</package>
+  <logo>/images/scout.jpg</logo>
+  <description>
+    Apache Scout is an implementation of the JSR 93 (JAXR)
+  </description>
+  <!-- a short description of what the project does -->
+
+  <shortDescription>Implementation of the JSR 93 - JAXR 1.0</shortDescription>
+  <!-- the project home page -->
 
-	<dependencies>
+  <url>http://ws.apache.org/scout/</url>
+  <issueTrackingUrl>http://issues.apache.org/jira/</issueTrackingUrl>
+  <siteAddress>ws.apache.org</siteAddress>
+  <siteDirectory>/scout/</siteDirectory>
+  <distributionDirectory>/www/ws.apache.org/builds/</distributionDirectory>
+  <!-- the version control repository and http url for online access
+       the connection element has the form:
+       scm:<system>:<system specific connection string> -->
+
+  <dependencies>
 		<dependency>
 			<groupId>xmlbeans</groupId>
 			<artifactId>xbean</artifactId>
 			<version>1.0.4</version>
 		</dependency>
 	</dependencies>
-</project>
+  <repository>
+    <connection>scm:subversion:http://svn.apache.org/repos/asf/webservices/scout/trunk</connection>
+    <url>http://svn.apache.org/viewcvs.cgi/webservices/scout/trunk/?root=Apache-SVN</url>
+  </repository>
+  <!-- any mailing lists for the project -->
+
+  <!-- any mailing lists for the project -->
+  <mailingLists>
+    <mailingList>
+      <name>Scout Developer List</name>
+      <subscribe>scout-dev-subscribe@ws.apache.org</subscribe>
+      <unsubscribe>scout-dev-unsubscribe@ws.apache.org</unsubscribe>
+      <archive>http://nagoya.apache.org/eyebrowse/SummarizeList?listId=221</archive>
+    </mailingList>
+  </mailingLists>
+  <!-- who the developers are for the project -->
+
+  <developers>
+        <developer>
+            <name>Steve Viens</name>
+            <id>sviens</id>
+            <email>sviens@apache.org</email>
+            <organization></organization>
+        </developer>
+        <developer>
+            <name>Anil Saldhana</name>
+            <id>anil</id>
+            <email>anil@apache.org</email>
+            <organization></organization>
+        </developer>
+        <developer>
+            <name>Davanum Srinivas</name>
+            <id>dims</id>
+            <email>dims@yahoo.com</email>
+            <organization></organization>
+        </developer>
+        <developer>
+            <name>Geir Magnusson Jr.</name>
+            <id>geirm</id>
+            <email>geirm@apache.org</email>
+            <organization/>
+        </developer>
+        <developer>
+            <name>Jeremy Boynes</name>
+            <id>jboynes</id>
+            <email>jboynes@apache.org</email>
+            <organization/>
+        </developer>
+
+
+  </developers>
+
+  <build>
+    <nagEmailAddress>scout-dev@ws.apache.org</nagEmailAddress>
+    <sourceDirectory>src/java</sourceDirectory>
+    <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
+    <unitTest>
+      <includes>
+        <include>**/*Test.java</include>
+      </includes>
+      <excludes>
+        <exclude>**/NaughtyTest.java</exclude>
+      </excludes>
+    </unitTest>
+    <resources>
+      <resource>
+        <directory>src/conf</directory>
+        <includes>
+          <include>*.properties</include>
+        </includes>
+      </resource>
+    </resources>
+  </build>
+
+    <!-- ======= -->
+    <!-- Reports -->
+    <!-- ======= -->
+
+    <reports>
+        <report>maven-license-plugin</report>
+        <report>maven-checkstyle-plugin</report>
+        <report>maven-pmd-plugin</report>
+        <report>maven-jdepend-plugin</report>
+        <report>maven-jxr-plugin</report>
+        <report>maven-javadoc-plugin</report>
+        <report>maven-junit-report-plugin</report>
+        <report>maven-clover-plugin</report>
+    </reports>
+</project>
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: scout-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: scout-dev-help@ws.apache.org


Mime
View raw message