line of service

The more usual expression, with the same meaning, is

in the line of duty PHRASE

If you do something or if it happens to you in the line of duty, you do it or it happens as part of your regular work or as a result of it.

[Collins CoBuild]

Here, 'in the line of service' connotes also

in the line of fire. PHRASE

1 in a position where you will be hurt if someone shoots a gun [thus, on the front line in a war situation]

[Macmillan]

This connotation adds an element of danger to the phrase here, 'in the line of service'.

Though 'in the line of service' is not readily found in dictionaries, the sense of 'service' here is best defined by eg Collins CoBuild:

service [sense 10] [uncountable noun]

Service is the work done by people or equipment in the army, navy, or air force, for example during a war.

The regiment was recruited from the Highlands specifically for service in India.

...an aircraft carrier that saw service in World War II.

[on active service]