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

  • Home
  • SEARCH
  • 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 8887739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:53:04+00:00 2026-06-14T21:53:04+00:00

I have a simple WCF service with the following interface: [ServiceContract] public interface IPageService

  • 0

I have a simple WCF service with the following interface:

[ServiceContract]
public interface IPageService {

    [OperationContract]
    [WebGet(UriTemplate = "/GetPage/{pageNumber}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
    Page GetPage(string pageNumber);

    [OperationContract]
    [WebInvoke(UriTemplate = "/SetPages", Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
    string SetPages(Page[] pages);
}

The system.serviceModel section of the config file is as follows:

<system.serviceModel>
  <protocolMapping>
    <add scheme="http" binding="webHttpBinding"/>
  </protocolMapping>
  <behaviors>
    <serviceBehaviors>
      <behavior>
        <serviceMetadata httpGetEnabled="true"/>
        <serviceDebug includeExceptionDetailInFaults="true"/>
      </behavior>
    </serviceBehaviors>
    <endpointBehaviors>
      <behavior>
        <webHttp/>
      </behavior>
    </endpointBehaviors>
  </behaviors>
  <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>

Using the following JavaScript to call the GetPage method works:

$.ajax({
    cache: false,
    url: 'http://localhost/Test/PageService.svc/GetPage/1', 
    type: 'GET',
    success: function(result) {
        // do success stuff 
    }, 
    error: function(req, status, error) { 
        // do error stuff
    } 
});

Using the following JavaScript to call the SetPages method returns a 404 error:

$.ajax({
    cache: false,
    url: 'http://localhost/Test/PageService.svc/SavePages', 
    type: 'POST',
    data: '[{...}]', 
    dateType: 'json',
    contentType: 'application/json',
    processData: false,
    success: function(result) { 
        // do success stuff 
    }, 
    error: function(req, status, error) { 
        // do error stuff 
    } 
});

I’ve tried almost every combination of parameters in the ajax call already and nothing makes a difference. I’ve played around with the config file and tried various configurations suggested here and in various blogs but all that does is make both methods return AddressFilter or ContractFilter mismatches. What am I missing? What is the quickest/easiest way to get both these methods working?

  • 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-14T21:53:05+00:00Added an answer on June 14, 2026 at 9:53 pm

    According to the code you posted, jscript calls the SavePages method but in the server side the post method has name SetPages.

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

Sidebar

Related Questions

I have a simple WCF logging service.. namespace WCFServiceLibrary { [ServiceContract] public interface ILog
I have a simple WCF service method: [OperationContract] public SetupGameResult SetupGame(long player1Id, long player2Id,
I have a WCF-REST service with one method which returns a string: [ServiceContract] public
I have created a very simple WCF service, hosted on windows service, closely following
I have simple WCF Service Service1 with the following config: <behaviors> <serviceBehaviors> <behavior name=SecuredBehavior>
I have created a simple WCF service by following a MSDN tutorial. I successfully
I have the following problem, my WCF service is pretty simple, send some entities
I have a simple WCF service hosted in IIS7 using the HTTP protocol. The
We have a simple WCF service that is tagged with InstanceContextMode = Single and
I have a very simple WCF service running that has a single method that

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.