You're basically running into one of the numerous shortfalls the TSA x-ray equipment has.
Bars of soap are large, opaque items (as well as fudge). I regularly bring my own soap with me, and what I have learned through trials and tribulations is to isolate the bar of soap away from your other toiletries and especially away from wires in your bag (cell phone chargers, for example).
My suggestion to you is to put the bar of soap in an exterior compartment/pocket of a rollaboard (or your other carry-on luggage). Again, isolation with those opaque items is key.