When animating a character, how do you attach a weapon with the soldier animation, firing strafing running etc
you don't... a weapon becomes part of the hand in mixamo which only really works well for a sword
even the shield character had to be made special but the real issue is that weapons i.e, guns or other props should be added as part of whatever machinima you are using: Unity, Unreal, Iclone etc
There are multiple ways you can add it, depending on which software you're using the animation data with.
An easy way is to use the hand/wrist joint on the grip/trigger hand. Usually, this will line up with the other hand (with slight changes to orientation) pretty easily. You shouldn't need to constrain values to make it match.
I find that starting with some placeholder geometry as a child of a Null Object (something like a simple cube) works well for setting up any custom alignment - - make all of the changes at the Null level. When things look good, swap out the placeholder geometry with your final geometry.
Usually not a great idea to add the additional geometry to your animation solve (the extra geometry may look like a body part).
What's the 3D software you use?