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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:07:57+00:00 2026-06-09T06:07:57+00:00

I’m trying to call asp.net webservice in javascript / Jquery, i have tried so

  • 0

I’m trying to call asp.net webservice in javascript / Jquery,
i have tried so many examples but unfortunately not succeeded,

here is the code which currently i’m trying,

    login("abc@gmail.com", "123456");
    var productServiceUrl = 'http://localhost:50575/Service1.asmx?op=test'; // Preferably write this out from server side

    function login(Email, Password) {
        var soapMessage = '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> \
<soap:Body> \
<login xmlns="http://test.com/"> \
<Email>' + Email + '</Email> \
<Password>' + Password + '</Password> \
</login> \
</soap:Body> \
</soap:Envelope>';

        $.ajax({
            url: productServiceUrl,
            type: "GET",
            dataType: "xml",
            data: soapMessage,
            complete: endSaveProduct,
            error: function (a, b, c) {
                alert(a + "\n"  + b + "\n" + c);
            },
            contentType: "text/xml; charset=\"utf-8\""
        });

        return false;
    }

    function endSaveProduct(xmlHttpRequest, status) {
        $(xmlHttpRequest.responseXML)
    .find('loginResult')
    .each(function () {
        alert( $(this).find('Message').text());
    });
    }

please help me out,
Thanks in advance.

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

    There are multiple issues:

    • You are sending a request to different domain so it won’t work unless that domain is sending Cross-origin resource sharing (CORS) headers Access-Control-Allow-Origin: * or specifically allowing your origin
    • You are using GET where as you should be using POST, because in SOAP over HTTP the envelope must be in the request body.
    • jQuery always thinks your data is application/x-www-form-urlencoded unless you set processData to false. Only setting contentType will just make the header lie and doesn’t actually change this. Actually this is not true if the data parameter is a string.

    It appears that your target domain is not allowing CORS, so it is impossible to do it directly from client-side. You must use a server proxy to do the request.

    If they allowed CORS, you would do it like so:

    var soapMessage = '<?xml version="1.0" encoding="utf-8"?>\
                        <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">\
                          <soap12:Body>\
                            <login xmlns="http://tastygo.com/">\
                              <BBMID>string</BBMID>\
                              <Email>string</Email>\
                              <Password>string</Password>\
                            </login>\
                          </soap12:Body>\
                        </soap12:Envelope>';
    
    $.ajax( "http://m.allaccesstnt.com/AATnTWebservices/Webservices/Userwebservice.asmx", {
    
        contentType: "application/soap+xml; charset=utf-8",
        type: "POST", //important
        dataType: "xml",
        data: soapMessage
    
    });
    

    But this will not work because the server does not allow OPTIONS, which the browser must use to determine whether a cross-origin request is allowed:

    OPTIONS http://m.allaccesstnt.com/AATnTWebservices/Webservices/Userwebservice.asmx 405 (Method Not Allowed)
    

    The second problem is:

    XMLHttpRequest cannot load http://m.allaccesstnt.com/AATnTWebservices/Webservices/Userwebservice.asmx. Origin http://stackoverflow.com is not allowed by Access-Control-Allow-Origin.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:
I have a French site that I want to parse, but am running into
I am trying to loop through a bunch of documents I have to put
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is

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.