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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:03:48+00:00 2026-05-23T05:03:48+00:00

I have the WCF service contract: [ServiceContract] public interface IVLSContentService { [OperationContract] [WebInvoke(Method =

  • 0

I have the WCF service contract:

[ServiceContract]
public interface IVLSContentService
{
    [OperationContract]
    [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Xml, UriTemplate = "GetCategoriesGET/{userIdArg}", BodyStyle = WebMessageBodyStyle.Bare)]
    List<Video> GetVideosGET(string userIdArg);

    [WebInvoke(Method = "POST",BodyStyle=WebMessageBodyStyle.Wrapped, UriTemplate = "submit")]
    [OperationContract]
    void SubmitVideoPOST(Video videoArg, string userId);
}

And I have the service that implements the contract:

public class VLSContentService : IVLSContentService
{

    List<Video> catsForUser1 = new List<Video>();
    List<Video> catsForUser2 = new List<Video>();

    public List<Video> GetVideosGET(string userIdArg)
    {
        List<Video> catsToReturn = new List<Video>();

        if (Int32.Parse(userIdArg) == 1)
        {
            catsToReturn = catsForUser1;
        }
        else if (Int32.Parse(userIdArg) == 2)
        {
            catsToReturn = catsForUser2;
        }

        return catsToReturn;
    }


    public void SubmitVideoPOST(Video videoArg, string userId)
    {
        int i = 0;
    }
}

And I have the configuration:

  <system.serviceModel>

    <services>
      <service behaviorConfiguration="VLSContentServiceBehaviour" name="VLSContentService">
        <endpoint address="" behaviorConfiguration="VLSContentServiceEndpointBehaviour" binding="webHttpBinding" contract="IVLSContentService"/>
      </service>
    </services>

    <behaviors>
      <serviceBehaviors>
        <behavior name="VLSContentServiceBehaviour">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>

      <endpointBehaviors>
        <behavior name="VLSContentServiceEndpointBehaviour">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
    </behaviors>

  </system.serviceModel>

And I am trying to call the POST WCF operation with the following client code:

static void Main(string[] args)
{
    WebChannelFactory<IVLSContentService> cs = new WebChannelFactory<IVLSContentService>(new Uri("http://localhost:52587/Api/Content/VLSContentService.svc/SubmitVideoPOST"));
    IVLSContentService client = cs.CreateChannel();

    Video videoToAdd = new Video("My First Video");

    client.SubmitVideoPOST(videoToAdd,"1");

}

But im getting this error and I cant work out why:

There was no endpoint listening at
http://localhost:52587/Api/Content/VLSContentService.svc/SubmitVideoPOST/submit
that could accept the message. This is
often caused by an incorrect address
or SOAP action. See InnerException, if
present, for more details.

I know when I browse to the GET method in a URL and I pass the correct parameters I am getting xml back but my POST method just doesnt work. Ive copied the example from pluralsight the only difference is um trying to host the service in .svc file instead of service host application…

Can anybody point me in the right direction?

  • 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-23T05:03:49+00:00Added an answer on May 23, 2026 at 5:03 am

    Looks like you have the address of the service wrong

    You should be posting to http://localhost:52587/Api/Content/VLSContentService.svc/submit

    The UriTemplate is relative to the address of the endpoint which is

    http://localhost:52587/Api/Content/VLSContentService.svc

    Change this line of code to

    WebChannelFactory cs = new WebChannelFactory(new Uri(“http://localhost:52587/Api/Content/VLSContentService.svc/”));

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

Sidebar

Related Questions

Let's say I have a WCF contract such as [ServiceContract] public interface IContract {
Suppose I have a WCF service and a method in the contract <ServiceContract()> _
I have a WCF Service exposing a single contract and operation: <ServiceContract(Namespace:=ImageSystem)> _ Public
I have a basicHttpBinding WCF service. Via the contract I expose a method that
If I need to go from this service contract: [ServiceContract(Namespace=http://api.x.com/Svc1)] public interface IService1 {
Say I have WCF service contract like this [ServiceContract(CallbackContract = typeof(ICallback1), SessionMode = SessionMode.Required)]
I have a WCF webservice that has the following service contract [ServiceContract(Namespace = http://example.org)]
I have a wcf service. The service itself (class that inherits the ServiceContract )
How many ServiceContracts can a WCF service have? Specifically, since a ServiceContract is an
I have a WCF service implemented with a call back contract that I am

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.