Help installing new headlight socket?

the headlight socket on my 07 camry LE went bad. crumbled, fell apart. i ordered a new socket expecting to solder it back on but it has a plug on the other end... like, i don't even get it why would you buy a new socket that plugs into the existing bad socket. lol. question is, can i just cut that plug end off of the new part, cut off the existing bad socket and solder the new socket on? also, the two wires for the socket are color coded red and black. can i count on this to determine positive and ground side or is there any kind of bench testing i could do to it first to verify?
Answers

Rolomatic

Cut the connector off with enough wire and solder it, then use a self sealing heat shrink tubing. I'm guessing here, but there may be another junction connector to allow you to just swap it out. Look at the new wire harness length and you may find an interface connector you can plug into.

Dze

yeah if you get the wiring right .. if your not going to use crimp connectors and dont want to invest in all that i would at least get some heat shrink tubing to insulate the solder joints .. electrical tape sucks long term ...

don r

Unplug the old cable from the harness, then plug the new one in in its place.

STEVEN F

You bought the WRONG item.