Error Getting while exporting Print

1467
5
08-13-2013 10:47 PM
RohitGarg1
New Contributor
Hi,

Below Error Getting while exporting Print using arcgis server javascript api 3.5:-

"Error executing tool.: ERROR 000735: Web Map as JSON: Value is required The value is empty. The value is empty. ERROR 000735: Web Map as JSON: Value is required"

Please help me.

Regards,
RG
0 Kudos
5 Replies
VinayBansal
Occasional Contributor II
Please post some code snippet, what you are trying....?
0 Kudos
JasonZou
Occasional Contributor III
Some required print parameters are missing. Are you using the Print dijit or PrintTask?
0 Kudos
SimonFisher
Occasional Contributor II
I am getting this same error, but only when posting to a 10.2 Print Service (Execute Task (Export Web Map Task)).  The same data posted to 10.1 works.  Also, if I do a get with the same data on 10.1 or 10.2 it also succeeds, so it seems that there is some issue with a post against 10.2. 

Anyone find any fix, workaround or any suggestions?

Thanks
Simon
0 Kudos
SimonFisher
Occasional Contributor II
Below is a sample of the request, as I said above, a GET works but POST fails against 10.2.  Both POST and GET work against 10.1. 

http://maps2.iasworld.net/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%2...{'mapOptions':{'extent':{'xmin':-10019083.038025,'ymin':4186363.952525,'xmax':-10019037.221875,'ymax':4186427.03037499,'spatialReference':{'wkid':102100}},'spatialReference':{'wkid':102100}},'operationalLayers':[{'id':'County_10_2','url':'http://at-dev-ags102:6080/arcgis/rest/services/Shelby_BaseMap_Add_Layers_sde/MapServer','title':'Cou...},{'id':'graphicsLayer0','featureCollection':{'layers':[{'layerDefinition':{'name':'parcels','geometryType':'esriGeometryPolygon'},'featureSet':{'geometryType':'esriGeometryPolygon','features':[{'attributes':{'PARCELID':'040039 00002'},'geometry':{'rings':[[[-10019044.857899999,4186413.1715999991],[-10019049.543500001,4186374.4654999967],[-10019075.402000001,4186377.3224000032],[-10019071.062899999,4186416.5173999951],[-10019044.857899999,4186413.1715999991]]],'spatialReference':{'wkid':102100}},'symbol':{'color':[125, 125, 125,35],'outline':{'color':[255, 0, 0,255],'width':3,'type':'esriSLS','style':'esriSLSSolid'},'type':'esriSFS','style':'esriSFSSolid'}}]}}]}}],'exportOptions':{'outputSize':[700,700],'dpi':96}}&Format=PNG32&Layout_Template=MAP_ONLY&f=pjson


Also Note, I am making these GET/POSTS from Server side in .Net via then following methods;

        private static string MakeHttpGetRequest(string sUrl)
        {
            HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(sUrl);
            httpReq.Method = "GET";
            WebResponse httpResp = httpReq.GetResponse();
            Stream dataStream = httpResp.GetResponseStream();
            StreamReader reader = new StreamReader(dataStream);
            string responseFromServer = reader.ReadToEnd();
            return responseFromServer;
        }

        private static string MakeHttpPostRequest(string sUrl, string requestData)
        {
            HttpWebRequest httpReq2 = (HttpWebRequest)WebRequest.Create(sUrl);
            httpReq2.Method = "POST";
            httpReq2.ContentLength = requestData.Length;
            StreamWriter streamWriter2 = null;
            streamWriter2 = new StreamWriter(httpReq2.GetRequestStream());
            streamWriter2.Write(requestData);
            streamWriter2.Close();

            WebResponse httpResp2 = httpReq2.GetResponse();
            Stream dataStream2 = httpResp2.GetResponseStream();
            StreamReader reader2 = new StreamReader(dataStream2);
            string responseFromServer = reader2.ReadToEnd();
            return responseFromServer;
        }
0 Kudos
SimonFisher
Occasional Contributor II
Figured out my own issue, it seems POSTS also require the port in the url, and in this case, its port 6080, so the url has to be
http://maps2.iasworld.net:6080/arcgis/rest/services ........
0 Kudos