GREENBAUM, J.
The demurrer to the alleged counterclaim set forth in paragraphs “eleventh” to “seventeenth” (both inclusive) of the answer of the defendant, Charles' Ward Hall, seems to me to be well founded. The defendant, in his counterclaim, alleges that plaintiff stipulated in its contract for the installation of the elevators which form the subject-matter of the controversy between the parties to defend at its own costs and expenses all suits that might be instituted against the defendants, or either of them, for an infringement of any patent or patents by reason of the use of any apparatus, mechanism, or device furnished or employed by the plaintiff in the installation of said elevators, and to pay any recovery that might be had in said suits; that four separate suits now pending and at issue and unsettled have been brought against the defendant “to recover damages for alleged infringements consisting in the use of certain machinery, apparatus and devices furnished and used by plaintiff in the installation or part installation of said elevators.” There is no allegation of any request of plaintiff to defend said suits, nor of a refusal to defend, nor does the defendant allege that said suits are not being defended by plaintiff, nor that he has as yet incurred or been put to any expense in or about said suits. It requires no citation of authorities for the proposition that a counterclaim, to be available, must set forth a present, subsisting cause of action against the plaintiff in favor of the defendant. The attempted counterclaim clearly states no cause of action, and is premature.
Defendant, however, challenges the sufficiency of plaintiff’s complaint because of its failure to allege that the plaintiff, a foreign corporation, was authorized to transact business in this state pursuant to the' statutes thereto applicable, and relies upon Welsbach v. Norwich Gas & Elec. Co., 96 App. Div. 52, 89 N. Y. Supp. 284, in support of his contention. Before considering the effect of that case, it may be well to bear in mind that on demurrer to an answer for insufficiency an attack upon the complaint may be made because of its failure to state facts sufficient to constitute a cause of action. Baxter v. McDonnell, 154 N. Y. 436, 48 N. E. 816, citing People, etc., v. Booth, 32 N. Y. 397, and other cases. The infirmity in the complaint must be one of substance. “A demurrer searches the record for the first fault in pleading, and reaches back to con*38demn the first pleading that is defective in substance, because he who does not so plead as to invite an issue cannot compel his adversary to so plead as to accept it.” Baxter v. McDonnell, supra. It must therefore follow that, if the attack upon plaintiff’s complaint does not go to the substance of plaintiff’s claim, it cannot be successfully made. In Williams v. Williams (Sup.) 12 N. Y. Supp. 599, 560, it was expressly held, where demurrers were interposed to certain defenses, that the complaint could not be successful^ assailed because of defect of parties, for the reason that the defendant will be deemed to have waived the defect unless he raised it upon demurrer, where it was apparent upon the face of the complaint, or by answer if not' apparent. The rule was also recognized in that case that the cause of action “must be considered with regard to its sufficiency.” A failure to demur to a complaint, where it appears upon the face thereof that the plaintiff has not legal capacity to sue, is deemed a waiver of that objection. Section 499, Code Civ. Proc. Recurring now to the case of Welsbach Co. v. Norwich Gas. & Elec. Co., supra, we find that the defendant there demurred to the complaint upon two grounds: “First, that the plaintiff has not legal capacity to sue; second, that the complaint does not state facts sufficient to constitute a cause of action.” The decision, by a divided court, does not show which of the demurrers was sustained. If the demurrer was upheld because of plaintiff’s legal incapacity to sue, then it would not avail the defendant here, because he failed to interpose any demurrer to the complaint in that respect, and he must therefore be deemed to have waived this objection. If the demurrer was deemed well taken because of the insufficiency of the complaint, then the defendant must here prevail, because the complaint in the present case is quite analogous to that appearing in the Welsbach Co. Case, and it would therefore be subject to the same criticism. It seems to me, however, that the Welsbach Co. Case can only be reconciled with the case of C. R. Parmele Co. v. Haas, 171 N. Y. 579, 64 N. E. 440, if it is limited to holding that a complaint by a foreign stock corporation upon a contract made in the state of New York, which fails to allege a compliance with the statute authorizing it to do business in this state, is demurrable upon the ground that the plaintiff has not the legal capacity to sue; but I do not think, in view of the utterances of the Court of Appeals in the Parmele Co. Case, supra, that the Welsbach Case should be recognized as an authority that a complaint of the character described is demurrable because it fails to state facts sufficient to constitute a cause of action. The general corporation law in force when the Welsbach Case arose, and still in force, is somewhat different in scope from the law in effect when the Parmele Case arose, but much of the reasoning expressed in that case is peculiarly applicable to the present discussion. Referring to the statutory regulations affecting the control of the business of foreign corporations in the state and their right to' sue, the Court of Appeals says (page 583, 171 N. Y., page 440, 64 N. E.) : “When a foreign corporation brings a suit in the courts of this state, and states a good cause of action in the complaint, it will be assumed that it is rightfully in *39the state, and properly in court, until the contrary is made to appear. The question is one merely of pleading or procedure, and it does not go to the substance of the plaintiffs claim.” Further on the court say's: “The objection at most is one as to the character or capacity of the plaintiff to sue. That objection, if the defect appears upon the face of the complaint, must be taken by demurrer. Code, § 488. If it does not appear upon the face of the complaint, it may be taken by answer (Code, § 498), and, if not taken either by demurrer or answer, is deemed to- have been waived (Code, § 499).” In view of these explicit utterances of the Court of Appeals, I am constrained to hold that the Welsbach Case must be restricted in its effect, as already indicated.
As the substance of the complaint cannot be successfully attacked, and as the defenses to which the demurrer has been interposed are clearly insufficient, the demurrer must be sustained, with costs, with leave to defendant to plead anew, if he so elects, upon the payment of costs.