Repeated Soap calls with single variable change from list

Hi Gents

I’ve used PS a number of times to do performance validation against SoapAPI. I now need to generate a SoapAPI call for over 5 thousand devices and I am looking to automate the process using PS and would appreciate some guidance and or some examples from the guru’s.

Ideally, I would like to have a flat-file/xls of the serial number (serial number is the only variable that will ever change)

Ideally, the script would do the following:

  1. Read the first serial from the list, change variable <ns2:serialNumber>M91902SC088Y</ns2:serialNumber> –> send SoapAPI –> Close session

  2. read 2nd serial from list –> send SoapAPI Close session (round robin until serial list processing is complete)

Here’s the Soap request for a single device to give you an idea of what I am generating (this wokring perfectly for a single device)

<?xml version=“1.0” encoding=“UTF-8”?>
<soap:Envelope xmlns:soap=“”>
<wsse:Security xmlns:wsse=“”>
<wsse:UsernameToken xmlns:wsu=“”>
<wsse:Password Type=“”>testPW</wsse:Password>
<ClearDeviceRecordRequest xmlns=“” xmlns:ns2=“”>
<deviceSelector xmlns:xsi=“” xsi:type=“ns2:SerialNumberAndOUIDeviceSelector”>

Any help guidance would be appreciated