Encapsulate WadlClient in a closure function.