I'm registering an extension using the VMware vSphere Web Services SDK. The custom tasks and faults I've defined are displayed correctly on the VMware vSphere Client, as well as the vSphere Web Client. The events I defined used to be displayed correctly in both, but when I converted my code from the 5.0 release to 5.1, they are no longer being shown correctly.
Instead of seeing something like, "Type: info" and "Description: This is the full format message", the event now looks something like, "Type: XXX Company.Product.CustomEvent.category not found XXX" and "Description: event.Company.Product.CustomEvent.fullFormat (Company.Product.CustomEvent)".
The code to register the extension is similar to the following, with some parts omitted, since the tasks and faults are working OK:
public static final String EXTENSION_KEY = "Company.Product";
public static final String CUSTOM_EVENT = EXTENSION_KEY + ".CustomEvent";
Extension extension = new Extension();
ExtensionEventTypeInfo customEventInfo = new ExtensionEventTypeInfo();
ExtensionResourceInfo customEventResourceInfo = new ExtensionResourceInfo();
KeyValue customEventCategory = new KeyValue();
customEventCategory.setKey(CUSTOM_EVENT + ".category");
KeyValue customEventLabel = new KeyValue();
customEventLabel.setKey(CUSTOM_EVENT + ".label");
customEventLabel.setValue("This is the label");
KeyValue customEventSummary = new KeyValue();
customEventSummary.setKey(CUSTOM_EVENT + ".summary");
customEventSummary.setValue("This is the summary");
KeyValue customEventFormat = new KeyValue();
customEventFormat.setKey(CUSTOM_EVENT + ".fullFormat");
customEventFormat.setValue("This is the full format message");
The main difference between this and my previous version of the extension is the change to Lists that I need to retrieve before adding objects, instead of adding array of objects.
The code I use to create the events looks similar to:
ExtendedEvent event = new ExtendedEvent();
event.setMessage("This is a non-localized message");
vimPort.postEvent(eventManagerMOR, event, taskInfo);
This part of the code has also changed a little from the 5.0 version of the SDK to the 5.1 version, such as the use of XMLGregorianCalendar for the created time.
I've tried prefixing the keys for the resource information with "event." but this didn't fix the problem. I didn't have to change much to get the custom tasks and faults to work with 5.1, but that doesn't seem to be the case with events. Does anyone know what other changes need to be made for events to be displayed correctly?