Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TeamMentor python - Initial Python Web service call data (by arvinddoraiswamy)
import suds
import re
url='http://.....:8000//aspx_pages/TM_WebServices.asmx?WSDL'
def main():
client=connect_and_login(url)
get_methods_parameters_datatypes(client)
def connect_and_login(url):
client = suds.client.Client(url)
client.service.Login('admin','..........')
match = re.search(r'ASP.NET_SessionId=.*Cookie Session=', str(client.options.transport.cookiejar))
if match:
user_properties=client.service.Current_User()
client.set_options(headers={'CSRF_Token': user_properties['CSRF_Token']})
return client
def get_methods_parameters_datatypes(client):
t1=re.findall(r'.*Methods\ \(\d+\)(.*)Types\ \(\d+\)',str(client),re.DOTALL)
main()
#d = dict(http='127.0.0.1:8080')
#client.set_options(proxy=d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.