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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:16:03+00:00 2026-06-05T10:16:03+00:00

I am trying to call an asmx service using jQuery Ajax. POST /YderWS.asmx HTTP/1.1

  • 0

I am trying to call an asmx service using jQuery Ajax.

POST /YderWS.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://scandihealth.com/iwebservices/HentKommuner"

<?xml version="1.0" encoding="utf-8"?>
<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:Header>
    <AuthHeader xmlns="http://scandihealth.com/iwebservices/">
      <PartnerID>string</PartnerID>
      <SubPartnerID>string</SubPartnerID>
      <SubPartnerType>string</SubPartnerType>
    </AuthHeader>
  </soap:Header>
  <soap:Body>
    <HentKommuner xmlns="http://scandihealth.com/iwebservices/" />
  </soap:Body>
</soap:Envelope>

Above is the SOAP 1.1 request I need to send to the service. I am using the below call to set the custom soap header. But my request fails. Can anybody debug the below code for me and let me know what I need to do?

var authHeader = "<PartnerID>SCTEST001</PartnerID> <SubPartnerID>001</SubPartnerID> <SubPartnerType>S</SubPartnerType>";
//Call the page method
$.ajax({
  type: "GET",
  url: servicename + "/" + functionName,
  beforeSend: function (xhr) {
    xhr.setRequestHeader('AuthHeader', authHeader);
  },
  success: successFn,
  error: errorFn
});

EDIT *Please let me know if additional information is required to answer this question.*

  • 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-05T10:16:05+00:00Added an answer on June 5, 2026 at 10:16 am

    jQuery.ajax() issues generic HTTP requests for any type of “web service”, not just .NET web services. You’ll want to add a SOAPAction request header and pass the entire SOAP envelope as POST data:

    $.ajax({
        type: 'POST',
        url: servicename + "/" + functionName,
        contentType: 'text/xml; charset=utf-8',
        headers: {
            SOAPAction: 'http://scandihealth.com/iwebservices/HentKommuner'
        },
        data: '<?xml version="1.0" encoding="utf-8"?><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:Header><AuthHeader xmlns="http://scandihealth.com/iwebservices/"><PartnerID>string</PartnerID><SubPartnerID>string</SubPartnerID><SubPartnerType>string</SubPartnerType></AuthHeader></soap:Header><soap:Body><HentKommuner xmlns="http://scandihealth.com/iwebservices/" /></soap:Body></soap:Envelope>',
        success: successFn,
        error: errorFn
    });
    

    If you’re using jQuery < 1.5, you’ll need to use beforeSend to set the SOAPAction request header.

    You can find the documentation for jQuery.ajax() at http://api.jquery.com/jQuery.ajax/.

    • 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 a Web Method of service from a Jquery Ajax
Is using asmx service to update a session variable via ajax call a problem
I am trying to call an ASMX from jQuery using JSON and get a
Am I missing something? I'm trying to do a simple ajax call using jquery
I trying to call 2 functions in the same page to submit jquery-ajax at
I'm trying to use the official jQuery autocomplete plugin with an ASMX web service
I'm trying to create a simple AJAX & web service test (using C# .Net
I have been experimenting and trying to learn JQuery, using AJAX to consume a
I'm trying to call an ASP.NET .asmx webservice, from javascript, using other than the
Trying to call a SAP SOAP Web Service from a generated sudzc app shows

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.