Was this an actual prophecy?
Moreh ha'Nevuchim (2:45, ha'Madregah 2): It was not a total Nevu'ah. When Hashem spoke to Avraham, Yakov, Yeshayah and Yirmeyah at night, He informed them that it is a Nevu'ah. After Hashem spoke to Shlomo, it says "v'Hinei Chalom." When a Nevu'ah comes "ba'Chalom Adaber Bo" (Bamidbar 12:6), it is never called a dream.
Malbim (15, Shir ha'Shirim 1:1) Mahari says that it was a full Nevu'ah. [Shir ha'Shirim consists of five songs;] the first pertains to this Nevu'ah. Shlomo's soul pursued Chachmah via investigation, and asked to receive it via prophecy, suddenly, and Hashem did so - "Yishakeni mi'Neshikos Pihu?; Mashcheni Acharecha Narutzah?; Hevi'ani El Beis ha'Yayin" (Shir ha'Shirim 1:2, 4, 2:4).