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
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 652 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛