1 Kings 8:35

When heaven is shut up, and there is no rain, because they have sinned against thee; if they pray toward this place, and confess thy name, and turn from their sin, when thou afflictest them:

This verse belongs to Solomon's prayer at the dedication of the temple. At that dedication he felt his need of divine power. The builders of the temple were many and the house they built was large and grand, and God honored them because they had built Him a sanctuary where they could meet to worship Him. The prayer shows that Israel's dependence was in the God of Israel.

In the prayer he asked that the hearts of the people be wholly and undividedly given to the Lord in loyalty. Shut heaven and lack of rain can come because the people have sinned, and when afflicted they are to pray toward the temple place, confess God's name, and turn from their sin. The prayer then asks God to hear from heaven, forgive the people, teach them the good way wherein they should walk, and send rain upon their land. God is not confined to a temple building, but meets His people by His Spirit when they gather for worship, visits them in their homes and wherever they are, and can be worshiped in every place.

Those who worshiped God sincerely in that sanctuary had His blessing. The king who prayed this later turned from God to idolatry, living contrary to his own prayer and forsaking the temple to worship idols despite the divine manifestations he had received. He cast off his own allegiance and became a seducer of the very people for whom he had prayed, dishonoring himself, Israel, and God.