I actual figured this out and I decided to post my code incase anyone else hits this road block. Thanks Sameera for the link it was a big help.

        ServiceClient _serviceClient = stub._getServiceClient();
        Options ops = _serviceClient.getOptions();
        if(ops==null){
            ops = new Options();
        }

        Header head = new Header();
        head.setName("MyKey");
        head.setValue("MyValue");

        ArrayList v = new ArrayList();
        v.add(head);

        ops.setProperty(HTTPConstants.HTTP_HEADERS, v);
        _serviceClient.setOptions(ops);

Rob


On 6-Feb-07, at 10:14 PM, Sameera Madushan wrote:

Hi Robert

Check this link,  sometimes it may help you.

http://wso2.org/library/230

Sameera

On 2/7/07, Robert Chilvers <[EMAIL PROTECTED]> wrote:
Hi All;

I am not sure if this is the best place for this question, but I am stuck.

I have a Axis2 client which I created from a service's WSDL using the xmlbeans data binding. I am now trying to connect to the live service, but the service is behind a proxy server. The proxy server monitors the HTTP headers, and based on custom field in the header will route the request to the correct machine. I am trying to add the HTTP Header information to my code for the client, but I am not sure how to do this. So far the best I have been able to do is this:

 //Set the HTTP Headers
ServiceClient sc = stub._getServiceClient();
Options options = sc.getOptions();
options.setProperty("myKey", "myValue");
sc.setOptions(options);
stub._setServiceClient(sc);

I am hoping somebody may be able to help me here, or at least point me to some reference that discuss this


Rob


Reply via email to