How can the error ‘Client found response content type of ‘text/html’.. be interpreted

This is happening because there is an unhandled exception in your Web service, and the .NET runtime is spitting out its HTML yellow screen of death server error/exception dump page, instead of XML. Since the consumer of your Web service was expecting a text/xml header and instead got text/html, it throws that error. You should … Read more

Examples of Repository Pattern with consuming an external REST web service via HttpClient?

A simple example: // You need interface to keep your repository usage abstracted // from concrete implementation as this is the whole point of // repository pattern. public interface IUserRepository { Task<User> GetUserAsync(int userId); } public class UserRepository : IUserRepository { private static string baseUrl = “https://example.com/api/” public async Task<User> GetUserAsync(int userId) { var userJson … Read more

HTTPS from a console application?

Create and install a root authority and HTTPS certificate Open command prompt as Administrator: Create folder C:\Certs and navigate to it. #Root Authority makecert.exe -r -pe -n “CN=My Root Authority” -ss CA -sr LocalMachine -a sha1 -sky signature -cy authority -sv CA.pvk CA.cer #Certificate makecert.exe -pe -n “CN=localhost” -a sha1 -sky exchange -eku 1.3.6.1.5.5.7.3.1 -ic … Read more

Importing xsd into wsdl

You have a couple of problems here. First, the XSD has an issue where an element is both named or referenced; in your case should be referenced. Change: <xsd:element name=”stock” ref=”Stock” minOccurs=”1″ maxOccurs=”unbounded”/> To: <xsd:element name=”stock” type=”Stock” minOccurs=”1″ maxOccurs=”unbounded”/> And: Remove the declaration of the global element Stock Create a complex type declaration for a … Read more

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