View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
gjn gjn is offline
external usenet poster
 
Posts: 2
Default Excel 2003: Grabbing a dataset from a webservice and then sending to a webservice?


I am writing an application which uses Excel to fetch and update data
from a database. I have been able to get the data from the WebService
and get it into Excel...but I have not yet found a way to the data back
to a WebService.

The architecture I am using is:
Excel 2003 workbook (with VBA)
--includes SOAP 3.0 and MS Web Services Toolkit 2.01
WebServices (via C#/.Net running on an IIS web server)
MS SQL 2000 database (that the WebService attaches to)

The webservice which I get the data from is (in C#):

---begin---
[WebMethod]
public DataSet GetHistoricalDoubleWeibullModelParameters(string
fileLocation) {
DataSet ds;
....
return ds;
}
---end---

In Excel I am able to receive this code using:

---begin---
Dim weibullWebService As clsws_WeibullWebService
Dim historicalDataSet As MSXML2.IXMLDOMNodeList
Set weibullWebService = New clsws_WeibullWebService
Set historicalDataSet =
weibullWebService.wsm_GetHistoricalDoubleWeibullMo delParameters("parameter")
---end----

However, I want to send this "historicalDataSet" back to a webservice
in the form of a dataset.

The webservice I want to send it to is:
---begin---
[WebMethod]
public double DesignWindSpeed_DoubleWeibullModel(DataSet weibullData,
double targetReturnPeriod) {
double x;
....
return x;
}
---end---

I have tried using the code in Excel (which I know is wrong):
---begin---
windSpeed =
weibullWebService.wsm_DesignWindSpeed_DoubleWeibul lModel(historicalDataSet,
50)
---end---

When I try to run macro that this is part of, the call breaks due to a
casting error. What I can't figure out is how to convert a
IXMLDOMNodeList object into a whatever Excel 20003 VBA will send as a
dataset over SOAP for my webservice.

What do I need to here to make this conversion?

Any suggestions would be welcome gjn[at]rwdi.NOSPAM.com

Graham