Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Design of web service for Excel consumption

Hi

I am trying to create a web service method that can be used to import data
into Excel. From what I have read I need the web service to return a strongly
typed dataset which Excel should be able to read using the XML import options.

I have added a dataset definition (xsd) to my web service. I am populating
the dataset with a couple of rows of test data as shown below:


[WebMethod]
public DataSet1 GridGetDataSet()
{
DataSet1 ds = new DataSet1();
ds.Table1.Rows.Add(new object[] { "Field1", 100 });
ds.Table1.Rows.Add(new object[] { "Field2", 200 });
return ds;
}

When I try to attach to this method using the url:

http://localhost:49436/InvestigatorS...GridGetDataSet

I get the following error meassge in Excel:

"Microsoft Office Excel cannot access the file
'http://localhost:49436/InvestigatorService.asmx/GridGetDataSet'. There are
several possible reasons:
* The file name or path does not exist.
* The file is being used by another program.
*The workbook you are trying to save has the same name as a currently opent
workbook.

I am guessing that I need to do something more to the dataset definition??

BTW: Testing the method call on the web service works and returns the
following xml:

<?xml version="1.0" encoding="utf-8" ?
- <DataSet1 xmlns="http://www.it-workplace.co.uk/"
- <xs:schema id="DataSet1" targetNamespace="http://tempuri.org/DataSet1.xsd"
xmlns:mstns="http://tempuri.org/DataSet1.xsd"
xmlns="http://tempuri.org/DataSet1.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified" elementFormDefault="qualified"
- <xs:element name="DataSet1" msdata:IsDataSet="true"
msdata:UseCurrentLocale="true"
- <xs:complexType
- <xs:choice minOccurs="0" maxOccurs="unbounded"
- <xs:element name="Table1"
- <xs:complexType
- <xs:sequence
<xs:element name="Column1" type="xs:string" minOccurs="0" /
<xs:element name="Column2" type="xs:double" minOccurs="0" /
</xs:sequence
</xs:complexType
</xs:element
</xs:choice
</xs:complexType
</xs:element
</xs:schema
- <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
- <DataSet1 xmlns="http://tempuri.org/DataSet1.xsd"
- <Table1 diffgr:id="Table11" msdata:rowOrder="0"
diffgr:hasChanges="inserted"
<Column1Field1</Column1
<Column2100</Column2
</Table1
- <Table1 diffgr:id="Table12" msdata:rowOrder="1"
diffgr:hasChanges="inserted"
<Column1Field2</Column1
<Column2200</Column2
</Table1
</DataSet1
</diffgr:diffgram
</DataSet1
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fule consumption popunonkok Excel Discussion (Misc queries) 0 April 27th 06 08:16 PM
Consumption function [email protected] Excel Discussion (Misc queries) 6 November 19th 05 12:41 AM
Hyperlinks Inserted in Design Mode inactive once Exited Design Mod Craig Excel Programming 0 March 16th 05 04:53 PM
Difference between a Service Release and a Service Pack? Bill Renaud[_2_] Excel Programming 2 April 16th 04 04:13 AM
Enter Excel Design Mode and Exit Design Mode Bill Lunney Excel Programming 0 August 4th 03 07:48 AM


All times are GMT +1. The time now is 06:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"