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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:25:59+00:00 2026-05-15T09:25:59+00:00

I created a WCF SOAP service using VS 2008 that works server side. I

  • 0

I created a WCF SOAP service using VS 2008 that works server side. I tacked on the code below to call the same service/contract client side using jQuery/json (no ASP.NET scriptmanager). When I put the service url into the browser, I get the correct service page and when I invoke the service from javascript and trace via Firebug, I get “405 method not allowed”.

The ajax() error function’s statusText and and responseText contain nothing and the error function gets called twice for some strange reason. I’m also invoking the service from an https page.

The same ajax code works with a similar traditional webservice both server side and client side and also works with a page method.

Any clues? I also noticed my Windows Communication Foundation HTTP Activation and Non-HTTP Activation are not installed. Do I need these? My server side WCF service works though.

Interface:

[ServiceContract]
public interface ICust
{
    [OperationContract]
    [WebInvoke(Method = "POST", 
        BodyStyle = WebMessageBodyStyle.Wrapped, 
        ResponseFormat = WebMessageFormat.Json,
        RequestFormat = WebMessageFormat.Json)]
    bool GetCust(string zzz);
}

Class:

public class Cust: ICust
{
    public bool GetCust(string zzz)
    {
        // Do Stuff
        // Return true/false; 
    }
 }

web.config:

<behaviors>
    <serviceBehaviors>
        <behavior name="E.W.CustomerBehavior" >
            <serviceMetadata httpGetEnabled="true" />
        </behavior>
    </serviceBehaviors>
    <endpointBehaviors>
        <behavior name="webCallable">
            <webHttp />
        </behavior>            
    </endpointBehaviors>
</behaviors>

<services>
    <service behaviorConfiguration="E.W.CustomerBehavior"
        name="E.W.Customer">
        <endpoint address="http://zzzz/Cust.svc" 
            binding="webHttpBinding" 
            contract="E.W.ICust" 
            behaviorConfiguration="webCallable">
            <identity>
                <dns value="localhost" />
            </identity>
        </endpoint>
        <endpoint address="mex" 
            binding="mexHttpBinding" 
            contract="IMetadataExchange" />
    </service>
</services>

jQuery:

$.ajax({
    cache: false,
    async: false,
    type: "POST",
    url: "http://zzzz/Cust.svc/GetCust",
    contentType: "application/json",
    dataType: "json",
    data: "{'zzz': '" + $("#ctl00_zz_zzz").val() + "'}",
    success: function(msg) {
        // do stuff
    },
    error: function(z) { alert(z.responseText); }
});
  • 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-15T09:25:59+00:00Added an answer on May 15, 2026 at 9:25 am

    The problem was https. The page from which the service was invoked was https, thus the “method not allowed”.

    I changed the web.config and javascript file to invoke the service using https and it worked.

    This helped me out.

    Now I am seeing why people are saying WCF is more work up front.

    I installed Windows Communication Foundation HTTP Activation and Non-HTTP Activation, which has nothing to do with my issue, but I’m still not clear on what they are.

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

Sidebar

Related Questions

i created a WCf service with a method that can receive GET requests using
I am using a wcf service that I created, when both hosting machine and
I created a WCF service that has a method which makes a call to
I have a call to a SOAP WCF Service that returns a lot of
I’ve just created a WCF service/client and it all works fine when running on
I've created a .NET WCF service that is intended to always be over HTTPS.
I have created a basic WCF service in IIS. I am aware that this
I'm creating a WCF service that transfers entity objects created via entity framework. I
Created .NET WCF service, tested it - works. Generated schemas from Data and service
I created a WCF REST (aka WebHttp) service in .NET 4, using Microsoft's WCF

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.