A solitary American soldier is pinned down in an Iraqi wasteland by a sadistic—or perhaps merely methodical—enemy sniper in Doug Liman’s “The Wall,” a minimalist military survival story that comes across largely as a technical exercise, though admittedly an efficiently manufactured one, with an ending that will probably confound audience expectations.

The film opens in 2007 with two camouflaged American soldiers—Staff Sergeant Shane Matthews (John Cena) and Sergeant Allen Isaac (Aaron Taylor-Johnson), his spotter, hunkered down on a brushy hillside, warily observing a stretch of oil pipeline where a construction crew have been ambushed and killed. The two have been there for hours, assessing whether whoever shot the men is still hidden somewhere amid the surrounding equipment, waiting for them to abandon their safe position and come down to the pipeline, where they would be easy targets.

Matthews finally tires of delay and, convinced that the ambushers have left, goes to investigate the site. It quickly becomes apparent that all the crew members were shot in the head by a sniper, and before he can escape, he’s shot as well. When Isaac unwisely rushes down from his perch to help, he’s also wounded and takes refuge behind the remnants of was once the stone wall of a building. He tries to call for a rescue team, but finds that his radio is broken, and though he manages—with great pain—to remove the bullet from his leg, his situation seems hopeless, until messages, apparently from the American base camp, come flickering through.

They turn out instead to be from the Iraqi shooter (voiced by Laith Nakli), who just might be the notorious sniper the American soldiers call Juba. Eventually dropping the pretense of being American, the sniper alternately taunts Isaac and engages in pseudo-friendly conversation with him, insisting that he just wants to get to know him better. Unsurprisingly, his questioning will eventually force the American into making admissions about his feelings of guilt while revealing little about himself; his actual goal, of course, is to get the American to reveal precisely where he is. Isaac, meanwhile, does whatever he can to pinpoint the sniper’s location and take offensive action against him. He’s helped in that effort by Matthews, who turns out not to be dead after all, and eventually by a medical extraction team.

How things turn out won’t be revealed here, but Liman and Taylor-Johnson prove adept in keeping the tension level high despite the fact that the premise is more than a little farfetched and writer Dwain Worrell has to keep coming up with twists, not always entirely plausible, to maintain momentum. That’s evident from the very first, in the opening banter between Matthews and Isaac that morphs into the initial sniper attack and Isaac’s predicament. The element that strains credibility most, of course, is not just that the two riflemen make contact over the radio, but the content of their conversation. Isaac’s gradual unburdening of his deepest regrets about his military service has the feel of dramatic contrivance rather than authentic human interaction; one can imagine it being performed as a two-character play—the sort that that rarely translates well to the screen.

And yet Liman and cinematographer Roman Vasyanov, shooting in the California desert, fashion a convincing locale for the action, and Taylor-Johnson brings both grit and a palpable sense of vulnerability to what quickly becomes a one-man show, very different from his turns as both the goofy teen in the “Kick-Ass” movies or the malignant thug of “Nocturnal Animals” (not to mention his elegant Vronsky in “Anna Karenina”). Cena brings his beefy macho quality to Matthews, and Nakli’s vocal contributions are cannily right.

“The Wall” will inevitably be compared with Clint Eastwood’s “American Sniper,” but it’s obviously a much more concentrated piece, without the expansiveness of that film, and has a very different emotional core. Though told on limited canvas, however, it gives Liman the opportunity to exhibit the same skill at action choreography that he showed on a larger one in pictures like “The Bourne Identity.” If it ends up feeling more like a test of his craftsmanship than a deeply felt human drama, it shows at least that he hasn’t lost his touch.