Visas have to be applied for prior to entry at the German mission abroad covering the place of residence of the applicant.
Please find more information on the webpage of the competent German mission.
The decision on granting a visitor/business visa lies with the competent German mission abroad. The mission also decides on granting visas for longer stays and/or to take up work or studies. These, however, can in most cases only be issued with the approval of the aliens authority concerned.
If a visa application is rejected, the applicant has the option of writing to the visa department of the competent German mission abroad asking for the reasons leading to the rejection of your application (known as remonstration). Please note that you have to submit the remonstration yourself.
German missions abroad: Countries A to Z