Legal challenge expected over same-sex marriage