This exactly. I think a lot of people lose sight of the melody when they're soloing and that's when you lose a lot of the audience (and me) unless you are some great virtuoso like John McLaughlin or Jaco who can make things sound cool just by playing it faster. If you know the melody then when you go to solo, you will have some basic framework to construct your solos around. This is especially helpful if you learn the melody in the "normal" soloing portion of the fretboard (ie. above/around the 12 fret).
Two other things:
1) you should know exactly what key the song is in. Then make sure you can play that scale all over the fretboard. I think most people get intimidated by the thought of a solo and forget that every solo is just made up of notes from the scale (and maybe some chromatic notes for flavor). If you can get the scale that corresponds to the song under your hands and can play it all over the fretboard, then just try going for some scale notes and see where they take you. Often, after a bar or so you will find some phrases or note sets you like and you can build off those. Especially during rehearsals and practice, don't be afraid to just go for it and see where the scale etc. takes you. Try moving up and down the fretboard, try some double stops, and since you're on fretless, some tasteful slides will make anything sound better.
2) this happens to me often too. I play in a jazz combo, often on 4 string fretless, and the sax player/BL or the guitar player will often randomly tell me to take a solo after they finish theirs (sometimes during rehearsal, sometimes on the gig)... rarely do I have a scripted solo save for one or two tunes. I make sure I know the scale/key for each song as I said above, and try not to worry too much about playing a "wrong" note. If you hit a scale note it won't sound awful, and once I play around with a few notes, I find a couple things I like and go from there. Jazz is about improv, so don't be afraid to improvise! Really... being ready to take a risk or two will really improve your impromptu soloing abilities; I find that is something a lot of people don't teach you. At the worst, you hit a clunker–keep in mind you are always a half step away from a note in the scale so just skooch that finger up or down a fret and call it "jazz."
Hope this helps! Good luck!