var sr = new esri.SpatialReference('GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",
SPHEROID["WGS_1984",6378137.0,298.257223563]],
PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]'
);
for custom spatial reference, only WKT will be available and WKID is null. you can also confirm the same by checking the REST end point of your service. if it shows WKT then it is custom spatial reference.