-
Notifications
You must be signed in to change notification settings - Fork 767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Malformed Faults fail in non-informative ways #72
Comments
At present, I have not been able to determine if the library can successfully deserialize and then marshal a fault object. The XML parsers seem capable of handling the payload from initial testing. |
After two days in the debugger I've figured out that the SoapAdapter.py matches the detail tag's first child tag name against the WSDL and then maps that to a data type. In this case the data type vmodl.fault.LicenseUsageFaultFault would make sense (FaultFault? really guys?) but the type is not present in the WSDL. That causes a key error when attempting to perform dynamic type look up. Trace is below...
To be able to support arbitrary Fault tags we need to put in a trap for Faults that will allow the type resolution logic to escape to a known-good data type if you can't match the data type based on the detail tag's first child. |
example: LicenseUsageFault <soapenv:Body> <soapenv:Fault> <faultcode>ServerFaultCode</faultcode> <faultstring/> <detail> <LicenseUsageFaultFault xsi:type="LicenseUsageFault"> <reason>dataTampered</reason></LicenseUsageFaultFault> </detail> </soapenv:Fault> The detail tag's first child represents the data type to unmarshal the Fault message envelope's contents into. If that child tag does not have a matching WSDL definition pyVmomi fails to raise the fault. This change lets the library dynamically create the new fault data type at runtime. closes vmware#72
This initial patch introduces a test to demonstrate current fault handling in the VmomiSupport and SoapAdapter components. partial: vmware#72
* Malformed Faults: introduces test for fault handler * introduces ParserError which includes the malformed XML * testing demonstrates ParserError includes malformed XML closes: vmware#72
The proposed resolution to this problem is to include the malformed XML document inside the Exception. This has the benefit of allowing a developer to see exactly what killed their client and to include this information in incident reports. We can then build fixtures to simulate the failure and resolve this class of problem much more quickly. This does impact performance and stack trace message size. |
* Malformed Faults: introduces test for fault handler * introduces ParserError which includes the malformed XML * testing demonstrates ParserError includes malformed XML closes: vmware#72
Malformed Faults fail in non-informative ways. Example: LicenseUsageFaults will emit the following SOAP envelope. This envelope will not properly map onto the ServerFaultCode data type inside pyVmomi. The result is that the message will not map onto the appropriate fault type.
The text was updated successfully, but these errors were encountered: