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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:42:26+00:00 2026-05-31T20:42:26+00:00

I have a WCF Service that return a json. I want to test it

  • 0

I have a WCF Service that return a json. I want to test it using Fiddle (this is the application that is used in the tutorial i was following). The problem is that i get HTTP 404 error when invoking “AddAngajat” for example.

Implementation of the service :

[ServiceBehavior(InstanceContextMode=InstanceContextMode.Single, AddressFilterMode=AddressFilterMode.Any)]
    public class AngajatService : InterfaceAngajat
    {
        List<Angajat> listaAngajati =null;

        public AngajatService()
        {
            if (listaAngajati == null)
                listaAngajati = new List<Angajat>();
        }

        [WebInvoke(Method="POST", UriTemplate = "AddAngajat", ResponseFormat=WebMessageFormat.Json)]
        public void AddAngajat(Angajat angajat)
        {
            listaAngajati.Add(angajat);
        }
        public Angajat[] GetAllAngajati()
        {
            listaAngajati.Add(new Angajat() { idAngajat = "2f34", nume = "nume1" });
            return listaAngajati.ToArray();
        }
    }

App.config :

 <?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0"/>
  </system.web>
  <system.serviceModel>
    <services>
      <service name="testJSON.AngajatService">
        <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
          contract="IMetadataExchange" />
        <endpoint address="json" behaviorConfiguration="JSONEndpointBehavior"
          binding="webHttpBinding" bindingConfiguration="" contract="testJSON.InterfaceAngajat" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost/testJSON/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <endpointBehaviors>
        <behavior name="JSONEndpointBehavior">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
</configuration>

Any idea on how to fix this ? Other way of testing it ?

  • 1 1 Answer
  • 1 View
  • 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-31T20:42:27+00:00Added an answer on May 31, 2026 at 8:42 pm

    You need to call http://localhost:8732/testJSON/json/AddAngajat and it should work.

    Otherwise include your client code (or a snippet).

    UPDATE

    With the changes you mentioned, URL must be this http://localhost/testJSON/Service.svc/json/AddAngajat

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

Sidebar

Related Questions

I have a WCF rest service using webHttpBinding that returns JSON result. The problem
I have a RESTful WCF service that can return XML, JSON, or JSONP, depending
I have WCF service that return Json. Data contract defined below [DataContract] public class
I have a WCF service that is deployed on a machine. This WCF service
I am having the following problem: I have a WCF service that checks a
I have a WCF service that has methods to return IEnumerable<T> collections of objects,
I have created an Ajax enabled WCF web service that contains this simple method:
I've been trying to do a simple restful wcf service that will return JSON.
I have the following code in a WCF Service that returns a string, and
My AJAX-enabled WCF service returns JSON using this contract, [DataContract] public class JQGridContract {

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.