Select to view content in your preferred language

Accessing IPageLayout interface through SOE (ArcGis for server 10.2)

2884
4
Jump to solution
12-05-2013 05:38 AM
StéphaneCouderq
Emerging Contributor
Hi,
I am trying to update a server object extension to version 10.2. The extension resize the page, and change position of various page elements.
Here is the beginning code:
IServerObject so = this.serverObjectHelper.ServerObject; IMapServerObjects3 mapServerObjects = (IMapServerObjects3)so; IPageLayout3 pageLayout = (IPageLayout3)mapServerObjects.PageLayout; 

The cast of mapServerObjects raises an exception.
I understand that since version 10.1 some interface that accessed the mxd must be avoided, in favor of ArcObjects working with map services. I just can't find anything that suits my needs.
It appears that manipulating page layouts from version 10.1 isn't available anymore.

Do someone knows how to access Page layout elements, or a workaround ?
(python toolbox isn't an option neither since ArcPy doesn't expose methods to manipulate grids, apparently)

Thank you.
0 Kudos
1 Solution

Accepted Solutions
TomSchuller
Frequent Contributor
Hy,
as "dirty" workaround, you can open the mxd in file in the SOE-ArcObjects code.

Tom

View solution in original post

0 Kudos
4 Replies
LeoDonahue
Deactivated User
I am trying to update a server object extension to version 10.2

From version 10.0 ?

It appears that manipulating page layouts from version 10.1 isn't available anymore.

I'm surprised that worked at version 10.1

There is a blog about this. 

http://blogs.esri.com/esri/arcgis/2010/11/12/accessing-optimized-map-services-with-server-object-ext...

Because optimized map service use a completely different drawing engine  and source file than MXD-based services, they draw very quickly.  However, this also means that they do not support full ArcObjects access  from the Carto library. When working with optimized map services, you  cannot use any ArcObjects directly related to the map document, such as  IMapServerObjects, IMap, ILayer, and IFeatureLayer.


Since PageLayout uses IMap, I'm guessing this is why you can't use IPageLayout3 in a SOE.  I don't know of another way to manipulate page layout elements in a SOE, unless you want to go back to version 10.0.
0 Kudos
StéphaneCouderq
Emerging Contributor
Thank you for your reply.

The extension was working in ArcGis server 10.0 before.

From your reply i understand that Page layout elements can not be accessed from a SOE (.NET with SOAP) for version 10.2 ?
0 Kudos
TomSchuller
Frequent Contributor
Hy,
as "dirty" workaround, you can open the mxd in file in the SOE-ArcObjects code.

Tom
0 Kudos
StéphaneCouderq
Emerging Contributor
Thank you for the reply Tom.
Actually the dirty (?) approach of accessing directly the map document seems our only working option for now.
0 Kudos