Export Tiles not working. Getting Bad Request

07-30-2014 07:49 PM
New Contributor II


   I need to download the TPK file from server. When I process my request I am getting "Bad Request". May I know the cause for this issue?

I am able to get the JobId it seems. But when processing the job I am getting Bad Request. In which scenario this error will come?

Server Version is 10.2.2

//Prepare params using levels and envelope

AGSExportTileCacheParams *params = [[AGSExportTileCacheParams alloc] initWithLevelsOfDetail:desiredLevels areaOfInterest:nil];


[_tileCacheTask exportTileCacheWithParameters:params downloadFolderPath: Path useExisting:YES status:^(AGSResumableTaskJobStatus status, NSDictionary *userInfo) {

                    //it is keep on polling for 10 minutes.

                         //status received 2,3,4,5.

                         stuck with status 5.

        } completion:^(AGSLocalTiledLayer *localTiledLayer, NSError *error) {

if (error){


                Getting below error


                   NSLocalizedDescription = "Bad Request";

                   NSURL = "https://MyServer.com/rest/services/BACKGROUND/MapServer/exportTiles/jobs/j904f264668964782827771d13d...";



0 Kudos
3 Replies
Esri Contributor

Looks like your area of interest is nil, you are requesting to generate a tile package, therefore you need to pass an extent for the server to generate that TPK. Try to change the code and pass an extent and let me know how it works

AGSExportTileCacheParams *params = [[AGSExportTileCacheParams alloc]initWithLevelsOfDetail:desiredLevels areaOfInterest:Extent];

Hope this helps



0 Kudos
New Contributor II


Thanks for your reply.

I came to know the issue is with ArcGIS WebService URL.

By Default ArcGIS iOS SDK is appending the exportTiles/jobs URL by itself including the JobId Received From ArcGIS and is downloading TPK from Server. App could not access the URL given below as this is invalid URL. getting 400 error(Bad Request).


I found this URL in error response. If I remove exportTiles/ from URL and try in browser it is returning result.

But in Global ArcGIS Server i am able to get response  with and without exportTiles/.

Job Status j0bb1ef81b7064952a6a4e1bd58e1e384(Export Tiles)

Job Status j0bb1ef81b7064952a6a4e1bd58e1e384(Export Tiles)

What could be the cause? Why the ArcGIS iOS SDK is appending exportTiles/jobs/ instead of  jobs/? What setup needs to be done in ArcGIS server to access exportTiles/jobs?

0 Kudos
New Contributor II

got to know that the isseu is with URL length. We are adding authtoken in URL to validate it in proxy. Thanks