If you are using WCF to generate your client proxy (svcutil.exe) you could append a custom http header with your request like this:
// MyServiceClient is the class generated by svcutil.exe which derives from
// System.ServiceModel.ClientBase<TServiceContract> and which allows you to
// call the web service methods
using (var client = new MyServiceClient())
using (var scope = new OperationContextScope(client.InnerChannel))
{
var httpRequestProperty = new HttpRequestMessageProperty();
// Set the header value
httpRequestProperty.Headers.Add("JSESSIONID", "XXXXX");
OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = httpRequestProperty;
// Invoke the method
client.SomeMethod();
}
If you are using wsdl.exe to generate your client you can take a look here.
UPDATE:
Actually there's no need to cast to HttpWebRequest to add a custom header:
protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
WebRequest request = base.GetWebRequest(uri);
request.Headers.Add("JSESSIONID", "XXXXX");
return request;
}