javascript - Passing an array of ints with node-soap -


i'm using node-soap service , works need send array of ints , find can send first 1 because can't find correct way build js object represent array.

i've been looking @ similar questions couldn't find answer question.

i need generate xml property following one:

<ns1:arrayofints>           <!--zero or more repetitions:-->           <arr:int>2904</arr:int>           <arr:int>3089</arr:int>           <arr:int>4531</arr:int> </ns1:arrayofints> 

by passing object contains array:

soapobject = {               somefields,               "ns1:arrayofints": {                  goes here               },              }; 

any idea how create js object?

i had same problem , used $xml property add raw xml request , attributes set arr namespace:

var fields = [2904, 3089, 4531]; soapobject.arrayofints = {     attributes: {         'xmlns:arr': 'http://schemas.microsoft.com/2003/10/serialization/arrays'     },     $xml: fields.map(function(value) {         return '<arr:int>' + value + '</arr:int>';     }).join('') }; 

this code generate following request:

<ns1:arrayofints xmlns:arr="http://schemas.microsoft.com/2003/10/serialization/arrays">     <arr:int>2904</arr:int>     <arr:int>3089</arr:int>     <arr:int>4531</arr:int> </ns1:arrayofints> 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -