Creating Basic WCF web service using C# .Net
We can create WCF Web service for communicating the Any
Application with different resources from internet protocols .A web service is
a web application which is basically a class consisting of methods that could
be used by other applications. It also follows a code-behind architecture such
as the ASP.NET web pages, although it does not have a user interface.
This is the most important thing about the of Web Services. Web Services typically work
outside of private networks, offering developers a non-proprietary route to
their solutions. Services developed are likely, therefore, to have a longer
life-span, offering better return on investment of the developed service. Web
Services also let developers use their preferred programming languages. In
addition, thanks to the use of standards-based communications methods, Web
Services are virtually platform-independent
Web Services provide not a component-based model of
application development, but the closest thing possible to zero-coding
deployment of such services. This makes it easy to reuse Web Service components
as appropriate in other services. It also makes it easy to deploy legacy code
as a Web Service.
Web Services allow the business logic of many different
systems to be exposed over the Web. This gives your applications the freedom to
chose the Web Services that they need. Instead of re-inventing the wheel for
each client, you need only include additional application-specific business
logic on the client-side. This allows you to develop services and/or
client-side code using the languages and tools that you want.
Web Services provide not a component-based model of application
development, but the closest thing possible to zero-coding deployment of such
services. This makes it easy to reuse Web Service components as appropriate in
other services. It also makes it easy to deploy legacy code as a Web Service.
There are following easy steps to create a basic wcf web
service through in C# in visual studio 2017
File => New Project
Visual C# => WCF =>WCF Service Library
Click OK
Visual Studio automatically generate an interface and Class
Remove all Codes that Visual Studio generate automatically
and ADD four Arithmetic Operation Method only signature not full body in
interface
Implement the interfaces method in Service1 Class
After Implementing Interface your Class would be like this
Now define functionalities of Methods
Now Build and run the
project Test Client Should show like this
Clikc on AddNumbers give parameter of values a and b click
invoke
Now your web service has been created in the next article we
are going to show you how to host web service and consuming web service.. Thank
you :)









Comments
Post a Comment