
=Pc           @   s  d  Z  d d l Z d d l j Z d d l m Z d d l Td d l m Z m Z d d l	 m
 Z
 d d l m Z d d l m Z d d	 l m Z d d
 l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m  Z  d d l! m! Z! d d l" m# Z# d d l$ m% Z% e% e&  Z' d e( f d     YZ) d d& d     YZ d d' d     YZ* d d( d     YZ+ d d) d     YZ, d  d* d!     YZ- d" d+ d#     YZ. d$ e. f d%     YZ/ d S(,   sX   
The I{2nd generation} service proxy provides access to web services.
See I{README.txt}
iN(   t	   CookieJar(   t   *(   t   TransportErrort   Request(   t   HttpAuthenticated(   t	   FileCache(   t   ServiceDefinition(   t
   sudsobject(   t   Factory(   t   Object(   t   PathResolver(   t   Builder(   t   Definitions(   t   Document(   t   Parser(   t   Options(   t   Unskin(   t   urlparse(   t   deepcopy(   t	   getLoggert   Clientc           B   s   e  Z d  Z e d    Z e d    Z e d    Z d   Z d   Z d   Z	 d   Z
 d   Z d	   Z d
   Z d   Z RS(   s   
    A lightweight web services client.
    I{(2nd generation)} API.
    @ivar wsdl: The WSDL object.
    @type wsdl:L{Definitions}
    @ivar service: The service proxy used to invoke operations.
    @type service: L{Service}
    @ivar factory: The factory used to create objects.
    @type factory: L{Factory}
    @ivar sd: The service definition
    @type sd: L{ServiceDefinition}
    @ivar messages: The last sent/received messages.
    @type messages: str[2]
    c         C   s   t  j |  S(   s  
        Extract the I{items} from a suds object much like the
        items() method works on I{dict}.
        @param sobject: A suds object
        @type sobject: L{Object}
        @return: A list of items contained in I{sobject}.
        @rtype: [(key, value),...]
        (   R   t   items(   t   clst   sobject(    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR   >   s    
c         C   s   t  j |  S(   s   
        Convert a sudsobject into a dictionary.
        @param sobject: A suds object
        @type sobject: L{Object}
        @return: A python dictionary containing the
            items contained in I{sobject}.
        @rtype: dict
        (   R   t   asdict(   R   R   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyt   dictJ   s    
c         C   s   | j  S(   s   
        Extract the metadata from a suds object.
        @param sobject: A suds object
        @type sobject: L{Object}
        @return: The object's metadata
        @rtype: L{sudsobject.Metadata}
        (   t   __metadata__(   R   R   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyt   metadataV   s    	c         K   s   t    } t   | _ | |  _ t d d  | _ |  j |   t | |  |  _ t	 |  j  |  _
 t |  |  j j  |  _ g  |  _ x6 |  j j D]( } t |  j |  } |  j j |  q Wt d d d d  |  _ d S(   s   
        @param url: The URL for the WSDL.
        @type url: str
        @param kwargs: keyword arguments.
        @see: L{Options}
        t   daysi   t   txt   rxN(   R   R   t	   transportt   optionsR   t   cachet   set_optionsR   t   wsdlR   t   factoryt   ServiceSelectort   servicest   servicet   sdR   t   appendR   t   Nonet   messages(   t   selft   urlt   kwargsR    t   sR(   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyt   __init__a   s    			c         K   s    t  |  j  } | j |  d S(   sa   
        Set options.
        @param kwargs: keyword arguments.
        @see: L{Options}
        N(   R   R    t   update(   R,   R.   t   p(    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR"   v   s    c         C   sk   |  j  j } | j | d  } | d k r> | j | |  d S| d | k rg t d | | f   n  d S(   s  
        Add I{static} mapping of an XML namespace prefix to a namespace.
        This is useful for cases when a wsdl and referenced schemas make heavy
        use of namespaces and those namespaces are subject to changed.
        @param prefix: An XML namespace prefix.
        @type prefix: str
        @param uri: An XML namespace URI.
        @type uri: str
        @raise Exception: when prefix is already mapped.
        Ni   s   "%s" already mapped as "%s"(   R#   t   roott   resolvePrefixR*   t	   addPrefixt	   Exception(   R,   t   prefixt   uriR3   t   mapped(    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyt
   add_prefix   s    c         C   s   |  j  j d  S(   s|   
        Get last sent I{soap} message.
        @return: The last sent I{soap} message.
        @rtype: L{Document}
        R   (   R+   t   get(   R,   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyt	   last_sent   s    c         C   s   |  j  j d  S(   s   
        Get last received I{soap} message.
        @return: The last received I{soap} message.
        @rtype: L{Document}
        R   (   R+   R;   (   R,   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyt   last_received   s    c         C   s   d t  f d     Y} |   } t   | _ t | j  } t |  j  } | j t |   |  j | _ |  j | _ t | |  j j	  | _
 |  j | _ | S(   s   
        Get a shallow clone of this object.
        @note: THIS METHOD NOT YET WORKING CORRECTLY OR SUPPORTED !!
        @return: A shallow clone.
        @rtype: L{Client}
        t   Uninitializedc           B   s   e  Z d    Z RS(   c         S   s   d  S(   N(    (   R,   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR0      s    (   t   __name__t
   __module__R0   (    (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR>      s   (   R   R   R    R   R1   R   R#   R$   R%   R&   R'   R(   (   R,   R>   t   clonet   cpt   mp(    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyRA      s    	c         C   s
   t  |   S(   N(   t   unicode(   R,   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyt   __str__   s    c         C   s   d g } t  j j   } | j d  | j d t  j  | j d | d | d f  x( |  j D] } | j d t |   qb Wd j |  S(	   Ns   
s'   Suds ( https://fedorahosted.org/suds/ )s     version: %ss    %s  build: %si    i   s   

%st    (   t   sudst	   __build__t   splitR)   t   __version__R(   RD   t   join(   R,   R/   t   buildR(   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyt   __unicode__   s    	(   R?   R@   t   __doc__t   classmethodR   R   R   R0   R"   R:   R<   R=   RA   RE   RM   (    (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR   /   s   								R   c           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s   
    A factory for instantiating types defined in the wsdl
    @ivar resolver: A schema type resolver.
    @type resolver: L{PathResolver}
    @ivar builder: A schema object builder.
    @type builder: L{Builder}
    c         C   s.   | |  _  t |  |  _ t |  j  |  _ d S(   sW   
        @param wsdl: A schema object.
        @type wsdl: L{wsdl.Definitions}
        N(   R#   R
   t   resolverR   t   builder(   R,   R#   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR0      s    	c         C   s	  t  j   } | j   |  j j |  } | d k rC t |   n  | j   r t j	 |  } x | j
   D]" \ } } t | | j | j  qk WnQ y |  j j |  } Wn8 t k
 r } t j d | d t t | |   n X| j   t  j j d | |  | S(   s   
        create a WSDL type by name
        @param name: The name of a type defined in the WSDL.
        @type name: str
        @return: The requested object.
        @rtype: L{Object}
        s   create '%s' failedt   exc_infos   %s created: %sN(   t   metricst   Timert   startRP   t   findR*   t   TypeNotFoundt   enumt   InstFactoryt   objectt   childrent   setattrt   nameRQ   RL   R6   t   logt   errort   Truet
   BuildErrort   stopt   debug(   R,   R]   t   timert   typet   resultt   et   a(    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyt   create   s"    

c         C   s   t  |  j |  |  _ d S(   sk   
        Set the path separator.
        @param ps: The new path separator.
        @type ps: char
        N(   R
   R#   RP   (   R,   t   ps(    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyt	   separator   s    (   R?   R@   RN   R0   Ri   Rk   (    (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR      s   			R%   c           B   s;   e  Z d  Z d   Z d   Z d   Z d   Z d   Z RS(   s  
    The B{service} selector is used to select a web service.
    In most cases, the wsdl only defines (1) service in which access
    by subscript is passed through to a L{PortSelector}.  This is also the
    behavior when a I{default} service has been specified.  In cases
    where multiple services have been defined and no default has been
    specified, the service is found by name (or index) and a L{PortSelector}
    for the service is returned.  In all cases, attribute access is
    forwarded to the L{PortSelector} for either the I{first} service or the
    I{default} service (when specified).
    @ivar __client: A suds client.
    @type __client: L{Client}
    @ivar __services: A list of I{wsdl} services.
    @type __services: list
    c         C   s   | |  _  | |  _ d S(   s   
        @param client: A suds client.
        @type client: L{Client}
        @param services: A list of I{wsdl} services.
        @type services: list
        N(   t   _ServiceSelector__clientt   _ServiceSelector__services(   R,   t   clientR&   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR0     s    	c         C   s=   |  j    } | d k r* |  j d  } n | } t | |  S(   s9  
        Request to access an attribute is forwarded to the
        L{PortSelector} for either the I{first} service or the
        I{default} service (when specified).
        @param name: The name of a method.
        @type name: str
        @return: A L{PortSelector}.
        @rtype: L{PortSelector}. 
        i    N(   t   _ServiceSelector__dsR*   t   _ServiceSelector__findt   getattr(   R,   R]   t   defaultt   port(    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyt   __getattr__  s
    
c         C   s_   t  |  j  d k r, |  j d  } | | S|  j   } | d k	 rR | } | | S|  j |  S(   s  
        Provides selection of the I{service} by name (string) or 
        index (integer).  In cases where only (1) service is defined
        or a I{default} has been specified, the request is forwarded
        to the L{PortSelector}.
        @param name: The name (or index) of a service.
        @type name: (int|str)
        @return: A L{PortSelector} for the specified service.
        @rtype: L{PortSelector}. 
        i   i    N(   t   lenRm   Rp   Ro   R*   (   R,   R]   Rs   Rr   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyt   __getitem__&  s    c         C   s   d } t |  j  s! t d  n  t | t  rn y |  j | } | j } Wq t k
 rj t d |  q Xn- x* |  j D] } | | j k rx | } Pqx qx W| d k r t |  n  t	 |  j
 | j |  S(   s   
        Find a I{service} by name (string) or index (integer).
        @param name: The name (or index) of a service.
        @type name: (int|str)
        @return: A L{PortSelector} for the found service.
        @rtype: L{PortSelector}. 
        s   No services defineds   at [%d]N(   R*   Ru   Rm   R6   t
   isinstancet   intR]   t
   IndexErrort   ServiceNotFoundt   PortSelectorRl   t   ports(   R,   R]   R'   R/   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyt   __find:  s     c         C   s0   |  j  j j } | d k r d S|  j |  Sd S(   s   
        Get the I{default} service if defined in the I{options}.
        @return: A L{PortSelector} for the I{default} service.
        @rtype: L{PortSelector}. 
        N(   Rl   R    R'   R*   Rp   (   R,   t   ds(    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyt   __dsT  s    (   R?   R@   RN   R0   Rt   Rv   Rp   Ro   (    (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR%      s   	
			R{   c           B   s;   e  Z d  Z d   Z d   Z d   Z d   Z d   Z RS(   sv  
    The B{port} selector is used to select a I{web service} B{port}.
    In cases where multiple ports have been defined and no default has been
    specified, the port is found by name (or index) and a L{MethodSelector}
    for the port is returned.  In all cases, attribute access is
    forwarded to the L{MethodSelector} for either the I{first} port or the
    I{default} port (when specified).
    @ivar __client: A suds client.
    @type __client: L{Client}
    @ivar __ports: A list of I{service} ports.
    @type __ports: list
    @ivar __qn: The I{qualified} name of the port (used for logging).
    @type __qn: str
    c         C   s   | |  _  | |  _ | |  _ d S(   s   
        @param client: A suds client.
        @type client: L{Client}
        @param ports: A list of I{service} ports.
        @type ports: list
        @param qn: The name of the service.
        @type qn: str
        N(   t   _PortSelector__clientt   _PortSelector__portst   _PortSelector__qn(   R,   Rn   R|   t   qn(    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR0   p  s    			c         C   s=   |  j    } | d k r* |  j d  } n | } t | |  S(   s9  
        Request to access an attribute is forwarded to the
        L{MethodSelector} for either the I{first} port or the
        I{default} port (when specified).
        @param name: The name of a method.
        @type name: str
        @return: A L{MethodSelector}.
        @rtype: L{MethodSelector}. 
        i    N(   t   _PortSelector__dpR*   t   _PortSelector__findRq   (   R,   R]   Rr   t   m(    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyRt   }  s
    
c         C   s-   |  j    } | d k r% |  j |  S| Sd S(   s  
        Provides selection of the I{port} by name (string) or 
        index (integer).  In cases where only (1) port is defined
        or a I{default} has been specified, the request is forwarded
        to the L{MethodSelector}.
        @param name: The name (or index) of a port.
        @type name: (int|str)
        @return: A L{MethodSelector} for the specified port.
        @rtype: L{MethodSelector}. 
        N(   R   R*   R   (   R,   R]   Rr   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyRv     s    c         C   s	  d } t |  j  s( t d |  j  n  t | t  r{ d |  j | f } y |  j | } Wq t k
 rw t |  q XnE d j	 |  j | f  } x* |  j D] } | | j
 k r | } Pq q W| d k r t |  n  d j	 |  j | j
 f  } t |  j | j |  S(   s   
        Find a I{port} by name (string) or index (integer).
        @param name: The name (or index) of a port.
        @type name: (int|str)
        @return: A L{MethodSelector} for the found port.
        @rtype: L{MethodSelector}. 
        s   No ports defined: %ss   %s[%d]t   .N(   R*   Ru   R   R6   R   Rw   Rx   Ry   t   PortNotFoundRK   R]   t   MethodSelectorR   t   methods(   R,   R]   Rs   R   R2   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR}     s$    c         C   s0   |  j  j j } | d k r d S|  j |  Sd S(   s   
        Get the I{default} port if defined in the I{options}.
        @return: A L{MethodSelector} for the I{default} port.
        @rtype: L{MethodSelector}. 
        N(   R   R    Rs   R*   R   (   R,   t   dp(    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyt   __dp  s    (   R?   R@   RN   R0   Rt   Rv   R   R   (    (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR{   a  s   				R   c           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s,  
    The B{method} selector is used to select a B{method} by name.
    @ivar __client: A suds client.
    @type __client: L{Client}
    @ivar __methods: A dictionary of methods.
    @type __methods: dict
    @ivar __qn: The I{qualified} name of the method (used for logging).
    @type __qn: str
    c         C   s   | |  _  | |  _ | |  _ d S(   s   
        @param client: A suds client.
        @type client: L{Client}
        @param methods: A dictionary of methods.
        @type methods: dict
        @param qn: The I{qualified} name of the port.
        @type qn: str
        N(   t   _MethodSelector__clientt   _MethodSelector__methodst   _MethodSelector__qn(   R,   Rn   R   R   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR0     s    			c         C   s   |  | S(   s   
        Get a method by name and return it in an I{execution wrapper}.
        @param name: The name of a method.
        @type name: str
        @return: An I{execution wrapper} for the specified method name.
        @rtype: L{Method}
        (    (   R,   R]   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyRt     s    c         C   sR   |  j  j |  } | d k rB d j |  j | f  } t |  n  t |  j |  S(   s   
        Get a method by name and return it in an I{execution wrapper}.
        @param name: The name of a method.
        @type name: str
        @return: An I{execution wrapper} for the specified method name.
        @rtype: L{Method}
        R   N(   R   R;   R*   RK   R   t   MethodNotFoundt   MethodR   (   R,   R]   R   R   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyRv     s
    (   R?   R@   RN   R0   Rt   Rv   (    (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR     s   			
R   c           B   s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s   
    The I{method} (namespace) object.
    @ivar client: A client object.
    @type client: L{Client}
    @ivar method: A I{wsdl} method.
    @type I{wsdl} Method.
    c         C   s   | |  _  | |  _ d S(   s   
        @param client: A client object.
        @type client: L{Client}
        @param method: A I{raw} method.
        @type I{raw} Method.
        N(   Rn   t   method(   R,   Rn   R   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR0     s    	c         O   sx   |  j  |  } | |  j |  j  } |  j   sd y | j | |  SWqt t k
 r` } d | f SXn | j | |  Sd S(   s$   
        Invoke the method.
        i  N(   t   clientclassRn   R   t   faultst   invoket   WebFault(   R,   t   argsR.   R   Rn   Rg   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyt   __call__  s    c         C   s   |  j  j j S(   s    get faults option (   Rn   R    R   (   R,   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR     s    c         C   s   t  j |  r t  St Sd S(   s    get soap client class N(   t	   SimClientt
   simulationt
   SoapClient(   R,   R.   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR     s    (   R?   R@   RN   R0   R   R   R   (    (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR     s
   	
		R   c           B   se   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d
 d  Z d
 d	  Z RS(   sb  
    A lightweight soap based web client B{**not intended for external use}
    @ivar service: The target method.
    @type service: L{Service}
    @ivar method: A target method.
    @type method: L{Method}
    @ivar options: A dictonary of options.
    @type options: dict
    @ivar cookiejar: A cookie jar.
    @type cookiejar: libcookie.CookieJar
    c         C   s.   | |  _  | |  _ | j |  _ t   |  _ d S(   s   
        @param client: A suds client.
        @type client: L{Client}
        @param method: A target method.
        @type method: L{Method}
        N(   Rn   R   R    R    t	   cookiejar(   R,   Rn   R   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR0   2  s    		c         C   s   t  j   } | j   d } |  j j j } |  j | _ | j |  j | |  } | j	   t  j
 j d |  j j |  | j   |  j |  } | j	   t  j
 j d |  j j |  | S(   sm  
        Send the required soap message to invoke the specified method
        @param args: A list of args for the method invoked.
        @type args: list
        @param kwargs: Named (keyword) args for the method invoked.
        @type kwargs: dict
        @return: The result of the method invocation.
        @rtype: I{builtin}|I{subclass of} L{Object}
        s   message for '%s' created: %ss   method '%s' invoked: %sN(   RS   RT   RU   R*   R   t   bindingt   inputR    t   get_messageRb   R^   Rc   R]   t   send(   R,   R   R.   Rd   Rf   R   t   msg(    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR   >  s"    


	

	c   
      C   s  d } |  j   } |  j j j } |  j j } |  j j } t j	 d | |  yq |  j
 t |   t | t |   } |  j   | _ | j |  } | r | j } n |  j | | j  } WnP t k
 r}	 |	 j d k r d } qt j |  j
    |  j | |	  } n X| S(   s   
        Send soap message.
        @param msg: A soap message to send.
        @type msg: basestring
        @return: The reply to the sent message.
        @rtype: I{builtin} or I{subclass of} L{Object}
        s   sending to (%s)
message:
%si   i   N(   i   i   (   R*   t   locationR   R   R   R    R   t   retxmlR^   Rc   R<   R   R   t   strt   headersR   t   messaget	   succeededR   t   httpcodeR_   t   failed(
   R,   R   Rf   R   R   R   R   t   requestt   replyRg   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR   Z  s(    	c         C   sL   |  j  j j } i d d 6| d 6} t | |  j j  } t j d |  | S(   s   
        Get http headers or the http/https request.
        @return: A dictionary of header/values.
        @rtype: dict
        s   text/xmls   Content-Typet
   SOAPActions   headers = %s(   R   t   soapt   actionR   R    R   R^   Rc   (   R,   R   t   stockRf   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR   y  s
    c         C   s   t  j d |  t |  d k rg | j |  j |  \ } } |  j |  |  j j rZ | Sd | f Sn |  j j rw d Sd Sd S(   s  
        Request succeeded, process the reply
        @param binding: The binding to be used to process the reply.
        @type binding: L{bindings.binding.Binding}
        @return: The method result.
        @rtype: I{builtin}, L{Object}
        @raise WebFault: On server.
        s   http succeeded:
%si    i   N(   i   N(	   R^   Rc   Ru   t	   get_replyR   R=   R    R   R*   (   R,   R   R   t   rR2   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR     s    	c         C   s   | j  t |  } } | j j   } t j d |  | d k r t |  d k r | j |  \ } } |  j |  | | f S| d f Sn  |  j
 j r t | | f   n
 | d f Sd S(   s  
        Request failed, process reply based on reason
        @param binding: The binding to be used to process the reply.
        @type binding: L{suds.bindings.binding.Binding}
        @param error: The http error message
        @type error: L{transport.TransportError}
        s   http failed:
%si  i    N(   R   t   tostrt   fpt   readR^   Rc   Ru   t	   get_faultR=   R*   R    R   R6   (   R,   R   R_   t   statust   reasonR   R   R2   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR     s    
c         C   s%   t  |  j  } | j d |  j j  S(   NR   (   R   R    R;   R   R   (   R,   R2   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR     s    c         C   s9   d } |  j  j } | d  k r+ | j |  S| | | <d  S(   NR   (   Rn   R+   R*   R;   (   R,   t   dt   keyR+   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR<     s
    c         C   s9   d } |  j  j } | d  k r+ | j |  S| | | <d  S(   NR   (   Rn   R+   R*   R;   (   R,   R   R   R+   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR=     s
    N(   R?   R@   RN   R0   R   R   R   R   R   R   R*   R<   R=   (    (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR   %  s   							R   c           B   s>   e  Z d  Z d Z e d    Z d   Z d   Z d   Z RS(   s<   
    Loopback client used for message/reply simulation.
    t   __injectc         C   s   | j  t j  S(   s;    get whether loopback has been specified in the I{kwargs}. (   t   has_keyR   t   injkey(   R   R.   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR     s    c         C   s   | |  j  } | j d  } | j d  } | j d  } | d k r | d k	 re |  j | | |  S| d k	 r~ |  j |  St d   n  t   j d |  } |  j |  S(   sp  
        Send the required soap message to invoke the specified method
        @param args: A list of args for the method invoked.
        @type args: list
        @param kwargs: Named (keyword) args for the method invoked.
        @type kwargs: dict
        @return: The result of the method invocation.
        @rtype: I{builtin} or I{subclass of} L{Object}
        R   R   t   faults$   (reply|fault) expected when msg=Nonet   stringN(	   R   R;   R*   t   _SimClient__replyt   _SimClient__faultR6   R   t   parseR   (   R,   R   R.   R   R   R   R   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR     s    
c         C   sn   |  j  j j } |  j | _ | j |  j  | |  } t j d |  |  j  j j } |  j | _ |  j | |  S(   s    simulate the reply s#   inject (simulated) send message:
%s(	   R   R   R   R    R   R^   Rc   t   outputR   (   R,   R   R   R.   R   R   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyt   __reply  s    c         C   s[   |  j  j j } |  j | _ |  j j rS | j |  \ } } |  j |  d | f Sd Sd S(   s    simulate the (fault) reply i  N(   i  N(   R   R   R   R    R   R   R=   R*   (   R,   R   R   R   R2   (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyt   __fault  s    
(	   R?   R@   RN   R   RO   R   R   R   R   (    (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyR     s   		
(    (    (    (    (    (    (0   RN   RG   t   suds.metricsRS   t	   cookielibR    t   suds.transportR   R   t   suds.transport.httpsR   t   suds.transport.cacheR   t   suds.servicedefinitionR   R   R   RY   R	   t   suds.resolverR
   t   suds.builderR   t	   suds.wsdlR   t   suds.sax.documentR   t   suds.sax.parserR   t   suds.optionsR   t   suds.propertiesR   R   t   copyR   t   loggingR   R?   R^   RZ   R   R%   R{   R   R   R   R   (    (    (    s#   suds-0.3.7-py2.6.egg/suds/client.pyt   <module>   s<   
6fg0-