PrintTask not exporting the map, ArcGIS Server 10.2, ArcGIS Javascript API 3.6

Discussion created by kskaushal on Sep 25, 2013
Latest reply on Sep 27, 2013 by kskaushal
I have created the print task code but its not exporting the map. I need to export map and then download for the user.
I have added basemap, my custom rest services, some esri live feed rest services, some graphics on the map.
I have tried my local server geoprocessing printtask, and the esri online printtask, but none of them returns the exported map url..

I have also used the proxy page for this and have tried without enabling the proxy but none way works.

I am pasting the javascript method for reference which is being called upon button click after the map loads.
I have tried with the commented codes also.

function exportMap() {
    //    var map1 = new esri.Map("map",
    //                { slider: true, basemap: "streets", logo: false });

//    var url = 'http://servicesbeta4.esri.com/arcgis/rest/services/Utilities/ExportWebMap/GPServer/Export Web Map Task';
//    var url = 'http://ms02291/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export Web Map Task';
//    var printTask = new esri.tasks.PrintTask(url);

//    var printResult = function (result) {
//        console.log(result)
//        alert(result);
//    }

    var template = new esri.tasks.PrintTemplate();
    template.exportOptions = {
        width: 500,
        height: 400,
        dpi: 96
    //template.format = "PDF";
    template.format = "JPG";
    template.layout = "MAP_ONLY";
    template.showAttribution = false;
    //template.preserveScale = false;

    var params = new esri.tasks.PrintParameters();
    params.map = map;
    params.template = template;

    //    printTask.on("complete", printComplete);

    //    printTask.execute(params, printResult);

    //print task
    //var printTask = new esri.tasks.PrintTask("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export Web Map Task");
    //var printTask = new esri.tasks.PrintTask("http://ms02291/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export Web Map Task");
    var printTask = new esri.tasks.PrintTask("http://ms02291/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task");
    printTask.execute(params, function (result) {

This is very urgent. Please help to rectify the issue.
Kaushal Shah.