diff --git a/test/client-test.js b/test/client-test.js index 1331ae6a9..a6d378612 100644 --- a/test/client-test.js +++ b/test/client-test.js @@ -837,6 +837,20 @@ var fs = require('fs'), done(); }); }); + + it('shall generate correct payload for methods with array parameter', function(done) { + soap.createClient(__dirname + '/wsdl/list_parameter.wsdl', function(err, client) { + assert.ok(client); + var pathToArrayContainer = 'TimesheetV201511Mobile.TimesheetV201511MobileSoap.AddTimesheet.input.input.PeriodList'; + var arrayParameter = _.get(client.describe(), pathToArrayContainer)['PeriodType[]']; + assert.ok(arrayParameter); + client.AddTimesheet({input: {PeriodList: {PeriodType: [{PeriodId: '1'}]}}}, function() { + var sentInputContent = client.lastRequest.substring(client.lastRequest.indexOf('') + ''.length, client.lastRequest.indexOf('')); + assert.equal(sentInputContent, '1'); + done(); + }); + }); + }); }); }); }); diff --git a/test/wsdl/list_parameter.wsdl b/test/wsdl/list_parameter.wsdl new file mode 100644 index 000000000..6b6501e4b --- /dev/null +++ b/test/wsdl/list_parameter.wsdl @@ -0,0 +1 @@ +The 201511Mobile version is only to be used by the Timesheet mobile app. This web service will only be supported as a part of the Agresso Mobile Applications. We reserve the rigth to change format and add methods at any time.Returns a work schedule containing work daysAdds a timesheet. Fully featured. Save all in one go.Adds a timesheet. Fully featured. Save all in one go.Adds a timesheet. Fully featured. Save resource/period by periodAdds a timesheet. Easy to useRetrieves a timesheetDeletes a timesheet entryRetrieves timesheet metadata filter typesRetrives timesheet meta dataRetrieves timesheet meta data with related columnsGet the value for the flexitime timecodeGet attribute and title for TS_free_dim_xGet ResourceId from logged in userGet localized titles based on back-end title IDsProvide setup data for the mobile client.Provider data method that returns the parameters needed to connect Native App with U4IDs using Implicit flowDiagnostics method that checks for presence of nessecary components and database connectionThe 201511Mobile version is only to be used by the Timesheet mobile app. This web service will only be supported as a part of the Agresso Mobile Applications. We reserve the rigth to change format and add methods at any time. \ No newline at end of file