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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:55:20+00:00 2026-06-14T09:55:20+00:00

I have to call to a web service from javascript using ajax: $.ajax({ type:

  • 0

I have to call to a web service from javascript using ajax:

$.ajax({
    type: "GET",
    url: "http://[REMOTE-SERVER-IP]:8080/api/service",
    contentType: "application/jsonp",   
    crossDomain: true,
    success: successFunc,
    error: errorFunc
});

I read that to grant access to the method, a “crossdomain.xml” must be created in the server http://[REMOTE-SERVER-IP]:8080/crossdomain.xml:

<cross-domain-policy>
   <allow-access-from domain="[SERVICE-CALLER-IP]"/>
</cross-domain-policy>

But after doing that, when I try to call to the method, I’m getting this error from the javascript debugger:

XMLHttpRequest cannot load http://[REMOTE-SERVER-IP]:8080/[URL]. Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin

What am I doing bad?

Thank you very much!!!

  • 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-14T09:55:22+00:00Added an answer on June 14, 2026 at 9:55 am

    You can prefer two options here and both assumes that you can access the server.

    • The first option is to add callback=? parameter to request url, and modify the server response. Server should add the callback function to the response in the following format

      callback_function_coming_from_url([your_server_response])

    • The second option is to add Access-Control-Allow-Origin: * header to your server response. Or you can specify the address like Access-Control-Allow-Origin: [your_client_address]

    I prefer to option 2 since it is the convenient way to accomplish your task, and also, you can control your server response, much more secure than the option 1.

    You can get additional info from CORS

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

Sidebar

Related Questions

I have a Web Service call that returns reporting data using Linq-To-Entity (strongly type
I am trying to call a web service from asp.net 3.5 application. I have
I have a JSON Object that is returned from a web service call that
We have a Java web service that we call from our application. When we
I have a web service that I call via ajax that requires the user
So, I am calling a web service from jQuery using the .ajax method. The
I am trying to call a SharePoint web service from Acrobat JavaScript, and I
I have an XML web service that javascript calls are made using jQuery. This
I have to call the web service using java script? e.g. I'm creating one
I have a jquery ajax call asp.net web service question. I want to validate

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.