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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:35:14+00:00 2026-05-23T18:35:14+00:00

I have a wcf webservice that is exposed through wsHTTPBinding and basicHTTPBinding. The latter

  • 0

I have a wcf webservice that is exposed through wsHTTPBinding and basicHTTPBinding. The latter specifies it’s endpoint address as being “/basic” as in the following:

    <endpoint address="/basic" binding="basicHttpBinding" bindingConfiguration="theAwesomeBasicHttpServerBinding" contract="LOServices.Proxy.ServiceContracts.ILOService">
      <identity>
        <servicePrincipalName value="HTTP/MY_MACHINE_NAME" />
      </identity>
    </endpoint>

the binding is defined as follows:

  <basicHttpBinding>
    <binding name="theAwesomeBasicHttpServerBinding" maxReceivedMessageSize="5000000">
      <security mode="TransportCredentialOnly">
        <transport clientCredentialType="Windows" />
      </security>
    </binding>
  </basicHttpBinding>

I am trying to call one of the webmethods using jquery. Because this is over a basicHTTPBinding and not RESTful, therefore, I will not be using JSON. I consequently am building the request XML from a previous (successful) call that I made to the service through wcf test client:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/ILOService/GetLoanActions</Action>
  </s:Header>
  <s:Body>
    <GetLoanActions xmlns="http://tempuri.org/">
      <request xmlns:d4p1="http://schemas.datacontract.org/2004/07/LOServices.Proxy.Requests" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <d4p1:AssociationNumber>3</d4p1:AssociationNumber>
        <d4p1:IgnoreWarnings>false</d4p1:IgnoreWarnings>
      </request>
    </GetLoanActions>
  </s:Body>
</s:Envelope>

The actual javascript that I am using therefore is structured as follows:

        function callWs() {
            var theRequest = " \
<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"> \
  <s:Header> \
    <Action s:mustUnderstand=\"1\" xmlns=\"http://schemas.microsoft.com/ws/2005/05/addressing/none\">http://tempuri.org/ILOService/GetLoanActions</Action> \
  </s:Header> \
  <s:Body> \
    <GetLoanActions xmlns=\"http://tempuri.org/\"> \
      <request xmlns:d4p1=\"http://schemas.datacontract.org/2004/07/LOServices.Proxy.Requests\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"> \
        <d4p1:AssociationNumber>3</d4p1:AssociationNumber> \
        <d4p1:IgnoreWarnings>false</d4p1:IgnoreWarnings> \
      </request> \
    </GetLoanActions> \
  </s:Body> \
</s:Envelope>";

            $.ajax({
                type: "POST",
                url: "http://localhost/LOServices/Services/LOService.svc/basic",
                data: theRequest,
                timeout: 10000,
                contentType: "text/xml",
                dataType: "xml",
                async: false
            });
        }

I’m unfortunate enough to receive a “Bad Request” from the wcf service when I run it in this fashion, however, and that doesn’t leave me with much to follow up on.

I’ve been struggling to try to make this work for at least 3 hours now, so if anyone has ideas, please feel free to jump in with some suggestions.

Thanks.

  • 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-05-23T18:35:15+00:00Added an answer on May 23, 2026 at 6:35 pm

    For BasicHttpBinding requests, you need to set the SOAPAction header in the HTTP request (that will define which operation should receive the message).

    $.ajax({
          type: "POST",
          url: "http://localhost/LOServices/Services/LOService.svc/basic",
          data: theRequest,
          timeout: 10000,
          contentType: "text/xml",
          dataType: "xml",
          async: false,
          headers: { "SOAPAction": "http://tempuri.org/Contract/Operation" }
        });
    

    Notice that the headers option is new in jQuery 1.5, so if you’re using an older one, you’ll need to use the beforeSend function for that.

    Also, you should be able to get more information in the future for errors such as “Bad Request” or “Internal Server Error” by enabling tracing for WCF – the trace will contain more detailed information about the problem.

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

Sidebar

Related Questions

I have a WCF webservice that has the following service contract [ServiceContract(Namespace = http://example.org)]
I have a self-hosted WCF service (v4 framework) that is exposed through a HttpTransport
I have a mobile app webservice client that connects to a WCF webservice(on my
I have a WCF web service using wsHttpBinding that I am consuming from a
The Problem I have a WCF webservice that I am hosting as a webservice
I have a WCF WebService that uses LINQ and EF to connect to an
I currently have a WCF service that exposes a SOAP enpoint. In this webservice
I have a WCF webservice that caters simultaneous requests from different clients. The service
I have a WCF web-service and a Silverlight app displaying data from that service.
I have to consume a WCF WebServices but the WSDL contains bindings that PHP

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.