I have same problem.
I try is with a Filegeodatabase and a Shapefile. I manually edit the service:
[{"id":"MyFile_GDBWorkspaceID","workspaceFactory":"File GDB","workspaceConnection":"DATABASE=D:\\Data\\AG101.1\\test.gdb"},{"id":"MyShapefileWorkspaceID","workspaceFactory":"Shapefile","lockVersion":"true","workspaceConnection":"DATABASE=D:\\Data\\CBS"}]
But I can't specify the Dynamic Layer:
{"id":101,
"source":
{"type":"dataLayer","dataSource":
{"type":"table","workspaceId":"MyShapefileWorkspaceID","dataSourceName":"Provincies"}},
"drawingInfo":{"renderer":{"type":"simple","symbol":{"type":"esriSFS","style":"esriSFSSolid","color":[166,36,50,255],"outline":{"type":"esriSLS","style":"esriSLSSolid","color":[200,110,110,255],"width":1}},
"label":"BAG","description":""},"transparency":60},
}
Error: Invalid or missing input parameters.
It works fine for an existing layer in the mapservice:
{
"id":502,
"source":{"type":"mapLayer","mapLayerId":2}
}
Another question:
How can you ask the mapservice wich Dynamic Data workspaces were created?