0

I have the following (part of) request:

<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <StartProcesRequest>
        <caseID>case1</caseID>
        <requestNR>123456789</requestNR>
        <custID>cust123</custID>
    </StartProcesRequest>
</s:Body>

When sending the request the first time I get a correct response. Second time I send the message the requestNR must be changed or else I get duplicate error.

How can I make UFT generate a random 9 digit number for requestNR?

Thank you in advance.

Vinni
  • 3
  • 2

1 Answers1

0

generate random number and save to file:

Dim RandNumber, Fo, f, file
RandNumber = RandomNumber(100000000,999999999)

Set file = CreateObject("Scripting.FileSystemObject")
If file.FileExists("T:\Inkomen\XMLBerichten\vbtest1.txt") Then
file.DeleteFile "T:\Inkomen\XMLBerichten\vbtest1.txt"
End If

Set Fo = createobject("Scripting.FilesystemObject")
Set f = Fo.openTextFile("T:\Inkomen\XMLBerichten\vbtest1.txt",8,true)
f.Write (RandNumber)
f.Close

read file to get number and use in xml message.

Vinni
  • 3
  • 2