How to call dss soap api in java with credentials header in soap header?
Hi, here's some context before I start to ask my question
Java version: 17
Gradle version: 8.0
Plugin used to generate stub: https://github.com/yupzip/wsdl2java
WSDL file I am referring to: https://selectapi.datascope.refinitiv.com/DataScopeApi/v1/ExtractionService.asmx?WSDL
Currently I am trying to call ValidateInstruments soap api, and I believe I have to provide the credential in the soap header but I don't know where can I set the credential header, below are the ValidateInstruments web method generated by the wsdl2java plugin
The InstrumentValidationRequest object:
Please help me with this, thanks in advance.
Best Answer
-
I can use Apache CFX 2.X to generate classes for DSS SOAPI API.
It uses WSDL2Java to generate Java classes. I need to check "Enable processing of implicit SOAP headers" (-exsh true).
However, I need to modify the OperationInfoHeader.Duration property in OperationInfoHeader.java to String.
public class OperationInfoHeader {
@XmlElement(name = "Host")
protected String host;
@XmlElement(name = "EjvServer")
protected String ejvServer;
@XmlElement(name = "ProcessingTime", required = true)
protected String processingTime;
@XmlAnyAttribute
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
...
...
public String getProcessingTime() {
return processingTime;
}
/**
* Sets the value of the processingTime property.
*
* @param value
* allowed object is
* {@link Duration }
*
*/
public void setProcessingTime(Duration value) {
this.processingTime = "";
}
..
}The example code is in the ExtractionService_ExtractionService_Client.java file. It looks like this:
ExtractionService_Service ss = new ExtractionService_Service(wsdlURL, SERVICE_NAME);
ExtractionService port = ss.getExtractionService();
{
System.out.println("Invoking getGovCorpCurrencyTypes...");
com.datascope.select.extractionservice.v1.CredentialsHeader _getGovCorpCurrencyTypes_credentialsHeaderVal = new com.datascope.select.extractionservice.v1.CredentialsHeader();
_getGovCorpCurrencyTypes_credentialsHeaderVal.setUsername("DSS User");
_getGovCorpCurrencyTypes_credentialsHeaderVal.setPassword("DSS Password");
_getGovCorpCurrencyTypes_credentialsHeaderVal.setAuthenticationToken("");
jakarta.xml.ws.Holder<com.datascope.select.extractionservice.v1.CredentialsHeader> _getGovCorpCurrencyTypes_credentialsHeader = new jakarta.xml.ws.Holder<com.datascope.select.extractionservice.v1.CredentialsHeader>(_getGovCorpCurrencyTypes_credentialsHeaderVal);
com.datascope.select.extractionservice.v1.EjvServerHeader _getGovCorpCurrencyTypes_ejvServerHeader = new com.datascope.select.extractionservice.v1.EjvServerHeader();
_getGovCorpCurrencyTypes_ejvServerHeader.setServer("Server-33758018");
jakarta.xml.ws.Holder<com.datascope.select.extractionservice.v1.OperationInfoHeader> _getGovCorpCurrencyTypes_operationInfoHeader = new jakarta.xml.ws.Holder<com.datascope.select.extractionservice.v1.OperationInfoHeader>();
com.datascope.select.extractionservice.v1.ArrayOfValueInfo _getGovCorpCurrencyTypes__return = port.getGovCorpCurrencyTypes(_getGovCorpCurrencyTypes_credentialsHeader, _getGovCorpCurrencyTypes_ejvServerHeader, _getGovCorpCurrencyTypes_operationInfoHeader);
System.out.println("getGovCorpCurrencyTypes.result=" + _getGovCorpCurrencyTypes__return);
System.out.println("getGovCorpCurrencyTypes._getGovCorpCurrencyTypes_credentialsHeader=" + _getGovCorpCurrencyTypes_credentialsHeader.value);
System.out.println("getGovCorpCurrencyTypes._getGovCorpCurrencyTypes_operationInfoHeader=" + _getGovCorpCurrencyTypes_operationInfoHeader.value);
}0
Answers
-
Thanks for reaching out to us.
DataScope Select - SOAP API is deprecated. We recommend using the Refinitiv DataScope Select - REST API instead.
You can refer to the DSS REST API tutorials and Java Code Examples.
0 -
Hi @Jirapongse, thanks for your response, I know it is deprecated, but I have to use soap api due to some reason, could you provide an example on calling dss soap api using java? Your help is much appreciated.
0
Categories
- All Categories
- 6 AHS
- 39 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 中文论坛