cancel
Showing results for 
Search instead for 
Did you mean: 

Ajax post

former_member204240
Active Participant
0 Kudos

Hi All,

I am trying to use Ajax post to get xacute query output in xml format. Thing is its not overriding the parameters assigned. It always gives defaulted output from static input provided in xacute query.

Please see the code snippet below.

function getXmlData(startDate,endDate,shiftVal,vMachType,MachID,MachGroup,vPlantId)

{

     var urlPath="http://IP:port/XMII/Illuminator?QueryTemplate=/XaqCalcChartData&Content-Type=text/xml";        

    $.ajax({

         type : "POST",

         url : urlPath,

                datatype : "xml",

                 data:

              {

            Param1:startDate,

Param2:endDate,

Param3:shiftVal,

Param4:vMachType,

Param5:MachID,

Param6:MachGroup,

Param7:vPlantId           

              },   

           async: false,

         beforeSend: function()

         {

          },

         error: function()

         {

            alert('Error');

         },

         success: function(xml)

         {

alert(xml);

......

........

Can anyone help me on this.

Thanks,

Padma

Accepted Solutions (1)

Accepted Solutions (1)

former_member185280
Active Contributor
0 Kudos

I think parameters passed with the data property are put in the post document body while the MII service is looking for them only in the URL parameters (e.g "<url>?&Param.1=x&Param.2=y" etc.. ).

former_member204240
Active Participant
0 Kudos

Christain, I tried passing param in url too as below, will get xml output but still getting default param output.

http://IP:port/XMII/Illuminator?QueryTemplate=/XaqCalcChartData&Param1='20131001'&Param2='20131007'&...

Is there is any other way to get xml output from xacute, Infact my requirement is to pass the xml output.

former_member185280
Active Contributor
0 Kudos

I think you need a '.' in the format of the url params, like 'Param.1' instead of 'Param1' etc.

former_member204240
Active Participant
0 Kudos

I used XMII/Runner?Transaction=transaction path and I removed the quotes in parameters passed in url and, it worked fine.

Answers (0)