Where the defendant is a foreign corporation having an agent in this state, the service may be upon the agent.