Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / September 2004

Tip: Looking for answers? Try searching our database.

XSD Datatypes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dominick Baier - 12 Sep 2004 10:36 GMT
hi,

the .net tools are not really suited for that kind of approach, which is called ContractFirst. but it is possible.

first you have to generate some .net types from the schema your webservice has to conform to. use the xsd.exe tool included in the sdk with the /classes switch.

use the generated classes as input and return types.

you can further customize the data that goes on the wire with the XmlSerializer attributes, e.g. XmlElement, XmlAttributes and so on. You can also use the [return:...] attribute to customize the return element name. Also take a look in ParameterStyle.Bare...

this should get you started.

---
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

  nntp://news.microsoft.com/microsoft.public.dotnet.framework.webservices/<143A0680-F736-4363-9323-77504A08DDB7@microsoft.com>

I am developing a webservice which is required to conform to a specific
schema definition, in terms of input and return parameters. If I set an
xmlelement data type to the reuired type name from my schema, I get an error
regarding the fact that the type is not recognized. How do i tell the
webservice to use a specific XSD to validate the input paramaeters, or do i
have to do the validation seperately and creat a WSDL manually.

Thanks in advance
--
Mark Compton
Autumn Consulting

[microsoft.public.dotnet.framework.webservices]
Girish Bharadwaj - 14 Sep 2004 20:45 GMT
http://www.thinktecture.com/resources/software/wscontractfirst/default.html
There is a nice little addin for this approach.

Also, http://apps.gotdotnet.com/xmltools/xsdobjgen/ has a neat tool that
generates C# or VB classes that will generate the exact data as the XSD
specifies.

Signature

Girish Bharadwaj
http://msmvps.com/gbvb

> hi,
>
>  the .net tools are not really suited for that kind of approach, which is called ContractFirst. but it is possible.
>
>  first you have to generate some .net types from the schema your webservice has to conform to. use the xsd.exe tool included in the sdk with
the /classes switch.

>  use the generated classes as input and return types.
>
>  you can further customize the data that goes on the wire with the XmlSerializer attributes, e.g. XmlElement, XmlAttributes and so on. You can
also use the [return:...] attribute to customize the return element name.
Also take a look in ParameterStyle.Bare...

>  this should get you started.
>
>  ---
>  Dominick Baier - DevelopMentor
> http://www.leastprivilege.com

nntp://news.microsoft.com/microsoft.public.dotnet.framework.webservices/<143A0680-F736-4363-9323-77504A08DDB7@microsoft.com>

>  I am developing a webservice which is required to conform to a specific
>  schema definition, in terms of input and return parameters. If I set an
[quoted text clipped - 9 lines]
>
>  [microsoft.public.dotnet.framework.webservices]

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.