ó Ç<ªKc@sfdZddlmZddlTddlmZddlmZeeƒZ defd„ƒYZ dS( s9 Provides classes for the (WS) SOAP I{document/literal}. iÿÿÿÿ(t getLogger(t*(tBinding(tElementtDocumentcBsMeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS(sc The document/literal style. Literal is the only (@use) supported since document/encoded is pretty much dead. Although the soap specification supports multiple documents within the soap , it is very uncommon. As such, suds presents an I{RPC} view of service methods defined with a single document parameter. This is done so that the user can pass individual parameters instead of one, single document. To support the complete specification, service methods defined with multiple documents (multiple message parts), must present a I{document} view for that method. c Cs't|jjjjƒsdS|jjjj}|rY|j|ƒ}|j|dƒ}ng}d}x»|j|ƒD]ª}|t|ƒkrš||} n|j |dƒ} |d7}|j ||| ƒ} | dkrÞqun|s|dj dƒ} | j | d| dƒn|j| ƒquW|S(Niitns0((tlentsoaptinputtbodytpartstwrappedtbodypart_typestdocumentt param_defstgettmkparamtNonet namespacet setPrefixtappend( tselftmethodtargstkwargsR tptstroottntpdtvaluetptns((s:/usr/lib/python2.7/site-packages/suds/bindings/document.pyt bodycontent)s*   cCs.|jjjj}|r#|djS|jSdS(Ni(RtoutputR R tchildren(RRR R ((s:/usr/lib/python2.7/site-packages/suds/bindings/document.pyt replycontentHs cCs6|dj}|djdƒ}t|d|ƒ}|S(s% Get the document root. For I{document/literal}, this is the name of the wrapper element qualifed by the schema tns. @param wrapper: The method name. @type wrapper: L{xsd.sxbase.SchemaObject} @return: A root element. @rtype: L{Element} iRR(tnameRR(RtwrapperttagRtd((s:/usr/lib/python2.7/site-packages/suds/bindings/document.pyR Os cCsft|ttfƒrLg}x*|D]"}|j|j|||ƒƒq"W|Stj||||ƒSdS(N(t isinstancetlistttupleRRR(RRtpdeftobjectttagstitem((s:/usr/lib/python2.7/site-packages/suds/bindings/document.pyR]s   c CsÀ|j|ƒ}|jjjj}|s+|Sg}xˆ|D]€}|djƒ}xg|D]_\}}|jƒrsqUn|j|ƒržtj d||j ƒqUn|j |j |fƒqUWq8W|S(Nis5%s contained by , excluded as param for %s()( R RRR R tresolvetisattrtbychoicetlogtdebugR$R( RRRR tresultRtresolvedtchildtancestry((s:/usr/lib/python2.7/site-packages/suds/bindings/document.pyRks$   c CsŒg}|jjjj}|j|dtƒ}|r~xR|D]=}|jdtƒ}x!|D]\}}|j|ƒqYWPq:Wn ||7}|S(NRt nobuiltin( RR!R R R tFalseR/tTrueR( RRR4R trtstptR5R6R7((s:/usr/lib/python2.7/site-packages/suds/bindings/document.pytreturned_types‡s  cCs%x|D]}|jƒrtSqWtS(s The ancestry contains a @param ancestry: A list of ancestors. @type ancestry: list @return: True if contains @rtype: boolean (tchoiceR:R9(RR7tx((s:/usr/lib/python2.7/site-packages/suds/bindings/document.pyR1•s  ( t__name__t __module__t__doc__R R#R RRR=R1(((s:/usr/lib/python2.7/site-packages/suds/bindings/document.pyRs       N( RBtloggingRtsudstsuds.bindings.bindingRtsuds.sax.elementRR@R2R(((s:/usr/lib/python2.7/site-packages/suds/bindings/document.pyts