The following account of Sheikh Abdul Qadir Jilani's first encounter with al-Hamadani is related by Haytami in his Fatawa hadithiyya and is quite insightful:
Abu Sa`id `Abd Allah ibn Abi `Asrun (d. 585), the Imam of the School of Shafi`i, said: "When I began a search for religious knowledge I kept company with my friend, Ibn al-Saqa, who was a student in the Nizamiyya School, and it was our custom to visit the pious. We heard that there was in Baghdad a man named Yusuf al-Hamadani who was known as al-Ghawth, and that he was able to appear whenever he liked and was able to disappear whenever he liked. So I decided to visit him along with Ibn al-Saqa and Shaykh `Abd al-Qadir al-Gilani, who was a young man at that time. Ibn al-Saqa said, "When we visit Shaikh Yusuf al-Hamadani I am going to ask him a question the answer to which he will not know." I said: "I am also going to ask him a question and I want to see what he is going to say." Shaikh `Abd al-Qadir al-Gilani said: "O Allah, protect me from asking a saint like Yusuf Hamadani a question, but I will go into his presence asking for his baraka -- blessing -- and divine knowledge."
"We entered his association. He kept himself veiled from us and we did not see him until after some time. He looked at Ibn al-Saqa angrily and said, without having been informed of his name: "O Ibn al-Saqa, how dare you ask me a question when your intention is to confound me? Your question is this and your answer is this!" Then he said: "I am seeing the fire of disbelief burning in your heart." He looked at me and said, "O `Abd Allah, are you asking me a question and awaiting my answer? Your question is this and your answer is this. Let the people be sad for you because they are losing as a result of your disrespect for me." Then he looked at Shaikh `Abd al-Qadir al-Gilani, made him sit next to him, and showed him honor. He said: "O `Abd al-Qadir, you have satisfied Allah and His Prophet with your proper respect for me. I see you in the future sitting on the highest place in Baghdad and speaking and guiding people and saying to them that your feet are on the neck of every wali! And I almost see before me every wali of your time giving you precedence because of your great station and honor."
Ibn Abi `Asrun continues, "`Abd al-Qadir's fame became widespread and all that Shaykh al-Hamadani said about him came to pass. There came a time when he did say, "My feet are on the necks of all the awliya," and he was a reference and a beacon guiding all people in his time to their destinations.
The fate of Ibn al-Saqa was something else. He was brilliant in his knowledge of the divine Law. He preceded all the scholars in his time. He used to debate with the scholars of his time and overcome them, until the caliph called him to his association. One day the calif sent him as a messenger to the King of Byzantium, who in his turn called all his priests and the scholars of the Christian religion to debate with him. Ibn al-Saqa was able to defeat all of them in debate. They were helpless to give answers in his presence. He was giving answers to them that made them look like children and mere students in his presence.
His brilliance made the King of Byzantium so fascinated with him that he invited him to his private family meeting. There he saw the daughter of the King. He immediately fell in love with her, and he asked her father, the King, for her hand in marriage. She refused except on condition that he accept her religion. He did, leaving Islam and accepting the Christian religion of the princess. After his marriage he became seriously ill. They threw him out of the palace. He became a town beggar, asking everyone for food, yet no one would provide for him. Darkness had come over his face.
One day he saw someone that had known him before. That person relates: "I asked him, What happened to you?" He replied: "There was a temptation and I fell into it." The man asked him: "Do you remember anything from the Holy Qur'an?" He replied: "I only remember rubbama yawaddu al-ladhina kafaru law kanu muslimin -- "Again and again will those who disbelieve wish that they were Muslims" (15:2)."
He was trembling as if he was giving up his last breath. I turned him towards the Ka`ba, but he kept turning towards the East. Then I turned him back towards the Ka'aba, but he turned himself to the East. I turned him a third time, but he turned himself to the East. Then as his soul was passing from him, he said, "O Allah, that is the result of my disrespect to Your saint, Yusuf al-Hamadani."Ibn Abi `Asrun continues: "I went to Damascus and the king there, Nur al-Din al-Shahid, put me in control of the religious department, and I accepted. As a result, dunya entered from every side: provision, sustenance, fame, money, position for the rest of my life. That is what the ghawth Yusuf al-Hamadani had predicted for me."