Skip to content

Instantly share code, notes, and snippets.

@rmoff
Last active February 11, 2020 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmoff/8601382 to your computer and use it in GitHub Desktop.
Save rmoff/8601382 to your computer and use it in GitHub Desktop.
Calling OBIEE SOAP Web Service from Python using SUDS
# RNM 20140124
#
# https://twitter.com/rmoff/
# --------------------
# Required
from suds.client import Client
client = Client('http://obiee-server:9704/analytics-ws/saw.dll/wsdl/v7')
#------------
# Logon
sessionid = client.service['SAWSessionService'].logon('weblogic','Password01')
# List subject areas
sa_list=client.service['MetadataService'].getSubjectAreas(sessionid)
for sa in sa_list:
print sa.name
# List SA's tables and Columns
sa_description=client.service['MetadataService'].describeSubjectArea(sa_list[0].name,'IncludeTablesAndColumns',sessionid)
for table in sa_description.tables:
print '\t%s' % (table.name)
for col in table.columns:
print '\t\t%s' % (col.name)
# ----------------------
# Reference
# Print all methods and services
print str(client);
# See http://docs.oracle.com/cd/E28280_01/bi.1111/e16364/methods.htm for full WS documentation
@raamch
Copy link

raamch commented Oct 15, 2018

I get AttributeError: 'NoneType' object has no attribute 'promotePrefixes' when i try to establish session. I am using python3.7. any help would be greatly appreciated.

from suds.client import Client
client = Client('https://eicu-dev2.fa.em2.oraclecloud.com/analytics-ws/saw.dll/wsdl/v7')
sessionid = client.service['SAWSessionService'].logon('weblogic','Password01')
Traceback (most recent call last):
File "", line 1, in
File "C:\Ram\python\fuclone\venv\lib\site-packages\suds\client.py", line 559, in call
return client.invoke(args, kwargs)
File "C:\Ram\python\fuclone\venv\lib\site-packages\suds\client.py", line 618, in invoke
result = self.send(soapenv)
File "C:\Ram\python\fuclone\venv\lib\site-packages\suds\client.py", line 658, in send
result = self.succeeded(binding, reply.message)
File "C:\Ram\python\fuclone\venv\lib\site-packages\suds\client.py", line 696, in succeeded
reply, result = binding.get_reply(self.method, reply)
File "C:\Ram\python\fuclone\venv\lib\site-packages\suds\bindings\binding.py", line 150, in get_reply
soapenv.promotePrefixes()
AttributeError: 'NoneType' object has no attribute 'promotePrefixes'

@mavericklb
Copy link

While using the below lines, I'm unable to get the result set and the query executed :

data=client.service['ReportEditingService'].applyReportDefaults('/shared/DAO - CCR/Task Details',sessionid)
print(data)
x=client.service['ReportEditingService'].generateReportSQL('/shared/DAO - CCR/Task Details',sessionid)
print(x)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment