From: Phlip <phl...@gm...> - 2010-07-27 17:57:57
|
ZSI: I'm doing that with a hack right now: def parse_soap_object(soap_action, soap_in): responseDec = eval('ns0.%s_Dec' % soap_action)() ps = ParsedSoap(soap_in) soap_object = ps.Parse(responseDec) return soap_object The back-story: I use wsdl2py to turn a soap spec into its matching Python objects. (Generally an excellent system - thanks!) Then I have to write a web service. When each message comes in, I have to guess what soap type it is, then call that splack of ugly code, like this: any_soap_object = parse_soap_object("ToothpasteSoap", XML) I want to take the "ToothpasteSoap" out. The XML itself contains the clues how to reconstruct its object, so presumably the wsdl2py also extruded some kind of multiplexer that does, the right way, what my crappy code does. So, how to turn arbitrary XML - that follows the WSDL - into its matching Soap object? -- Phlip http://c2.com/cgi/wiki?ZeekLand |