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 9125069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:42:57+00:00 2026-06-17T06:42:57+00:00

I am trying to call external web service, its work fine in chrome, but

  • 0

I am trying to call external web service, its work fine in chrome, but not in firefox and IE. In chrome, it returns 'true', but in firefox, it returns '0 error', it here is my complete code…

 <script type="text/javascript" src="js/jquery-1.3.1.min.js"></script>
<script type="text/javascript">

    $(document).ready(function () {
        $("#btnCall").click(function (event) {
            var campaignid = 1000007;
            var r_source_id = 1000008;
            var parameters = "{'CompanyName': '" + document.getElementById('txtCompanyName').value + "', 'name': '" + document.getElementById('txtName').value + "', 'title': '', 'email':'" + document.getElementById('txtEmail').value + "', 'phone':'" + document.getElementById('txtPhoneNo').value + "', 'web_url':'', 'no_of_emp':'0', 'c_Currency_id':'100', 'r_source_id':'" + r_source_id.toString() + "', 'industry_ID':'1', 'city':'', 'country_ID':'" + document.getElementById('ddlCountry').value + "', 'cur_solution':'','pur_timeline':'','comments':'', 'year_sell_erp':'2013', 'support':'', 'bpgroup_ID':'1', 'C_Campaign_ID':'" + campaignid.toString() + "', 'R_STATUS_ID':'1000033', 'C_Region_ID':'100', 'CreatedBy':'1000012', 'salesrep_id':'1000012', 'ad_org_id':'1000001', 'ad_client_id':'1000001', 'UpdatedBy':'100', 'AccessKey':'caff4eb4fbd6273e37e8a325e19f0991'}";
            $.ajax({
                type: "POST",
                url: "http://cloudservice.softwareonthecloud.com/service.asmx/SetLead",
                data: parameters,
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                async: false,
                success: function (msg) {
                    AjaxSucceeded(msg);
                },
                error: AjaxFailed
            });
        });
    });
    function AjaxSucceeded(result) {
        alert(result.d);
    }
    function AjaxFailed(result) {
        alert(result.status + ' ' + result.statusText);
    }  
</script>

Here is I have upload this function URL for testing

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

    You are getting this error cause you are trying to call a web service on another domain. This violates the Same origin policy. This is a security limitation. Most older browsers will deny such requests.

    You will need to setup Cross-Origin Resource Sharing if you want to access a different domain the webservice in javascript.

    Cross-origin resource sharing (CORS) is a mechanism that allows a web
    page to make XMLHttpRequests to another domain. Such “cross-domain”
    requests would otherwise be forbidden by web browsers, per the same
    origin security policy. CORS defines a way in which the browser and
    the server can interact to determine whether or not to allow the
    cross-origin request

    If you have access to the webservice code, you can enable CORS requests at the server.
    Enable cors is a good resource. Here is some explaination on cors

    On IIS 7, you need to set a few custom headers in your web.config.

    <system.webserver>
     <httpprotocol>
      <customheaders>
       <add name="Access-Control-Allow-Origin" value="*" />
       <add name="Access-Control-Allow-Headers" value="Content-Type" />
      </customheaders>
     </httpprotocol>
    </system.webserver>
    

    Here are the steps for IIS6

    Security Note: For an example here, I have allowed all requests to the server. You may want to limit this to selected domains if you are serving sensitive data.

    WCF based requests too can be inspected via the WebOperationContext.Current.IncomingRequest and appropriate headers can be sent out.

    CORS requests are not supported on older browsers. You can see the full browser compatibility list here

    If you must support older browsers, or cannot change the webservice, you can always host a webservice proxy on your server. You send the request to your server, and your server requests the data from the original webserivce. This works fine, cause it does not violate the cross origin policy. A simple http handler can server as the proxy on your server.

    Here is what a sample http handler proxy to a REST webservice would look like:

    public void ProcessRequest(HttpContext context) {
      WebClient myClient = new WebClient(); 
    
      //Fetch response on your server
      string response = myClient.DownloadString("http://example.com/webservice/webMethod");
    
      // Send response to your javascript.
      context.Response.Write(response);
    }
    

    You could then call this handler as required from javascript.

    • 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 external Web service via JQuery Ajax in the
Trying to call a SAP SOAP Web Service from a generated sudzc app shows
I'm trying to learn to call SharePoint Web Services from an external C# client.
I'm trying to call a simple function with alert but it wont work when
I am trying to call a web service from a BizTalk (2006) orchestration. Having
I'm trying to call a web service in my back end java code when
Has anyone seen this error when trying to call an external C function from
I am trying to call a controller action defined in an external assembly but
I'm trying to call an external API which returns XML, and i have no
I'm trying to make an external call to the google maps application on the

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.