예제 #1
0
def main(username, passwd):
    url = 'https://10.201.16.10/LabManager/SOAP/LabManager.asmx?wsdl'
    client = Client(url)
    print client
    #
    #     authen = client.factory.create('AuthenticationHeader')
    #     authen.username = username
    #     authen.password = passwd
    #     authen.organizationname = 'TW POC Tool Team'
    #     authen.workspacename = 'Main'
    #
    #     client.set_options(service='LabManager_x0020_SOAP_x0020_interface', port='LabManager_x0020_SOAP_x0020_interfaceSoap12', soapheaders=authen)
    #     client.service.GetSingleConfigurationByName('TMLS_Agent')
    client = SoapClient(
        wsdl="https://10.201.16.10/LabManager/SOAP/LabManager.asmx?wsdl")
    print dir(client)
    client['AuthenticationHeader'] = {
        'username': username,
        'password': passwd,
        'organizationname': 'TW POC Tool Team',
        'workspacename': 'Main'
    }
    result = client.GetConfiguration(1)