Select to view content in your preferred language

Graphics not rendered in SOAP request exportMapImage 10.9.1 (ArcGIS Pro runtime)

1071
6
Jump to solution
08-17-2022 04:28 AM
LarsSøe
Occasional Contributor

Prior to ArcGIS Server version 10.9.1 we have been able to draw customgraphics using the SOAP API on top of an ArcGIS Server mapservice. This is used for printing purposes (selections, copyright etc.)

It has been working fine from ArcGIS Server 9 to 10.9 when publishing from ArcMap and 10.8-10.9 services published with ArcGIS Pro (runtime).

At 10.9.1 only services published with ArcMap show custom graphics. When using the ArcGIS Pro (Service Runtime)  exportMapImage returns a blank (white) image.

The behaviour is seen at 3 different ArcGIS Server installations. Two federated with Portal and one stand-alone ArcGIS Server site.

 

Does anybody know if customgraphics is deprecated at 10.9.1 when using the ArcGIS Pro Service runtime?

 

Tags (2)
0 Kudos
2 Solutions

Accepted Solutions
TanuHoque
Esri Regular Contributor

@LarsSøe 

Thanks a lot for sharing the code and so sorry for the delay. We are looking at this and hope to have a fix for this in upcoming release.

Appreciate your reporting it to us.

Tanu

View solution in original post

TanuHoque
Esri Regular Contributor

@LarsSøe 

It actually got fixed in 11.1 which was released not too long ago. 11.0 was already released when we learned about this bug.

Would you be okay for you to upgrade to 11.1?

Thanks

View solution in original post

6 Replies
TanuHoque
Esri Regular Contributor

hi @LarsSøe 

could you please share your code or SOAP request with us? You can share it hear or direct message me.

We will take a look and get back to you.

Thanks

Tanu

LarsSøe
Occasional Contributor

Hi Tanu.

Thank you very much for replying. It took a little effort to refactor the code to one simple function - but the enclosed example shows the problem.

The classes "RedlineObject" and "NetGISPoint" are very simple classes which contain geometries. 

Using the "RedlineArcmap"  an image with a polygon is returned. "Redline_Pro3" (service published with ArcGIS Pro 3.0) returns an empty image.

Btw its Java code 🙂

Hope to hear from you.

 

 

 

public static void main(String[] args) {
		
		String url = "https://xxx/arcgis/services/Redline_PRO3/MapServer?wsdl";
		String agsVersion = "2.9.0";
		String redlineServiceName = "Redline_PRO3";
		
		//String url = "https://xxx/arcgis/services/RedlineArcmap/MapServer?wsdl";
		//String agsVersion = "10.8";
		//String redlineServiceName = "RedlineArcmap";
		
		try {
			
			QName qName = new QName("http://www.esri.com/schemas/ArcGIS/" + agsVersion, redlineServiceName + "_MapServer");
			ArcGISServerSoapStub stub = new ArcGISServerSoapStub(new URL(url), qName);
			String token = "";
			
			MapServerPort port = stub.getMapServerPort(agsVersion, token);
			MapServerInfo mi = port.getServerInfo(port.getDefaultMapName());
			MapDescription mapDescription = mi.getDefaultMapDescription(); 			
			ImageDescription imageDescription = new ImageDescription();

			ImageType type = new ImageType();
			type.setImageFormat(com.esri.schemas.arcgis.EsriImageFormat.ESRI_IMAGE_PNG_32); 
			type.setImageReturnType(EsriImageReturnType.ESRI_IMAGE_RETURN_URL);
			
			ImageDisplay imageDisp = new ImageDisplay();
			imageDisp.setImageDPI(96);
			imageDisp.setImageWidth(1000);
			imageDisp.setImageHeight(1000);
			
			imageDescription.setImageDisplay(imageDisp);
			imageDescription.setImageType(type);	
			
			
			// Set layers invisible
			for (LayerDescription ld : mapDescription.getLayerDescriptions().getLayerDescription()) {
				ld.setVisible(false);
			}
			ArrayOfGraphicElement custGraphics = new ArrayOfGraphicElement();
			RgbColor color = new RgbColor();
			color.setRed((short) 125);
			color.setGreen((short) 125);
			color.setBlue((short) 125);
			
			SimpleFillSymbol fillSymbol = new SimpleFillSymbol();

			fillSymbol.setColor(color);
			SimpleLineSymbol outlineSymbol = new SimpleLineSymbol();
			outlineSymbol.setWidth(2);
			outlineSymbol.setColor(color);
			outlineSymbol.setStyle(EsriSimpleLineStyle.ESRI_SLS_SOLID);
			fillSymbol.setOutline(outlineSymbol);
			fillSymbol.setStyle(EsriSimpleFillStyle.ESRI_SFS_NULL);
			
			ArrayOfPoint pointArray = new ArrayOfPoint();
			
			RedlineObject ro = new RedlineObject();
			ro.addPoint(new NetGISPoint(693387.3656852759, 6222162.530941748));
			ro.addPoint(new NetGISPoint(693246.565685276, 6223506.530941748));
			ro.addPoint(new NetGISPoint(695806.565685276, 6223672.9309417475));
			ro.addPoint(new NetGISPoint(697188.9656852758, 6222520.9309417475));
			ro.addPoint(new NetGISPoint(694884.9656852758, 6221138.530941748));
			ro.addPoint(new NetGISPoint(693387.3656852759, 6222162.530941748));
			
			Iterator<NetGISPoint> itPoints = ro.getPoints().iterator();
			while (itPoints.hasNext()) {
				NetGISPoint ngp = itPoints.next();
				PointN point = new PointN();
				point.setX(ngp.getX());
				point.setY(ngp.getY());
				pointArray.getPoint().add(point);
			}
			ArrayOfRing rings = new ArrayOfRing();
			Ring ring1 = new Ring();
			ring1.setPointArray(pointArray);
			PolygonN polygon = new PolygonN();
			rings.getRing().add(ring1);
			polygon.setRingArray(rings);
			polygon.setExtent(mapDescription.getMapArea().getExtent());
			polygon.setHasID(false);
			polygon.setHasM(false);
			polygon.setHasZ(false);
			polygon.setSpatialReference(mapDescription.getSpatialReference());

			PolygonElement elm = new PolygonElement();
			elm.setSymbol(fillSymbol);
			elm.setPolygon(polygon);
			elm.setReferenceScale((double) 0);
			custGraphics.getGraphicElement().add(elm);

			mapDescription.setCustomGraphics(custGraphics);
			
			EnvelopeN extent = (EnvelopeN) mapDescription.getMapArea().getExtent();
			extent.setXMax(704081.7656852759);
			extent.setYMin(6212302.530941747);
			extent.setYMax(6231702.530941747);
			extent.setXMin(689681.7656852759);
			
			MapImage image = port.exportMapImage(mapDescription, imageDescription);
			System.out.println(image.getImageURL());
						
		} catch (MalformedURLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

 

 

 

 

0 Kudos
TanuHoque
Esri Regular Contributor

@LarsSøe 

Thanks a lot for sharing the code and so sorry for the delay. We are looking at this and hope to have a fix for this in upcoming release.

Appreciate your reporting it to us.

Tanu

LarsSøe
Occasional Contributor

Hi Tanu.

I have just tested against version 11 and the problem still seems to exist. Will the problem not be resolved?

Hope to hear from you.

 

Best regards

 

Lars Søe

 

0 Kudos
TanuHoque
Esri Regular Contributor

@LarsSøe 

It actually got fixed in 11.1 which was released not too long ago. 11.0 was already released when we learned about this bug.

Would you be okay for you to upgrade to 11.1?

Thanks

LarsSøe
Occasional Contributor

I have testet and everything seems to work in 11.1 🙂