Hi All,
Am trying to send some data wrapped in a SOAP API request.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<UpdateReg xmlns="http://www.cessoftware.co.uk/">
<RegKey>712441211</RegKey>
<ExpiryDate> </ExpiryDate>
<OnStop>0</OnStop>
<AutoRenew>1</AutoRenew>
<Email>test@test.co.uk</Email>
</UpdateReg>
</soap:Body>
</soap:Envelope>
This works fine and the website data gets updated. However I want to pass the values of the xml dynamically based on what my subform has.
I tried to store the variables from the form
RegKey = Me.RegKey_subform1.Form!RegKey
ExpiryDate = Me.RegKey_subform1.Form!ExpiryDate
OnStop = Me.RegKey_subform1.Form!OnStop
AutoRenew = Me.RegKey_subform1.Form!AutoRenew
and want to pass those variables in the xml something like this:
sEnv = "<?xml version=""1.0"" encoding=""utf-8""?>"
sEnv = sEnv & "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">"
sEnv = sEnv & "<soap:Body>"
sEnv = sEnv & "<UpdateReg xmlns=""http://www.cessoftware.co.uk/"">"
sEnv = sEnv & " <xsi:variable name="RegKey" select="RegKey" />
sEnv = sEnv & " <xsi:variable name="ExpiryDate" select="ExpiryDate" />
sEnv = sEnv & " <xsi:variable name="OnStop" select="OnStop" />
sEnv = sEnv & " <xsi:variable name="AutoRenew" select="AutoRenew" />
sEnv = sEnv & " <Email>test@test.co.uk</Email>"
sEnv = sEnv & "</UpdateReg>"
sEnv = sEnv & "</soap:Body>"
sEnv = sEnv & "</soap:Envelope>"
But that doesn't work. Is the approach of passing variables right? How do I get to pick the values and send it in the xml. Please help.
Thanks
Newbie