ó
•	_Kc           @   s¨   d  Z  d d l m Z d d l Td d l m Z d d l m Z d d l	 m
 Z
 m Z d d l m Z e e ƒ Z d Z d	 e
 f d
 „  ƒ  YZ d e f d „  ƒ  YZ d S(   sP   
Provides classes for the (WS) SOAP I{rpc/literal} and I{rpc/encoded} bindings.
iÿÿÿÿ(   t	   getLogger(   t   *(   t   Encoded(   t   Bindingt   envns(   t   Elements   SOAP-ENCs)   http://schemas.xmlsoap.org/soap/encoding/t   RPCc           B   s;   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s$   
    RPC/Literal binding style.
    c         C   s   |  j  | ƒ S(   N(   t   bodypart_types(   t   selft   method(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/bindings/rpc.pyt
   param_defs&   s    c         C   sI   t  j |  | | ƒ } | j t d t d ƒ | j d t d d ƒ | S(   Ni    i   s   %s:encodingStyles)   http://schemas.xmlsoap.org/soap/encoding/(   R   t   envelopet	   addPrefixt   encnst   setR   (   R   t   headert   bodyt   env(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/bindings/rpc.pyR   )   s
    c   	      C   s    d } |  j  | ƒ } x„ |  j | ƒ D]s } | t | ƒ k  rJ | | } n | j | d ƒ } |  j | | | ƒ } | d  k	 rŽ | j | ƒ n  | d 7} q% W| S(   Ni    i   (   R	   R
   t   lent   gett   mkparamt   Nonet   append(	   R   R	   t   argst   kwargst   nt   roott   pdt   valuet   p(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/bindings/rpc.pyt   bodycontent0   s    c         C   s   | d j  S(   Ni    (   t   children(   R   R	   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/bindings/rpc.pyt   replycontent>   s    c         C   sN   | j  j j j } | d d k r5 d | d f } n  t | j d | ƒ} | S(   s  
        Get the document root.  For I{rpc/(literal|encoded)}, this is the
        name of the method qualifed by the schema tns.
        @param method: A service method.
        @type method: I{service.Method}
        @return: A root element.
        @rtype: L{Element}
        i    t   ns0i   t   nsN(   t   soapt   inputR   t	   namespaceR   R   t   name(   R   R	   R"   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/bindings/rpc.pyR	   A   s
    	(   t   __name__t
   __module__t   __doc__R
   R   R   R    R	   (    (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/bindings/rpc.pyR   !   s   				R   c           B   s#   e  Z d  Z d „  Z e d „ Z RS(   s1   
    RPC/Encoded (section 5)  binding style.
    c         C   s   t  |  j ƒ  ƒ S(   N(   t	   MxEncodedt   schema(   R   (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/bindings/rpc.pyt
   marshallerV   s    c         C   s*   | r t  |  j ƒ  ƒ St j |  | ƒ Sd S(   s†   
        Get the appropriate XML decoder.
        @return: Either the (basic|typed) unmarshaller.
        @rtype: L{UmxTyped}
        N(   t
   UmxEncodedR+   R   t   unmarshaller(   R   t   typed(    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/bindings/rpc.pyR.   Y   s    (   R'   R(   R)   R,   t   TrueR.   (    (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/bindings/rpc.pyR   Q   s   	N(   s   SOAP-ENCs)   http://schemas.xmlsoap.org/soap/encoding/(   R)   t   loggingR    t   sudst   suds.mx.encodedR   R*   t   suds.umx.encodedR-   t   suds.bindings.bindingR   R   t   suds.sax.elementR   R'   t   logR   R   (    (    (    sK   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/bindings/rpc.pyt   <module>   s   
0