Object Moved Here error
<p>I've developed a web service with Form based authentication as below.</p>

<p>1.An entry in web.config as below.</p>

<pre><code>&lt;authentication mode="Forms"&gt;
&lt;forms loginUrl="Loginpage.aspx" name=".AuthAspx"&gt;
&lt;/forms&gt;
&lt;/authentication&gt;
&lt;authorization&gt;
&lt;deny users="?"/&gt;
&lt;/authorization&gt;

&lt;authentication mode="Forms"&gt;

&lt;forms loginUrl="Loginpage.aspx" name=".AuthAspx"/&gt;&lt;/authentication&gt;

&lt;authorization&gt;&lt;deny users="?"/&gt; &lt;/authorization&gt;
</code></pre>

<p>2.In Login Page user is validate on button click event as follows.</p>

<pre><code>if (txtUserName.Text == "test" &amp;&amp; txtPassword.Text == "test")

        {

            FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, // Ticket version

                txtUserName.Text,// Username to be associated with this ticket

                DateTime.Now, // Date/time ticket was issued

                DateTime.Now.AddMinutes(50), // Date and time the cookie will expire

                false, // if user has chcked rememebr me then create persistent cookie

                "", // store the user data, in this case roles of the user

                FormsAuthentication.FormsCookiePath); // Cookie path specified in the web.config file in &lt;Forms&gt; tag if any.

            string hashCookies = FormsAuthentication.Encrypt(ticket);

            HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, hashCookies); // Hashed ticket

            Response.Cookies.Add(cookie);

            string returnUrl = Request.QueryString["ReturnUrl"];

            if (returnUrl == null) returnUrl = "~/Default.aspx";

            Response.Redirect(returnUrl, false);

        }
</code></pre>

<p>3.Webservice has a default webmethod.</p>

<p>[WebMethod]</p>

<pre><code>    public string HelloWorld()

    {      

            return "Hello World";            

    }
</code></pre>

<p>4.From a webApplication I am making a call to webservice by creating proxy after adding the webreferance of the above webservice.</p>

<pre><code>          localhost.Service1 service = new localhost.Service1();           


            service.Credentials = ystem.Net.CredentialCache.DefaultNetworkCredentials;;


            string hello = service.HelloWorld();

            Response.Write(hello);
</code></pre>

<p>and here while consuming it in a web application the below exception is thrown from webservice proxy.</p>

<p>--
Object moved</p>

<h2>Object moved to here.</h2>

<p></p>
