Are you looking for one build that works in both? Or separate builds?
With Soldiers Gear, Phantasm/Glamour build should work from the backlines.
http://intothemists.com/calc/?build=...5;9;7FW0-iV10Y
^A common phantasm/glam build. In WvW, bring veil. In PVE, bring Feedback. You have cd reduction on summons and 30% more damage from phantasms. Also, reflect whenever you need it.
Prismatic Understanding is common in WvW. You can run it in Soldiers gear with Phantasm damage. I wouldn't recommend it for PVE though.
PU w/ Power:
http://intothemists.com/calc/?build=...9;9;0F81-i-K0L