# -*- coding: utf-8 from SOAPpy import SOAPProxy from SOAPpy import Types from SOAPpy import Config import re import sys import cElementTree import random import time #url = "http://opah.htk.tlu.ee:8080/WaramuWeb/waramuService" #url = "http://opah:8080/waramuService/waramu" url = "http://opah:8080/WaramuWeb/LocalSQIService" #url = "http://localhost:8080/WaramuWeb/LocalSQIService" #url = "http://localhost:8080/WaramuWeb/waramuService" namespace= "http://fire.waramu.htk.tlu.ee/" username='admin' password='adminadmin' #username='vahur' #password='parool' c = Config c.debug = 0 s = SOAPProxy(url, config=c) startt = time.time() # ======= Login in sessIdresponse = s._ns(namespace).createAnonymousSession() #print sessIdresponse sql = s._ns(namespace).setQueryLanguage(sessionID=sessIdresponse, queryLanguageID="http://www.prolearn-project.org/PLQL/l2") #print sql sql = s._ns(namespace).setResultsFormat(sessionID=sessIdresponse, resultsFormat="http://fire.eun.org/xsd/strictLreResults-1.0") q = "loodus" q = "lom.general.title = \"Design Patterns\" and lom.educational.(intendedEndUserRole = \"learner\" and typicalAgeRange = \"15-18\") OR ( suslik AND lom.general.description = \"field\")" search = s._ns(namespace).synchronousQuery(sessionID=sessIdresponse, queryStatement=q) #print search print "done" endt = time.time() print endt-startt