开发者

Unable to access ArcGIS ServerObjectManager

I have a C# plugin for ArcGIS, and I'm trying to access ServerObjectManager off of an AGSServerConnection but it's coming out as null.

The block of code is:

string serverMachineName = adfMap.PrimaryMapResourceInstance.DataSou开发者_运维知识库rce.DataSourceDefinition;
Identity adfIdentity = new Identity("Administrator", "password", "computername");
AGSServerConnection agsServerConnection = new AGSServerConnection(serverMachineName, adfIdentity, true);
IServerObjectManager serverObjectManager = agsServerConnection.ServerObjectManager;
IServerContext serverContext = serverObjectManager.CreateServerContext("TemporaryContext", "MapServer");

serverMachineName is something along the lines of http://computername/arcgis/services. The Administrator account is an administrator on the system, as well as a member of agsadmin and agsusers (just in case). The connection line succeeds. serverObjectManager is null at this point, so the subsequent call to create a server context fails.

Any advice?


Looks like I shouldn't have taken a non-error on the connection for granted. Throwing in a check to see if it was actually connected showed that it really wasn't.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜