VMware {code} Community
shishaozheng
Enthusiast
Enthusiast

The variable String of the fault message in customized task can not be substituted in web client 5.1

I registered a customized Task to my web client Extension with the task id: com.test.my_task.

After that, I also registered the Extension Fault for this Task, the content of the fault.vmsg is as below:

com.test.my_fault.summary = " This is a test fault message for task, detail: {data.message}".

To use this customized task and fault, I called the API setTaskState():

VimPortType.setTaskState(task, TaskInfoState.ERROR, null, localizedMethodFault);

the param "task" is ManagedObjectRefrence of the Task, and the content of the param "localizedMethodFault" is as below:

LocalizedMethodFault localizedMethodFault = new LocalizedMethodFault();

ExtendedFault extendedFault = new ExtendedFault();

KeyValue keyValue = new KeyValue();

keyValue.setKey("message");

keyValue.setValue("the detail message for test");

extendedFault.getData().add(keyValue);

extendedFault.setFaultTypeId("com.test.my_fault");

localizedMethodFault.setFault(extendedFault);

Then I do a test in web client 5.1, 5.5 and 6.0, the results is:

In the web client 5.5 and 6.0, my customized Task and Fault message show up in the Task Console,and the String {data.message} is replaced by "the detail message for test".

But in the web client 5.1, the String {data.message} of the customized Fault message is not be replaced.

The API is vSphere Management SDK 5.1.

Could anyone help me solve this confused problem?

Thank you very much

Reply
0 Kudos
2 Replies
shishaozheng
Enthusiast
Enthusiast

I have found a similar question, but also no answer
ExtendedFault message, variable substitution

Reply
0 Kudos
hdesai
Contributor
Contributor

Hi

Can you share the sample code for registering the Extension Fault for this Task?

Thanks for the help!

Reply
0 Kudos