Post an empty body to REST API via HttpClient
Use StringContent or ObjectContent which derive from HttpContent or you can use null as HttpContent: var response = await client.PostAsync(requestUri, null);
Use StringContent or ObjectContent which derive from HttpContent or you can use null as HttpContent: var response = await client.PostAsync(requestUri, null);
Unfortunately the link in the exception text, http://go.microsoft.com/fwlink/?LinkId=70353, is broken. However, it used to lead to http://msdn.microsoft.com/en-us/library/ms733768.aspx which explains how to set the permissions. It basically informs you to use the following command: netsh http add urlacl url=http://+:80/MyUri user=DOMAIN\user You can get more help on the details using the help of netsh For example: netsh … Read more
Are you able to distill this to a small code sample that reproduces the problem? What version of EF are you using? Here are a few observations based on the information you’ve given so far. EF Async Anything less than EF 6 is always synchronous. With EF 6 you have the option to use async … Read more
Seemed to be a no brainer; the WCF service should be enabled using Programs and Features -> Turn Windows features on or off in the Control Panel. Go to .NET Framework Advanced Services -> WCF Services and enable HTTP Activation as described in this blog post on mdsn. From the command prompt (as admin), you … Read more
Change the return type of your GetResults to be List<Person>. Eliminate the code that you use to serialize the List to a json string – WCF does this for you automatically. Using your definition for the Person class, this code works for me: public List<Person> GetPlayers() { List<Person> players = new List<Person>(); players.Add(new Person { … Read more
DataContractAttribute Class is in the System.Runtime.Serialization namespace. You should add a reference to System.Runtime.Serialization.dll. That assembly isn’t referenced by default though. To add the reference to your project you have to go to References -> Add Reference in the Solution Explorer and add an assembly reference manually.
More specifically: Run Server Manager (on task bar and start menu) Choose the server to administer (probably local server) Scroll down to “Roles and Features” section. Choose “Add Role or Feature” from Tasks drop down On “Add Role or Feature Wizard” dialog, click down to “Features” in list of pages on the left. Expand “.Net … Read more
Use the static method Guid.NewGuid() instead of calling the default constructor. var responseObject = proxy.CallService(new RequestObject { Data = “misc. data”, Guid = Guid.NewGuid() });
Try adding message credentials on your app.config like: <bindings> <basicHttpBinding> <binding name=”defaultBasicHttpBinding”> <security mode=”Transport”> <transport clientCredentialType=”None” proxyCredentialType=”None” realm=””/> <message clientCredentialType=”Certificate” algorithmSuite=”Default” /> </security> </binding> </basicHttpBinding> </bindings>
Right click on solution –> Properties Look under Common Properties –> Startup Project Select multiple startup projects select Start action on the projects you need to debug.