VMware {code} Community
MissionaryLiao
Contributor
Contributor

How to get server-faults from SoapException in .net(C#)

Hi all,

I just wrote an vsphere-client via visdk2.5 to remove snapshots of a VM via call to RemoveSnapshot_Task.

I want to handle one possible server-fault: TaskInProgress and try to wait TaskInProgress.task until it finishes.

However, in C#, I can only catch SoapException but not TaskInProgress.

And I have no idea about how to convert TaskInProgress from SoapException.

From this document: http://www.vmware.com/support/developer/windowstoolkit/wintk40/doc/viwin_devg.pdf

(vSphere SDK for .NET Developer's Guide)

/////////////////////////////////

The vSphere SDK for .NET runtime performs additional error handling by translating the \

vSphere API SoapFault object from SoapException.Detail property into a MethodFault \

descendant object and throwing a VimException exception.

/////////////////////////////////

But I've checked, there is no VimException existed in my VimApi namespace.

I've checked VimObjects.cs, vim\vim.wsdl, vim25\vim.wsdl in vSphere SDK 4.0, none of them contains keyword: VimException.

Is there any clearer information about how to handle such server-fault via SoapException?

0 Kudos
0 Replies