Hi,

    When I am trying to access my web method I am getting ‘internal server’ error (status = 500). However when I am executing the same web service as a standalone application it is returning the correct output. Here are the details of my implementation.

 

Web Service

 

namespace WebServiceForAjax

{

     

      [WebService( Namespace="http://localhost/")]

      public class Service1 : System.Web.Services.WebService

      {

            public Service1()

            {

                  InitializeComponent();

            }

 

             

            private IContainer components = null;

                       

           

            private void InitializeComponent()

            {

            }

 

           

            protected override void Dispose( bool disposing )

            {

                  if(disposing && components != null)

                  {

                        components.Dispose();

                  }

                  base.Dispose(disposing);           

            }

           

            [WebMethod]

            public DataSet GetUserDetails()

            {

                  DataSet ds = new DataSet();

                  SqlCommand com = new SqlCommand();

                  SqlDataAdapter dp = new SqlDataAdapter();

 

                  SqlConnection con = new SqlConnection(ConfigurationSettings.AppSettings["CONN"]);

                  con.Open();

 

                  com.Connection = con;

                  com.CommandType = CommandType.Text;

                  com.CommandText = "Select loginid from users";

 

                  dp.SelectCommand = com;

                  dp.Fill(ds);

                  con.Close();

                  return ds;

                 

           

            }

      }

}

 

AJAX file

 

var xmlHttp ;

     

     

      function processfromwebservice()

      {

            if(window.ActiveXObject)

            {

                  try

                  {

                        xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");

                  }

                  catch(e)

                  {

                        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");

                  }

            }

           

            if(xmlHttp.readyState == 4 || xmlHttp.readyState == 0)

            {

                  xmlHttp.>

                  xmlHttp.open('GET','http://localhost/WebServiceForAjax/Service1.asmx/GetUserDetails',true)

                  xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

                  xmlHttp.send();

            }

      }

     

      function handleserverresponse()

      {

                             

            if(xmlHttp.readyState == 4)

            {

                  //THIS BLOCK IS NOT AT ALL EXECUTING

                  if(xmlHttp.status == 200)

                  {

                        xmlResponse = xmlHttp.responseXML;

                        xmlDocumentElement = xmlResponse.documentElement;

                                                                                         

                  }

            }

      }

 

Thanks & Regards

Paul

     

This email may contain material that is confidential, privileged and/or attorney work product for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at http://www.ajaxpro.info
-~----------~----~----~----~------~----~------~--~---

Reply via email to