I recently ran into the same problem. After a decent amount of research, I discovered (and this may be limited only by me) that it is rather complicated.
You can connect the required “authorization header” to the webservice SOAP call as follows:
Map<String, Object> req_ctx = ((BindingProvider)port).getRequestContext();
req_ctx.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, WS_URL);
Map<String, List<String>> headers = new HashMap<String, List<String>>();
headers.put("key", Collections.singletonList("yourkey"));
req_ctx.put(MessageContext.HTTP_REQUEST_HEADERS, headers);
:
MessageContext mctx = wsctx.getMessageContext();
Map http_headers = (Map) mctx.get(MessageContext.HTTP_REQUEST_HEADERS);
List userList = (List) http_headers.get("key");
.
, oAuth2 API - .
oAuth 1 . , , , .
oAuth 2 HTTPS. API? , oAuth 2 ( ). , ( IMO) . API, SSL .
. :