ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Ws Wiki] Update of "FrontPage/Axis/AxisClientSetHTTPHeaders" by FlorianKirchhoff
Date Wed, 15 Sep 2010 19:34:06 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Ws Wiki" for change notification.

The "FrontPage/Axis/AxisClientSetHTTPHeaders" page has been changed by FlorianKirchhoff.


New page:
Q: How do I setup HTTP headers in Axis clients?

A: Set the appropriate Hashtable entry in the MessageContext in a Handler:

package yourpackage;
import java.util.Hashtable;
import org.apache.axis.AxisFault;
import org.apache.axis.MessageContext;
import org.apache.axis.handlers.BasicHandler;
import org.apache.axis.transport.http.HTTPConstants;
public class HTTPHeaderHandler extends BasicHandler {
  public void invoke(MessageContext ctx) throws AxisFault {
    Hashtable ht = (Hashtable)ctx.getProperty(HTTPConstants.REQUEST_HEADERS);
    if(ht == null) {
      ht = new Hashtable();
    ht.put("test", "test");
    ctx.setProperty(HTTPConstants.REQUEST_HEADERS, ht);
The next step is to configure the handler in client-config.wsdd:

<?xml version="1.0" encoding="UTF-8"?>
<deployment name="defaultClientConfig" xmlns="" xmlns:java="">
  <parameter name="disablePrettyXML" value="true" />
  <parameter name="enableNamespacePrefixOptimization" value="false" />
 <handler type="java:yourpackage.HTTPHeaderHandler" name="HTTPHeaderHandler" />
 <transport name="http"
   <handler type="HTTPHeaderHandler" />
 <transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender" />
 <transport name="java"  pivot="" />
You can find details of how to configure a Handler in AxisClientConfiguration and how to ensure
your client code picks up your client-config.wsdd in AxisClientConfiguration.

View raw message