How to create code for a web service client from a WSDL URL

Wouldn’t be nice to have a tool to create web service client code automatically? Web services already provide WSDL files to provide guidance about their offerings. We just need a tool to understand these files automatically and create all the code we need to consume them.

The tool we have been looking for is WSDL to Proxy Class Tool. It generates proxy code to be used as a web service client based on the WSDL file you provide.

How to set up IIS FTP for both internal and external users?

You can create FTP sites under IIS so that your users can perform file operations by using FTP clients. One IIS FTP site is normally sufficient for most companies. However, you may need some extra configuration to allow both external and internal users to access this site.

If you are fine with creating two FTP sites, you can create one for internal users and one for external users. The difference would be setting “External IP Address of Firewall” field for the external site.

OutOfMemoryException caused by StringBuilder

If your web application is crashing with OutOfMemoryException, check Event Viewer for more details. In the stack trace, you should see which function is throwing this exception. In my case, a variable in StringBuilder type was the root cause.

Which time zone IIS logs are recorded in?

IIS logs are helpful in troubleshooting various web application issues. However, they may mislead server administrators by showing the logs in a time zone different than what the server uses. This is because IIS uses UTC time zone by default.

AD connection and query by using PrincipalContext

There are different ways of getting data from Active Directory. One of them is that using PrincipalContext class which is a member of System.DirectoryServices namespace (Reference).

Here is a code sample to connect to Active Directory and query a user by using PrincipalContext.

Kerberos ticket lifetime and renewal time

I have recently worked on a case where questions about increasing the Kerberos ticket lifetime came up. Long story short: There are security concerns about increasing the lifetime of Kerberos tickets. Details are below.

(Solved) 403.16 Forbidden: Client certificate is untrusted or invalid

A browser displays 4xx error when there is a client side issue while accessing a website. Specifically, 403 error translates into “Forbidden“. If you dive deep in the issue (Failed Request Logs or IIS logs), you may see 16 as a sub-status code which refers to “Client certificate is untrusted or invalid” (Reference).

You will find out about how to solve 403.16 error in this post.