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 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'm able to call a 3rd party vendor's web service from a Windows form
I am working on a project to call a webservice from different domain using
I've the following issue I've a windows application It calls a remote web service
first of all this is my third question about web services here and i
Looking over the web, I am finding no answer to this question. I see
We have a web application where we are using global.asax for url rewriting. We
Has anyone been able to get the suds soap library to work with the
I have a web app that allows people to register directly or by using
I work on a team that supports a mobile web site. It's a typical
Using Rails 3.0.7. I have a simple form which shows all records from one

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.