Hi
With CXF you can write your own feature class that sets the additional header:
package wsoauth;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.message.Message;
import ch.ivyteam.ivy.webservice.exec.feature.WebServiceClientFeature;
import ch.ivyteam.ivy.webservice.exec.feature.WebServiceClientFeatureContext;
public class SetOAuthHeader implements WebServiceClientFeature
{
@Override
public void initialize(WebServiceClientFeatureContext context) {
String accessToken = "0b79bab50daca910b000d4f1a2b675d604257e42";
Client proxy = ClientProxy.getClient(context.getBindingProvider());
Map<String, List<String>> headers = new HashMap<String, List<String>>();
headers.put("Authorization", Arrays.asList("Bearer "+accessToken));
proxy.getRequestContext().put(Message.PROTOCOL_HEADERS, headers);
}
}
On the web service client add your class to the feature list:
![alt text][1]
If you now call the web service that HTTP header 'Authorization' is set to 'Bearer 0b79bab50daca910b000d4f1a2b675d604257e42'
Regards
Reto Weiss, Axon.ivy Support
[1]: https://answers.axonivy.com/upfiles/WSHttpHeader.png