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

  • SEARCH
  • Home
  • 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 1928414
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:58:31+00:00 2026-05-17T06:58:31+00:00

I am not able to call web service(asmx) from jQuery function. It is saying

  • 0

I am not able to call web service(asmx) from jQuery function.

It is saying “access denied” error while calling web service. It is working in the dev and local machine but I am getting the same error.

Here is my ajax call

$.ajax({
            type: "POST",
            url: "http://server.com/calculator.asmx/calculus",
            data: "{ 'userID': '" + $("#usrid").val() + "','password': '" + $("#password").val() + "' }",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: Success,
            error: Error
        });

My web service is

[WebService(Namespace = "http://www.company.com/webservices/calculus")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService]

public class calculator : System.Web.Services.WebService
{

    [WebMethod]
    [System.Web.Script.Services.ScriptMethod(UseHttpGet=false, ResponseFormat = System.Web.Script.Services.ResponseFormat.Json)]
   public bool calculus(string userName, string password)
    {// my code}

The error is in http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js function and
the “Access denied” error at e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);

I have included [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] with the class as shown in http://forums.asp.net/p/1570168/3935094.aspx and not able to fix the prob. Can any one please help me regarding this.

Thank you

  • 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-05-17T06:58:32+00:00Added an answer on May 17, 2026 at 6:58 am

    JSONP is a possible way to workaround the “same origin policy” (aka cross-site-scripting or XSS) limitations. It comes with its own set of challenges (for example, it works only with GET-mode requests), so it’s certainly not a panacea. But it’s probably worth your time to give it a look. There’s a decent number of stackoverflow postings about it, which should help you get started.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am not able to access localhost https pages in firefox3. It gave the
Application able to record error in OnError, but we are not able to do
From a previous question , I learn that Linq to SQL is not able
I have done jQuery and Ajax, but I am not able to get the
I am not able to use the breakpoint in Studio with Javascript. I'm able
Why are we not able to override an instance variable of a super class
I feel like i am completely missing something because I am not able to
I have the odd problem that I am not able to open the properties
I am sorry, my question is stupid, but I am not able to answer
I have not been able to find a way to cancel/terminate asynchronous read operation

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.