/**
* Get UDDI Address given JAXR Postal Address
*/
public static Address getAddress(PostalAddress postalAddress) throws JAXRException {
Address address = objectFactory.createAddress();
AddressLine[] addarr = new AddressLine[6];
String stnum = postalAddress.getStreetNumber();
String st = postalAddress.getStreet();
String city = postalAddress.getCity();
String country = postalAddress.getCountry();
String code = postalAddress.getPostalCode();
String state = postalAddress.getStateOrProvince();
AddressLine stnumAL = objectFactory.createAddressLine();
stnumAL.setKeyName("STREET_NUMBER");
if (stnum != null) {
stnumAL.setKeyValue(stnum);
}
AddressLine stAL = objectFactory.createAddressLine();
stAL.setKeyName("STREET");
if (st != null) {
stAL.setKeyValue(st);
}
AddressLine cityAL = objectFactory.createAddressLine();
cityAL.setKeyName("CITY");
if (city != null) {
cityAL.setKeyValue(city);
}
AddressLine countryAL = objectFactory.createAddressLine();
countryAL.setKeyName("COUNTRY");
if (country != null) {
countryAL.setKeyValue(country);
}
AddressLine codeAL = objectFactory.createAddressLine();
codeAL.setKeyName("POSTALCODE");
if (code != null) {
codeAL.setKeyValue(code);
}
AddressLine stateAL = objectFactory.createAddressLine();
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.getAddressLine().addAll(Arrays.asList(addarr));
return address;
}