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 / General / May 2007

Tip: Looking for answers? Try searching our database.

newbie web services question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
troyboy - 26 May 2007 19:38 GMT
Hi I have created a simple web service using classes to pass data:

   [WebMethod(Description = "Test")]
   public double test(DataHere data)
   {
       return 3.5;
   }

   public class DataHere {
       [XmlElement (DataType="int")]
       public int myInt;
       public double myDouble;
   }

My question is how do I attach a schema to this so that I can restrict
myInt to have number from 5 to 10?

In my above example it is very easy to use vs2005 to use the web
service. VS even creates the DataHere class for the client. Can't the
client do some validation using a schema or do I have to validate on
the web service in the test method?

TroyBoy
Michael Nemtsev - 27 May 2007 09:45 GMT
Hello troyboy,

Read there http://msdn.microsoft.com/msdnmag/issues/03/07/XMLSchemaValidation/

---
WBR,  Michael  Nemtsev [.NET/C# MVP].  
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

t> Hi I have created a simple web service using classes to pass data:
t>
t> [WebMethod(Description = "Test")]
t> public double test(DataHere data)
t> {
t> return 3.5;
t> }
t> public class DataHere {
t> [XmlElement (DataType="int")]
t> public int myInt;
t> public double myDouble;
t> }
t> My question is how do I attach a schema to this so that I can
t> restrict myInt to have number from 5 to 10?
t>
t> In my above example it is very easy to use vs2005 to use the web
t> service. VS even creates the DataHere class for the client. Can't the
t> client do some validation using a schema or do I have to validate on
t> the web service in the test method?
t>
t> TroyBoy
t>

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.