In this exercise you must find the limitations of WCF web services: What is possible, and what is not possible?
Make a simple method int Add(int a, int b) to add the number a + b
Add another method Divide(int a, int b).
What happens if b=0?
Add another method
This method must throw an exception if the number is 0, otherwise it returns the number as it is.
Make another method double Add(double a, double b)
That is, another method with the same name as a the previous method.
Is is possible to use static methods with web services?
In C# you can mark method parameters ref or out.
Is that possible in web services? How does it work?
When is it "interesting" to use ref or out parameters to web service methods?
Can you make properties (C# syntax) in SOAP services (in the interface that defines the service)?
Make methods to check which collections are allowed SOAP methods as parameters and return types:
All methods come in an ordinary version + an async version.
Try both of them.
What is the difference?
Make a composite type: Class Student with a few properties + methods
Use the composite type as a parameter + return type in another WCF method.
Any requirements on the composite type: Public set on properties, parameter less constructor, etc.?
Composite type with a collection: Student with a collection of phone numbers
Collection of composite type objects.
Add two method to the service provider:
How does it work?
Will the keyword static
on the field, help you?