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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:04:45+00:00 2026-05-16T20:04:45+00:00

Can anyone spot what is wrong with my code? I’m getting a 404 Not

  • 0

Can anyone spot what is wrong with my code? I’m getting a 404 Not Found on firebug when i use jQuery to call a WCF SOAP service.

I’m on Win7 using IIS7. I have the wcf running on a virtual directory application as (http://localhost/csw). I can access the service.svc file with no problem here at this url: (http://localhost/csw/service.svc)

Here is my Web.config between the configuration tags

<configuration>
<system.web>
    <compilation debug="true" targetFramework="4.0"/>
</system.web>
<system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name ="soapBinding">
      <security mode="None">
      </security>
    </binding>
  </basicHttpBinding>
</bindings>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    <services>
        <service name="CatalogService" behaviorConfiguration="defaultBehavior">  
    <endpoint address="soap"
              binding="basicHttpBinding"
              bindingConfiguration="soapBinding"
              contract="ICatalogService" />
        </service>
    </services>
    <behaviors>
        <endpointBehaviors>
            <behavior name="xmlBehavior">
                <webHttp/>
            </behavior>
        </endpointBehaviors>
        <serviceBehaviors>    
            <behavior name="defaultBehavior">
                <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
                <serviceMetadata httpGetEnabled="true"/>
                <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
                <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>
</system.serviceModel>
<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

App_Code/ICatalogServices.cs:

[ServiceContract(Namespace = "http://test/CatalogService")] public interface ICatalogService {
[WebInvoke(Method = "POST",
             BodyStyle = WebMessageBodyStyle.Wrapped,
             ResponseFormat = WebMessageFormat.Xml,
             RequestFormat = WebMessageFormat.Xml)]
string HelloWorld(string name);}

App_Code/CatalogServices.cs:

public class CatalogService : ICatalogService{
public string HelloWorld(string name){
    return String.Format("Hello {0}", name);}}

jQuery call:

    $.ajax({
    type: 'POST',
    url: 'http://localhost/csw/service.svc/HelloWorld',
    data: request,
    contentType: 'application/xml; charset=utf-8',
    dataType: 'xml',
    success: function (result) {
        console.log(result);

        $("#result").text(result);
        //result.responseXML
        //result.responseText
    },
    error: function (message) {
        console.log(message);
        alert("error has occured" + message);
    }
});

my request xml is:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">  <s:Body>  <HelloWorld xmlns="http://test/CatalogService">  <name>CarlosK</name>  </HelloWorld>  </s:Body>  </s:Envelope>
  • 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-16T20:04:45+00:00Added an answer on May 16, 2026 at 8:04 pm

    URL in your jQuery code is wrong. Try to use http://localhost/csw/service.svc/soap. Also change content type to text/xml; charset=utf-8

    Edit:

    Address: The operation name is not part of URL when calling SOAP service. (in contrast to REST services). Also in your configuration you have defined relative address for SOAP endpoint. Valid URL is BaseAddress + /service.svc + /RelativeAddress. Based address is defined by your virtual directory.

    Content Type: You are exposing the service on BasicHttpBinding. BasicHttpBinding uses SOAP 1.1. Correct content type for SOAP 1.1 is text/xml and charset.

    Edit for new error:

    The new error says that it can’t route empty action to operation in your service. You have to add SOAPAction HTTP header to your request build by jQuery. Value for the header should be http://test/CatalogService/ICatalogService/HelloWorld

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

Sidebar

Related Questions

Can anyone spot where I might be going wrong with the following code? <?php
Can anyone spot what is wrong with this URL rewrite? I can't get it
Can anyone tell me why this code would not be working? $('body').on('test', function() {
Can anyone help me spot the problem on this PLEASE? I'm eternally grateful for
Can anyone spot why my form always fails the validation? The validation doesn't output
Can anyone let me know how can we change the value of kendo combobox
Can anyone enlighten me to a way I can Highlight the content of an
Can anyone explain to me why this program: for(float i = -1; i <
Can anyone help - this is driving me mad. I am calling a mysql
Can anyone explain why here a = [] ? 1 : 2 a will

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.