You can't save a polygon geometry in an ArcGIS server polyline feature class.
So, the only way is you to transform the polygon to the polyline at the client side.
I don't know if there is a sample somewhere, but I guess this is doable (using Paths and Rings properties of the geometry).