FileDocCategorySizeDatePackage
getBusinessDetail.javaAPI DocExample4736Tue Oct 09 11:03:40 BST 2001com.ecerami.uddi

getBusinessDetail

public class getBusinessDetail extends Object
Sample UDDI Program: retrieves the businessEntity specified by the first command line argument. Example usage: java getBusinessDetail ba744ed0-3aaf-11d5-80dc-002035229c64

Fields Summary
Constructors Summary
Methods Summary
public com.ibm.uddi.response.BusinessDetailgetBusinessDetail(java.lang.String businessKey)
Retreive Business Detail Record

param
businessKey UDDI Business Key
return
UDDI Business Detail record

    //  Create UDDI Proxy Object
    UDDIProxy proxy = new UDDIProxy();
    //  Point to Microsoft Inquiry URL
    proxy.setInquiryURL("http://uddi.microsoft.com/inquire");

    //  Retrieve BusinessDetail record
    BusinessDetail businessDetail = proxy.get_businessDetail(businessKey);
    return businessDetail;
  
public static voidmain(java.lang.String[] args)
Main Method

    try {
      getBusinessDetail inquiry = new getBusinessDetail();
      BusinessDetail businessDetail = inquiry.getBusinessDetail (args[0]);
      inquiry.print_businessDetail (businessDetail);
    } catch (MalformedURLException e) {
      e.printStackTrace();
    } catch (SOAPException e) {
      e.printStackTrace();
    } catch (UDDIException e) {
      //  Extract UDDI Disposition Report
      DispositionReport dr = e.getDispositionReport();
      if (dr!=null) {
        System.out.println("UDDIException faultCode:" +
          e.getFaultCode() +
          "\n errno:"    + dr.getErrno() +
          "\n errCode:"  + dr.getErrCode() +
          "\n errInfoText:" + dr.getErrInfoText());
      }
      e.printStackTrace();
    }
  
private voidprint_addressVector(java.util.Vector addressVector)
Print Address Data

param
addressVector Vector of UDDI Address Records

    for (int i=0; i< addressVector.size(); i++) {
      Address address = (Address) addressVector.elementAt(i);
      Vector addressLines = address.getAddressLineVector();
      for (int j=0; j<addressLines.size(); j++) {
        AddressLine addressLine = (AddressLine) addressLines.elementAt(j);
        String addressText = addressLine.getText();
        System.out.println("Address:  "+addressText);
      }
    }
  
private voidprint_businessDetail(com.ibm.uddi.response.BusinessDetail businessDetail)
Print Business Entity Data

param
businessDetail UDDI Business Detail Record

    Vector businessEntityVector = businessDetail.getBusinessEntityVector();
    for (int i = 0; i < businessEntityVector.size(); i++) {
        BusinessEntity businessEntity =
          (BusinessEntity) businessEntityVector.elementAt(i);
        String name = businessEntity.getNameString();
        String description = businessEntity.getDefaultDescriptionString();
        System.out.println ("Business Name:  "+name);
        System.out.println ("Description:  "+description);
        Contacts contacts = businessEntity.getContacts();
        print_contacts (contacts);
      }
  
private voidprint_contacts(Contacts contacts)
Print Contact Data

param
contacts UDDI Contacts Information

    Vector contactVector = contacts.getContactVector();
    for (int j=0; j< contactVector.size(); j++) {
      Contact contact = (Contact) contactVector.elementAt (j);
      String description = contact.getDefaultDescriptionString();
      Vector addressVector = contact.getAddressVector();
      Vector emailVector = contact.getEmailVector();
      System.out.println ("Contact:  "+ description);
      print_addressVector (addressVector);
      print_emailVector (emailVector);
    }
  
private voidprint_emailVector(java.util.Vector emailVector)
Print Email Data

param
emailVector Vector of UDDI Email Objects

    for (int i=0; i< emailVector.size(); i++) {
      Email email = (Email) emailVector.elementAt(i);
      String emailText = email.getText();
      System.out.println ("Email:  "+emailText);
    }