I do not believe that your code will work because ESRI dropped supported for the APIs that you are using:http://blogs.esri.com/esri/arcgis/2011/04/27/considerations-for-arcgis-server-developers-a-look-toward-10-1/http://resources.arcgis.com/en/help/arcobjects-cpp/conceptualhelp/index.html#//000100000148000000At 10.1, you can no longer use ArcObjects remotely (via DCOM); this way of interacting with ArcGIS for Server is no longer supported. If you are using GISServerConnection in the Server library or AGSServerConnection in the GISClient library in your code, these need to be removed if you are working with ArcGIS for Server 10.1.So what can you do?I'd suggest to Goggle on "arcgis server create map service programmatically". Here is a relevant post:http://gis.stackexchange.com/questions/27873/arcobjects-arcserver-10-1-how-to-programatically-publish-a-map-serviceRead the last post by nicogis who is well informed.
I think that the example you gave is using DCOM in conjunction with ArcObjects. I also think that support for that ended with 10.1:http://resources.arcgis.com/en/help/main/10.2/index.html#//0154000005n9000000Determine if you have any client applications that connect to ArcGIS Server using DCOM (ArcGIS Server Local) connectionsArcGIS Server versions 10.0 and earlier supported both DCOM (ArcGIS Server Local) and HTTP (ArcGIS Server Internet) connections. Beginning at version 10.1, support for DCOM connections with ArcGIS Server was discontinued. You need to refactor your web applications to use HTTP connections before upgrading. If you used DCOM connections for the purpose of accessing ArcObjects, you need to remove your ArcObjects code or wrap it in a server object extension.
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.