Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/twisted/web/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/twisted/web/__pycache__/soap.cpython-310.pyc
o

�bn�@sPdZddlZddlmZddlmZmZmZGdd�dej�Z	Gdd�d�Z
dS)	z�
SOAP support for twisted.web.

Requires SOAPpy 0.10.1 or later.

Maintainer: Itamar Shtull-Trauring

Future plans:
SOAPContext support of some kind.
Pluggable method lookup policies.
�N)�defer)�client�resource�serverc@sJeZdZdZdZdZdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
ddd�ZdS)�
SOAPPublisherz�Publish SOAP methods.

    By default, publish methods beginning with 'soap_'. If the method
    has an attribute 'useKeywords', it well get the arguments passed
    as keyword args.
    �zUTF-8cCst|d|d�S)z�Lookup published SOAP function.

        Override in subclasses. Default behaviour - publish methods
        starting with soap_.

        @return: callable or None if not found.
        zsoap_%sN)�getattr)�self�functionName�r�2/usr/lib/python3/dist-packages/twisted/web/soap.py�lookupFunction(szSOAPPublisher.lookupFunctioncCs�|j��}t�|ddd�\}}}}|j|j|j}}}	t|�r#|�}t|	�r*|	�}	|�|�}
|
s:|�	||�t
jSt|
d�rZi}|	�
�D]
\}}
|
|t|�<qEtj|
fi|��}n	tj|
g|�R�}|�|j||�|�|j||�t
jS)zHandle a SOAP command.r�useKeywords)�content�read�SOAPpy�parseSOAPRPC�_name�_aslist�_asdict�callabler
�_methodNotFoundr�NOT_DONE_YET�hasattr�items�strr�
maybeDeferred�addCallback�
_gotResult�
addErrback�	_gotError)r	�request�data�p�header�body�attrs�
methodName�args�kwargs�function�keywords�k�v�drrr�render2s(


zSOAPPublisher.rendercCs8tjt�dtjjd|�|jd�}|j||dd�dS)Nz	%s:ClientzMethod %s not found��encoding����status)r�	buildSOAP�	faultType�NS�ENV_Tr1�
_sendResponse)r	r!r'�responserrrrRs��zSOAPPublisher._methodNotFoundcCs<t|tj�s
d|i}tjd||i|jd�}|�||�dS)N�Resultz
%sResponse)�kwr1)�
isinstancer�voidTyper5r1r9)r	�resultr!r'r:rrrr[s�zSOAPPublisher._gotResultcCsT|j}t|tj�r|}nt�dtjjd|�}tj||jd�}|j||dd�dS)Nz	%s:ServerzMethod %s failed.r0r2r3)	�valuer=rr6r7r8r5r1r9)r	�failurer!r'�e�faultr:rrrr cs�zSOAPPublisher._gotError��cCsZ|�|�|jdurd|j}nd}|�d|�|�dtt|���|�|�|��dS)Nztext/xml; charset="%s"�text/xmlzContent-typezContent-length)�setResponseCoder1�	setHeaderr�len�write�finish)r	r!r:r4�mimeTyperrrr9ns


zSOAPPublisher._sendResponseN)rD)�__name__�
__module__�__qualname__�__doc__�isLeafr1r
r/rrr r9rrrrrs
 	rc@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
�ProxyaA Proxy for making remote SOAP calls.

    Pass the URL of the remote SOAP server to the constructor.

    Use proxy.callRemote('foobar', 1, 2) to call remote method
    'foobar' with args 1 and 2, proxy.callRemote('foobar', x=1)
    will call foobar with named argument 'x'.
    NcCs||_||_||_dS)N)�url�	namespacer$)r	rRrSr$rrr�__init__�s
zProxy.__init__cCs2t�|�}t|d�r
|jSt|�dkr|dS|S)Nr;rr)rrrr;rH)r	r?rrr�_cbGotResult�s

zProxy._cbGotResultcOs:tj||||j|jd�}tj|j|dd|d�d��|j�S)N)r(r<�methodr$rS�POSTrE)zcontent-type�
SOAPAction)�postdatarV�headers)	rr5r$rSr�getPagerRrrU)r	rVr(r)�payloadrrr�
callRemote�s���zProxy.callRemote)NN)rLrMrNrOrTrUr]rrrrrQ{s


rQ)rOr�twisted.internetr�twisted.webrrr�ResourcerrQrrrr�<module>s
`

Spamworldpro Mini