HttpClient with BaseAddress

In the BaseAddress, just include the final slash: https://localhost:44302/AndonService.svc/. If you don’t, the final part of the path is discarded, because it’s not considered to be a “directory”. This sample code illustrates the difference: // No final slash var baseUri = new Uri(“https://localhost:44302/AndonService.svc”); var uri = new Uri(baseUri, “Layouts/1100-00277”); Console.WriteLine(uri); // Prints “https://localhost:44302/Layouts/1100-00277” // With … Read more

How to convert “string” to “timestamp without time zone”

String representation of a timestamp (= timestamp without time zone) depends on your locale settings. Therefore, to avoid ambiguities leading to data errors or Postgres coughing up an exception, you have two options: 1.) Use ISO 8601 format, which works the same with any locale or DateStyle setting: ‘2013-08-20 14:52:49’ You may have to cast … Read more

User/Pass Authentication using RESTful WCF & Windows Forms

Well, I don’t have any experience with the REST capabilities of WCF, but I did wrestle a lot with understanding the implications of security choices in my WCF security question. As you’ve noticed, there’s a real lack of documentation on WCF out their on the Web, and my REST experience is limited, so take my … Read more

DataContract and inheritance?

Yes, that would work. The DataContractAttribute has Inherited set to false, so it is necessary to apply the attribute to both the child class and the parent class (as you have done in the question). You would need to use the KnownType attribute if you want to use your data contracts with polymorphism. For example … Read more

Svcutil.exe for .NET 4.0?

I had the same issue. If your project is set to use the .NET 4.0 Framework, you must choose the right version of SvcUtil.exe, or it will throw an error: “Could not load…” If you look in “Microsoft SDKs\Windows\v6.0A\Bin”, you will see that the version of that exe is “3.0.4506.2152”. The version of SvcUtil.exe in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)