WebService returning a dataset
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngwebservices' list.


=?iso-8859-1?Q?Jostein_=C5gedal?=
I have a webservice that returns a dataset.
The XML-representation of the dataset is
<TestData>
<ErrorMessage>None</ErrorMessage>
<FirstName>Jos</FirstName>
<LastName>jameson</LastName>
</TestData>

The wsdl file generated by my webservice is:
- <s:element name="fncDataTest">
<s:complexType />
</s:element>
- <s:element name="fncDataTestResponse">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="0" maxOccurs="1" name="fncDataTestResult">
- <s:complexType>
- <s:sequence>
<s:element ref="s:schema" />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>

MY QUESTION: I would like a schema presentation of the content of my DataSet, so that instead of the
<s:any /> tag, it should be something like:
<xs:element name="ErrorMessage" type="xs:string" minOccurs="0" />
<xs:element name="FirstName" type="xs:string" minOccurs="0" />
<xs:element name="LastName" type="xs:string" minOccurs="0" />

Is this possible to do dynamically, or do I have to edit the wsdl document manually?
Thanks in advance for your help. I am looking forward to hear your suggestions.

Jos
Reply to this message...
 
    
Yasser Shohoud
WebService returning a datasetReturn a typed dataset instead of a regular dataset. This will cause the dataset's schema to be included in the WDSL.
___________________________
Yasser Shohoud
Web Services Training and Resources
www.LearnXmlws.com

----- Original Message -----
From: Jostein Ågedal
To: aspngwebservices
Sent: Wednesday, June 26, 2002 5:50 AM
Subject: [aspngwebservices] WebService returning a dataset

I have a webservice that returns a dataset.
The XML-representation of the dataset is
<TestData>
<ErrorMessage>None</ErrorMessage>
<FirstName>Jos</FirstName>
<LastName>jameson</LastName>
</TestData>

The wsdl file generated by my webservice is:
- <s:element name="fncDataTest">
<s:complexType />
</s:element>
- <s:element name="fncDataTestResponse">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="0" maxOccurs="1" name="fncDataTestResult">
- <s:complexType>
- <s:sequence>
<s:element ref="s:schema" />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>

MY QUESTION: I would like a schema presentation of the content of my DataSet, so that instead of the
<s:any /> tag, it should be something like:
<xs:element name="ErrorMessage" type="xs:string" minOccurs="0" />
<xs:element name="FirstName" type="xs:string" minOccurs="0" />
<xs:element name="LastName" type="xs:string" minOccurs="0" />

Is this possible to do dynamically, or do I have to edit the wsdl document manually?
Thanks in advance for your help. I am looking forward to hear your suggestions.

Jos

| [aspngwebservices] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngwebservices.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives
Reply to this message...
 
    
=?iso-8859-1?Q?Jostein_=C5gedal?=
Hello Yasser,
Thanks for help. It seems like the right way to go BUT,
I couldnt make it work :-(

I saved a xsd schema to disk from the dataset.
I added this schema to a VB.NET project and chose Generate Dataset.
Then I copied this new class called NewDataSet into my webservice project and returned this instead of system.data.dataset.

Now the wsdl document looks like this:
<http://localhost/BVTranslatorAmadeus/Commands.asmx?wsdl#> - <s:element name="fncDataTest">
<s:complexType />
</s:element>
<http://localhost/BVTranslatorAmadeus/Commands.asmx?wsdl#> - <s:element name="fncDataTestResponse">
<http://localhost/BVTranslatorAmadeus/Commands.asmx?wsdl#> - <s:complexType>
<http://localhost/BVTranslatorAmadeus/Commands.asmx?wsdl#> - <s:sequence>
<http://localhost/BVTranslatorAmadeus/Commands.asmx?wsdl#> - <s:element minOccurs="0" maxOccurs="1" name="fncDataTestResult">
<http://localhost/BVTranslatorAmadeus/Commands.asmx?wsdl#> - <s:complexType>
<http://localhost/BVTranslatorAmadeus/Commands.asmx?wsdl#> - <s:sequence>
<s:any namespace="" />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<http://localhost/BVTranslatorAmadeus/Commands.asmx?wsdl#> - <s:element name="DataSet" nillable="true">
<http://localhost/BVTranslatorAmadeus/Commands.asmx?wsdl#> - <s:complexType>
<http://localhost/BVTranslatorAmadeus/Commands.asmx?wsdl#> - <s:sequence>
<s:element ref="s:schema" />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
<http://localhost/BVTranslatorAmadeus/Commands.asmx?wsdl#> - <s:element name="NewDataSet" nillable="true">
<http://localhost/BVTranslatorAmadeus/Commands.asmx?wsdl#> - <s:complexType>
<http://localhost/BVTranslatorAmadeus/Commands.asmx?wsdl#> - <s:sequence>
<s:any namespace="" />
</s:sequence>
</s:complexType>
</s:element>

A bit different, but the <s:any > tag is still there, and schema description is missing.

What have I done wrong?

Jos

-----Original Message-----
From: Yasser Shohoud [mailto:Click here to reveal e-mail address]
Sent: 26. juni 2002 23:21
To: aspngwebservices
Subject: [aspngwebservices] Re: WebService returning a dataset

Return a typed dataset instead of a regular dataset. This will cause the dataset's schema to be included in the WDSL.
___________________________
Yasser Shohoud
Web Services Training and Resources
www.LearnXmlws.com

----- Original Message -----
From: Jostein Ågedal <mailto:Click here to reveal e-mail address>
To: aspngwebservices <mailto:Click here to reveal e-mail address>
Sent: Wednesday, June 26, 2002 5:50 AM
Subject: [aspngwebservices] WebService returning a dataset

I have a webservice that returns a dataset.
The XML-representation of the dataset is
<TestData>
<ErrorMessage>None</ErrorMessage>
<FirstName>Jos</FirstName>
<LastName>jameson</LastName>
</TestData>

The wsdl file generated by my webservice is:
- <s:element name="fncDataTest">
<s:complexType />
</s:element>
- <s:element name="fncDataTestResponse">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="0" maxOccurs="1" name="fncDataTestResult">
- <s:complexType>
- <s:sequence>
<s:element ref="s:schema" />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>

MY QUESTION: I would like a schema presentation of the content of my DataSet, so that instead of the
<s:any /> tag, it should be something like:
<xs:element name="ErrorMessage" type="xs:string" minOccurs="0" />
<xs:element name="FirstName" type="xs:string" minOccurs="0" />
<xs:element name="LastName" type="xs:string" minOccurs="0" />

Is this possible to do dynamically, or do I have to edit the wsdl document manually?
Thanks in advance for your help. I am looking forward to hear your suggestions.

Jos

| [aspngwebservices] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngwebservices.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

| [aspngwebservices] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngwebservices.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives
Reply to this message...
 
 
System.Data.DataSet
System.Web.Services.WebService




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com