Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9306033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:04:48+00:00 2026-06-19T00:04:48+00:00

I am trying to call asmx service On server from jQuery function like the

  • 0

I am trying to call asmx service On server from jQuery function like the following:

$('.myButton').click(function() {

                        $.ajax({
                                type: "POST",
                                url: "/http://myserver/service.asmx/GetProgramCategories",
                                cache: false,
                                contentType: "application/x-www-form-urlencoded",
                                data: "{}",
                                dataType: "json",
                                success: handleHtml,
                                error: ajaxFailed
                            });
                            });

    function handleHtml(data, status) 
    {
        for (var count in data.d) 
        {
        alert(data.d[count].Author);
        alert(data.d[count].BookName);
        }
    }

    function ajaxFailed(xmlRequest) 
    {
          alert(xmlRequest.status + ' \n\r ' + 
              xmlRequest.statusText + '\n\r' + 
              xmlRequest.responseText);
    }

I have debugged but it give me error 500 Internal Server Error

and the server descriptor like the following:

HTTP POST

The following is a sample HTTP POST request and response. The placeholders shown need to be replaced with actual values.

POST /service.asmx/GetProgramCategories HTTP/1.1
Host: myhost
Content-Type: application/x-www-form-urlencoded
Content-Length: length

username=string&password=string

HTTP/1.1 200 OK

any one can help please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T00:04:49+00:00Added an answer on June 19, 2026 at 12:04 am

    hey finally I got the answer

    this is the code:

    function sendRequest(url,callback,postData) {
        var req = createXMLHTTPObject();
        if (!req) return;
        var method = (postData) ? "POST" : "GET";
        req.open(method,url,true);
        req.setRequestHeader('User-Agent','XMLHTTP/1.0');
        if (postData)
            req.setRequestHeader('Content-type','application/x-www-form-urlencoded');
        req.onreadystatechange = function () {
            if (req.readyState != 4) return;
            if (req.status != 200 && req.status != 304) {
    //          alert('HTTP error ' + req.status);
                return;
            }
            callback(req);
        }
        if (req.readyState == 4) return;
        req.send(postData);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to call an asmx service using jQuery Ajax. POST /YderWS.asmx HTTP/1.1
I am trying to call a Web Method of service from a Jquery Ajax
I am trying to call the GetReportParameters method from the ReportingServices2005.asmx web service from
I'm trying to parse JSON result from an Ajax call to .NET web service
I am making a JQuery ajax call to a web service like so: $.ajax({
I am trying to call an ASMX from jQuery using JSON and get a
I am trying to call an asmx web service from an Android app. Just
Trying to call a SAP SOAP Web Service from a generated sudzc app shows
I trying to call 2 functions in the same page to submit jquery-ajax at
I'm trying to call a function present in one class from another class by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.