No, this won't work
The method for readying an action is that you use your action to hold the spell at the ready (pre-casting it), then use your reaction to cast it when a given trigger occurs.
But here's the catch (PHB, p. 193):
When the trigger occurs, you can either take your reaction right after the trigger finishes or ignore the trigger. Remember that you can take only one reaction per round.
If you have readied a spell to cast if a dragon uses its breath weapon, the only time you may unleash the spell is after the dragon has used its breath weapon and the outcome of that has been resolved (finished). Meaning you will cast Wall of Stone after the dragon uses its breath weapon, and thus after you've already saved/taken damage from it.
Yes
Ready action requires (emphasis mine):
First, you decide what perceivable circumstance will trigger your reaction. Then, you choose the action you will take in response to that trigger, or you choose to move up to your speed in response to it.
The general rule is 1 Action per turn, but then specific rules can override that (e.g. Action Surge, Haste, etc.). I believe that Ready is another specific rule that overrides this as well because while you are using your Action to Ready, what you are really doing is using your Reaction to move your Action to another time.
Attack vs. attack (or does action have a meaning here?)
Upper case and lower case a have a meaning in the PHB, with the former being the Action described under Actions in Combat in the PHB.
When Ready asks you to choose your action, you use the actions listed there. The cases described in the PHB are "Use an Object" and "Movement" for the Ready (since you can only do one.)
In the case of this question, the Action that is being taken is Attack.
Attack Action on your turn
If you take the Attack action on your turn, then it comes with all the fun stuff that happen on your turn. This includes Extra Attack (which typically doesn't happen on a Ready whose trigger occurs NOT on your turn.)
In contrast, you can look at another reaction: Opportunity Attack. In this instance, the language does not say to take an action but to simply make a melee weapon attack. The difference is in the use of Action in the phrasing for Ready.
Actions vs attacks
The language in Ready is to choose the action. Actions are a defined term in the rules under Combat->Actions in Combat.
At other times, there is other language used when specifying melee/ranged/melee weapon/ranged weapon attacks. The language in Ready does not say to Ready an attack (lowercase a), it says to ready an action.
There are also several referenced examples of Ready Action and Extra Attack/Multiattack that reference the On your turn as the important qualifier. Had they not intended a Ready attack to be the Attack Action, then the discussion would have ended there and not referenced the turn requirements.
There are also other specific examples of more than one action on a turn that override that general rule: Cunning Action, Haste, Action Surge, etc.
The action choice intent (emphasis mine) is also provided by Crawford:
The Ready action lets you ready any action you can take, including Attack, but Extra Attack is on your turn.
Not only has he clearly stated that you take an Action, and that Action can be Attack (uppercase A), but that Extra Attack only functions on your turn.
Best Answer
No - targeting is not perceivable by the characters in-game
Targeting is something that only occurs outside the fiction of the game. To qualify as a trigger it must be observable by the character in the game.
When the dragon you are fighting rushes forward and starts to breath fire, how do you know who it is targeting? You don't. You can try to guess, but the fact that you have to guess means that it is not observable.
Though you did not ask about them, it is worth pointing out that the targeting of spells is even less observable and more clearly not a valid trigger: Can the target of a spell be identified before the spell is cast?
Targeting is a mechanic, is not observable and is thus not a valid trigger.
Triggers must be phrased in terms of what a character can see/hear/perceive
If I set my readied action as "I cast this spell if anybody targets me with an attack" this has a major issue. Because it is not phrased in terms of what my character can actually perceive, it could technically trigger off of things my character could not possibly be aware of. For example, with the above trigger if an invisible archer who I was not previously aware of shoots an arrow at me, my readied action would technically trigger.
Obviously, the DM in this case could (and should) just rule that the readied action did not apply. But the whole situation arose because the trigger that was set was not phrased to be based on what the character could perceive and thus should not have been allowed in the first place. Fortunately, there is an easy fix for this.
When my players use a trigger says "targeting" I clear it up very easily by asking them to rephrase it in terms of what the character is looking/listening for. For example, "when the archer targets me with an attack" becomes "when the archer points her bow at me". Thus an invalid trigger becomes a valid one extremely easily. It just has to be phrased in terms that the character can actually perceive.
Jeremy Crawford has commented on a similar situation:
A "turn" is another mechanical concept which is also not perceivable by the characters. Jeremy Crawford correctly points out here that it is not a valid trigger for that reason.