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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:46:06+00:00 2026-06-01T09:46:06+00:00

I have created a web service which returns some data and am trying to

  • 0

I have created a web service which returns some data and am trying to access it using jquery but the console displays the following errors:

    OPTIONS http://localhost:56018/PhoneWebServices.asmx?op=GetMyChildren 405 (Method Not Allowed)
jQuery.ajaxTransport.sendjquery-1.7.1.js:8102
jQuery.extend.ajaxjquery-1.7.1.js:7580
LoginButton_onclickindex.html:26
(anonymous function)index.html:59
onclickindex.html:60
XMLHttpRequest cannot load http://localhost:56018/PhoneWebServices.asmx?op=GetMyChildren. Origin null is not allowed by Access-Control-Allow-Origin.

I assumed the 405 error was due the ‘Origin null is not allowed’ error.
These are the steps I’ve taken so far:

  • Created a website (work in progress) and created the web service in the website.
  • I tested the web service by typing the url in my browser and it works.
  • Created a mobile web app which tries to call the webservice but shows the above errors.

My Client-side (mobile app code):

<script type="text/javascript">

      document.addEventListener("deviceready", onDeviceReady, false);


      function onDeviceReady() {

      }

      function LoginButton_onclick() {
      var email=document.getElementById("EmailBox").value;
      var pass=document.getElementById("PasswordBox").value;
      $.ajax({
          type: "POST",
          contentType: "application/json; charset=utf-8",
          url: "http://localhost:56018/PhoneWebServices.asmx?op=GetMyChildren",
          data: '{ "email" : "' + email + '", "password": "' + pass + '" }',
          dataType: "json",
          success: GetChildrenSuccess,
          failure: GetChildrenFailed
      });
  }

  function GetChildrenSuccess(response) {
      var children = eval('(' + response.d + ')');
      var child;
      for(child in children) {
          $('#ResultsDiv').innerHTML = "ID: "+child.ID+ " Name: "+child.Name+" Surname: "+child.Surname+" \r\n";
      }
  }

  function GetChildrenFailed(error) {
      document.getElementById('ResultsDiv').innerHTML = "Error";
  }

  </script>

I was thinking maybe it was because I did not publish the website or webservice with IIS-do I need to do this? Even though the url worked when typed into the browser I am not sure whether it should be the same in the client side code.

I am very new to web programming so if you know what’s wrong please explain it in simple terms, any help is greatly appreciated.

  • 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-01T09:46:07+00:00Added an answer on June 1, 2026 at 9:46 am

    The problem is most likely to go away if you run the file through a local web server, and not just open the HTML-file with the browser. When you just open the file, without going through a web server, you don’t get an origin domain – thus the error message that the origin is null.

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

Sidebar

Related Questions

I have created a web service which is saving some data into to db.
I have created a web service which has a couple of methods developed using
I have created a RESTful PHP web service using Lithium which contains comments, each
I have created a ASMX Web Service which does some Active Directory stuff behind
I have written some data fetch service which fetches some entities from main web
I have created a web service which takes a username and password as parameters
I have a web service in which I created an enum.. i have a
I have been given the task of calling a web service which returns an
I have a web service method in which I create a particular type of
I have created Web-Service in asp.net with c# . Now i want to pass

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.