A Microsoft article describes this issue: http://msdn.microsoft.com/en-us/library/aa480509.aspx
The call from the client has to catch the WebException, and update the URL to the webservice, which has to include the sessionId generated by the web server. Then repeat the call to the method:
localhost.WebService1 ws1 = new localhost.WebService1(); // the web service proxy
try {
ws1.HelloWorld();
} catch (WebException ex) {
HttpWebResponse response = (HttpWebResponse)ex.Response;
if (response.StatusCode == HttpStatusCode.Found) {
ws1.Url = new Uri(new Uri(ws1.Url), response.Headers["Location"]).AbsoluteUri;
ws1.HelloWorld();
}
}