Пример #1
0
 private Element getExtensionDataElement() throws UpgradeException {
   MessageElement[] anys = getExtensionType().getExtensionData().get_any();
   MessageElement rawDataElement = null;
   for (int i = 0; (anys != null) && (i < anys.length); i++) {
     if (anys[i].getQName().equals(Data.getTypeDesc().getXmlType())) {
       rawDataElement = anys[i];
       break;
     }
   }
   if (rawDataElement == null) {
     throw new UpgradeException("No extension data was found for the data service extension");
   }
   Element extensionDataElement = AxisJdomUtils.fromMessageElement(rawDataElement);
   return extensionDataElement;
 }
Пример #2
0
 private void storeExtensionDataElement(Element elem) throws UpgradeException {
   MessageElement[] anys = getExtensionType().getExtensionData().get_any();
   for (int i = 0; (anys != null) && (i < anys.length); i++) {
     if (anys[i].getQName().equals(Data.getTypeDesc().getXmlType())) {
       // remove the old extension data
       anys = (MessageElement[]) Utils.removeFromArray(anys, anys[i]);
       break;
     }
   }
   // create a message element from the JDom element
   MessageElement data = null;
   try {
     data = AxisJdomUtils.fromElement(elem);
   } catch (JDOMException ex) {
     throw new UpgradeException(
         "Error converting extension data to Axis message element: " + ex.getMessage(), ex);
   }
   anys = (MessageElement[]) Utils.appendToArray(anys, data);
   getExtensionType().getExtensionData().set_any(anys);
 }