将Excel数据发布到XML Web服务 [英] Posting Excel Data to a XML Web Service

查看:195
本文介绍了将Excel数据发布到XML Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

现在,我可以使用"MSDN Web服务工具包2.0"通过Excel和几行代码将1个xml记录发布到Web服务,但是我需要一次能够发布约100条记录的功能.

问题:

-因此,我认为我需要一个带有暂停"的vba循环,因为我认为Web服务响应"需要在发布每条xml记录后删除/清除.

-我需要一种方法来调用约100条记录的XML数据:
我需要从第二个应用了XSD的Excel选项卡中调用数据(请注意,excel生成的XSD略有偏离,以至于让我担心)或
我需要调用包含所有XML数据的文本文件还是其他方法?

尝试使这种污垢变得简单,以便通过Web服务从Excel Sheet将一些数据导入应用程序.该工具包完成了大部分繁重的工作,现在我只需要一种遍历100条记录的方法.

谢谢!


**到目前为止已发布1条记录的代码:**

Hello,

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>



我已进行了一些更正-LOSMAC [/EDIT]



I have made some corrections - LOSMAC[/EDIT]

推荐答案

您可以在一次调用中通过网络服务发送整张表格,为什么不这样做并进行处理在另一端?
You can send an entire sheet via a webservice in one call, why not do that and process on the other end ?


这篇关于将Excel数据发布到XML Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆