Military personnel have some legal protections from divorce proceedings, provided by Congress, not granted to public at large. Under the Servicemembers Civil Relief Act, 50 UCS section 521, Congress has acted to given protect the legal interests of servicemen and women from lawsuits including divorce proceedings to enable them "to devote their entire energy to the military needs of the nation."
In the discretion of the court, the legal proceeding may be delayed for the time the service member is on active duty and for 60 days thereafter. This also prevents the active duty serviceperson from being held in "default" in some circumstances for not responding to the divorce proceeding. If a party is in the military, the court may appoint an attorney to represent the serviceperson, but only for the default proceedings and not for the divorce action itself.
If served with divorce papers while on active duty, you must make sure the court is aware that you are on active duty. You should be aware that the stay for the divorce proceeding is discretionary with the court. You may have to hire an attorney to make the motion to the court to delay the hearing. Sooner or later, even if a stay is granted, you will have to deal with the divorce proceedings.
Furthermore, if a divorce between you and your spouse is inevitable, it may be in your best interest to obtain the divorce as soon as possible. For instance, the portion of your military retirement that your spouse could claim will only increase with time.