Posting Excel Data to a XML Web Service

1.9k Views Asked by At

Right now I can post 1 xml record to a web service via Excel and a few lines of code using the, "MSDN Web Services Toolkit 2.0" but I need the ability to post about 100 records at a time.

Issues:

  • So I think I need a vba loop with "pauses" because I think the web service "response" needs to be removed/cleared out after xml each record is posted.

  • I need an approach to call the XML Data for about 100 records: either I need to call the data off the second Excel tab that has a XSD applied to it (note, the XSD excel produces is slightly off so that concerns me) or I need to call a text file that has all the XML data or another way?

Trying to keep this dirt simple to import some data into an application via a web service from an Excel Sheet. The toolkit did most of the heavy lifting now I just need a way to loop through 100 records.

Thx!

**Code so far that posts 1 record:**

Private Sub insPat_Click()
Dim info As New clsws_FDirect
Dim addpat As String
Dim response As String

addpat = Range("B10").Text
response = info.wsm_PatientAdd(addpat)
Set responserange = Range("B11")
responserange.Value = response

End Sub


**Correct XSD:**
<Patient>
<FacID>TEST</FacID>
<PatID>99</PatID>
<PatLName>IMPORT</PatLName>
<PatFName>MISTER</PatFName>
<Allergy>Sulfites</Allergy>
<Floor>11</Floor>
<NsID>1F</NsID>
<Room>111</Room>
<Bed>1</Bed>
</Patient>
0

There are 0 best solutions below