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=“http://schemas.xmlsoap.org/soap/envelope/”>
<soap:Header>
<wsse:Security xmlns:wsse=“http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd”>
<wsse:UsernameToken xmlns:wsu=“http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd”>
<wsse:Username>testuser</wsse:Username>
<wsse:Password Type=“http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText”>testPW</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
<soap:Body>
<ClearDeviceRecordRequest xmlns=“http://twowire.com/dmc/apps/nbiws/devicemgmt/v1_0” xmlns:ns2=“http://twowire.com/dmc/apps/nbiws/base/v1_0”>
<deviceSelector xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xsi:type=“ns2:SerialNumberAndOUIDeviceSelector”>
<ns2:serialNumber>M91902SC088Y</ns2:serialNumber>
<ns2:oui>446AB7</ns2:oui>
</deviceSelector>
</ClearDeviceRecordRequest>
</soap:Body>
</soap:Envelope>

Any help guidance would be appreciated

BR