Hi Haider Ali,
I am sorry but I do not fully understand your query. Do you already have a SOE in place? Is yes, can you share what do you wish to do with it? Are you trying to access layerid 0 as a feature layer for overlaying? Or for querying the table with?
If you can help elaborate more on what you are trying to achieve, I am sure others in the forum will be able to better clear your doubts.
Cheers,
Raymond