Unable to successfully login to DACS Station SOAP API via Python Suds 1.4.5
I am trying to use the DACS Station Soap API on DACS 7.7. This DACS has been running fine with our RTDS for some time, and I now want to try automate our usage of DACS using Python on Linux. I have looked at the code examples, but when logging in, I get the following error:
from suds.client import Client
url = 'http://localhost:8080/DacsWS/DacsWebServiceService?wsdl'
client = Client(url
l = client.factory.create("dacsAdministratorLogin")
l.aAdministratorName.mAdministratorName = "reuter"
l.aAdministratorPassword.mAdministratorPassword = "<redacted>"
client.service.getDacsAdministratorDefinition(l)
output is
2024-03-19 09:59:24,805 ERROR [suds.client] <?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://dacsWebService.rfa.reuters.com/" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<ns1:Body>
<ns0:getDacsAdministratorDefinition>
<loginAttribute>
<aAdministratorName>
<mAdministratorName>reuter</mAdministratorName>
</aAdministratorName>
<aAdministratorPassword>
<mAdministratorPassword>p_reuter</mAdministratorPassword>
</aAdministratorPassword>
</loginAttribute>
</ns0:getDacsAdministratorDefinition>
</ns1:Body>
</SOAP-ENV:Envelope>
.
.
.
WebFault: b"Server raised fault: 'java.lang.NullPointerException'"
I also tried
l = client.factory.create("dacsAdministratorLogin")
l.aAdministratorName = "reuter"
l.aAdministratorPassword = "<redacted>"
client.service.getDacsAdministratorDefinition(l).aResult.mErrorText
which gets further as we don't get a 500, but we this returns `Invalid Administrator Name`
I made sure that within DACS, that I have checked the "Enable Web Service Usage" (see attached screenshot).
Does anyone have any pointers on how I can get this working? I am using Suds 1.4.5 on Python 3.8. Thanks in advance.
Best Answer
-
Thank you for reaching out to us.
I checked the DACS Web Sevices Programmer's Guide and found that the getDacsAdministratorDefinition method requires two parameters.
The code should look like this:
_dl = client.factory.create('dacsAdministratorLogin')
_dl.aAdministratorName.mAdministratorName = dacsLogin
_dl.aAdministratorPassword.mAdministratorPassword = dacsPasswd
_dn = client.factory.create('dacsAdministratorName')
_dn.mAdministratorName = "reuter"
_adminDef = client.service.getDacsAdministratorDefinition(_dl, _dn)
print(_adminDef)0
Answers
-
Thanks @Jirapongse. I have updated my code but I am still getting the same NullPointerException error. The transmitted XML is:
2024-03-20 08:34:16,983 ERROR [suds.client] <?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://dacsWebService.rfa.reuters.com/" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<ns1:Body>
<ns0:getDacsAdministratorDefinition>
<loginAttribute>
<aAdministratorName>
<mAdministratorName>reuter</mAdministratorName>
</aAdministratorName>
<aAdministratorPassword>
<mAdministratorPassword>redacted</mAdministratorPassword>
</aAdministratorPassword>
</loginAttribute>
<adminName>
<mAdministratorName>reuter</mAdministratorName>
</adminName>
</ns0:getDacsAdministratorDefinition>
</ns1:Body>
</SOAP-ENV:Envelope>0 -
I tested the request on SOAP UI and it works fine.
You can contact the DACS support team directly to verify if the DACS WS is working properly.
0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛