There are few specific rules about casting spells in a melee environment. As to whether or not it is possible - yes, it is. Keep in mind things like the blast radius (Elemental Ball). An applicable rule that may apply is:
Casting Spells in Combat (This is a different rule than what you'll find below)
What happens when a character is in the middle of casting a spell and is hit and takes damage? If the spell being cast will be completed on the round that the character takes damage, then
he completes it without a problem. If the spell takes multiple rounds, and this is not the final round of the casting, then the spell is lost, but the character does not lose the Power Points
used by the spell.
For the other questions you ask, I treat the Elemental Bolt and Elemental Ball spells as equivalent to a missile attack.
Key rules that apply (rewritten for spellcasting)
Casting Elemental Attacks in Melee -
Characters using elemental attacks while in melee combat are at a distinct disadvantage, as a foe may disrupt the shot by striking a blow. Being attacked while casting an elemental attack results in a -100 modifier to the elemental attack spell, even if the attack on the caster misses.
Characters must be within melee range to disrupt a caster's elemental attack, and must be able to act (i.e. have a higher Initiative value) before the spell is cast.
Casting Elemental Bolt Attacks into Melee
Casting an elemental bolt attack into a melee is a risky practice at best. Characters missing their targets must roll a separate attack against the next potential target in the bolt’s
path. A potential target is defined as any character, friend or foe, who is within 5’ (within the bolt’s line of travel) from the intended target.