我的API使用OAuth2身份验证。我同时拥有REST和SOAP API。我可以通过在标头中添加授权来从我的Java应用程序中调用REST。但是,我不明白如何在SOAP请求中添加令牌。下面是SOAP请求的代码段。
try {
Svc_2169661E60B4474594C686E236B19239GEOilLiveLocator olocator = new Svc_2169661E60B4474594C686E236B19239GEOilLiveLocator(CommonUtil.getString("TMS_RETRIEVE_PART_REQUEST_URL"));
olocator.setEndpointAddress("https282986652", CommonUtil.getString("TMS_RETRIEVE_PART_REQUEST_URL"));
RetrieveItemInfoProcessBinding_0Stub stub = (RetrieveItemInfoProcessBinding_0Stub) olocator.gethttps282986652();
stub.retrieveItem(quoteHolder);
QuoteType respQuote = quoteHolder.value;