473,480 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Validating parameters to Web Service

Has .NET any XML-based validation framework or tool classes to validate
parameters passed to an Web Service?

I need only couple of types validation
- is parameter passed to Web Service method empty
- does parameter belong to certain value set which is mentioned
earlier somewhere in XML files.
So, very simple validation.

Cheers!
Jan 4 '06 #1
1 3597
Hi Jackie,
Has .NET any XML-based validation framework or tool classes to validate
parameters passed to an Web Service?

I need only couple of types validation
- is parameter passed to Web Service method empty
- does parameter belong to certain value set which is mentioned
earlier somewhere in XML files.


Unfortunately, the Framework won't make these types of checks for you. It
can throw an exception if a parameter is of wrong type (for example, a
string instead of an integer), but other than that, you would need to check
the parameters yourself.

Checking for an empty string for example is very simple, but matching
against a list of values required some more lines of code. The exact code
would of course depend on your XML file format, etc. One way to read your
XML files would be to use the XmlTextReader class. This is a good solution
of your XML files are very simple.

Hope this helps.

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
ja***@removethis.dystopia.fi
http://www.saunalahti.fi/janij/
Jan 6 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3610
by: Shazad | last post by:
I am creating a windows service that requires parameters to start. The service Startup Type is set to automatic therefore it starts when the computer is started or rebooted. However the service...
5
2432
by: sourabh | last post by:
Hi I have a basic qus. I am writing a middle-tier component. I have constructor which takes 3 inputs, here's how it looks internal ClassName(Database dbToUse, Int64 pk,DateTime Date) { } ...
1
1445
by: Jackie W | last post by:
Has .NET any XML-based validation framework or tool classes to validate parameters passed to an Web Service? I need only couple of types validation - is parameter passed to Web Service method...
1
649
by: Cesar | last post by:
Hello, I've developed a .NET C# web service; which has one method named, let's say, upload_your_data. This method has one parameter ( string your_data). The value that this parameter will...
0
3853
by: oolon | last post by:
Hy, I have to build a report. this report has to be call by a web service. My method to call this report is : public void Amende( string dossierId ) { ReportingService...
10
3900
by: amazon | last post by:
Our vender provided us a web service: 1xyztest.xsd file... ------------------------------------ postEvent PostEventRequest ------------------------------------- authetication authentication...
3
5462
by: =?Utf-8?B?UGllcnJl?= | last post by:
Hello, I have a .NET 2.0 web service that is consumed by a Delphi application. The Delphi application calls a method from the .NET web service with parameters. Theses parameters are in the...
0
2811
by: =?ISO-8859-1?Q?Jan_Thom=E4?= | last post by:
Hi, I've been trying like a madman to make my WSDL work with .net, but it seems I am out of luck. Whenever I add a service reference to Visual C#, the code gets generated fine, however all...
5
6681
by: satyabhaskar | last post by:
hi all, In my web page i have created radio buttons dynamically on to the page .....following is my code string Course, Semester, Section; int rowsCount; string con =...
0
7037
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7076
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5321
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4471
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2990
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.