.NET (3) .rb (1) *.cod (1) 3110c (1) Algorithm (1) Amazon Cloud Drive (1) amkette (1) Android (1) Apex (6) apex:dynamic (1) API (1) API version (1) Application Development Contest (2) Artificial Intelligence (2) Atricore (1) b2g (1) Binary Search Tree (1) Blackberry Application Development (1) Blackberry Java Development Environment (1) Blender Game Engine (1) bluetooth (2) Boot2Gecko (1) bug fix (1) C (1) C++ (2) Cloud computing (1) Cloud Storage (1) Code Blocks (1) Code for a Cause (2) codejam (1) Coding (1) const_cast (1) Custom Help (1) Dancing With the Googlers (1) Data Structures (1) desktop environment (5) Doubly Linked List (1) Dropbox (1) dynamic visualforce component (1) dynamic_cast (1) Enterprise WSDL (1) Execution Context (1) fedora 14 (1) fedora 17 (5) Firefox OS (1) Flashing Nokia 3110c handset (1) (7) Gaia (1) Game Developement (1) GCC (2) GDG (2) Goank (1) Google (4) Google Developer Group (2) Google Drive (1) GTK+ (5) HACK2012 (2) Hall of Mirrors (1) help for this page (1) HTML5 (2) HTTP Web Server (1) IDE (1) Identity Provider (1) Intelligent Systems (1) Java (1) JDE (1) JOSSO (1) location based social network (1) (1) MinGW (1) Natural Language Processing (1) Natural Language Toolkit (1) neckphone (1) NLKT (1) Nokia Pheonix (1) Notebook (1) Numeric XML Tags (1) OAuth2.0 (1) OLPC (7) OLPC-XO-1 (7) One Laptop per Child (5) Override custom help (1) Paas (1) Partner WSDL (1) Polymorphism (1) programming contest (1) PyGTK (4) Python (10) Recycled Numbers (1) reinterpret_cast (1) Research (1) REST (1) RM-237 (1) Robotics (1) Ruby (1) Saas (2) (7) SDK (1) Service Provider (1) Single sign on (1) SOAP (3) Speaking in Tongues (1) SSO Agent (1) SSO Gateway (1) static_const (1) sugar (7) sugar activity (4) sugarlabs (7) SVG (2) Symbiotic AI (1) Tabbed container (1) TCP/IP (1) TCP/IP stack (1) Typecasting (1) typeid (1) ubuntu 13.10 (1) UDP (1) Upgrade Assembly (1) Visualforce (2) Web Server (1) Web Services (3) Web2.0 (1) wikipedia (1) wikipediaHI (1) WSDL (1) XML tags (1)

Sunday, July 1, 2012

Create SOAP based Web Service on Microsoft .NET Framework

Have you ever thought of sharing your functionality to outside world where someone like you would like to consume that functionality in his app ? How you have been doing that till sharing shared library or by dynamic link libraries or by sharing the actual code ? :) And how many times you got feedback asking to resolve compatibility issues due to language constraints? 

The best way to share your functionality/logic with others is through Web Services. W3C established two frameworks SOAP and REST for web services. They have defined the standard format in which two systems will interact using web services. 

The main differences between SOAP and REST based services:
  1. REST based services are light weight as compared to SOAP
  2. SOAP based services are secured as compared to REST. If you are creating a REST based service, then you need to explicitly take care of securing it.
  3. REST based services work closely with OAuth: the open authentication model that is followed by most Web2.0 apps.
  4. SOAP and REST based services accept input in XML and JSON format.
  5. REST based services provides response in XML and JSON. SOAP does the same but the response is wrapped within SOAP envelop with header and body.
In this post we will see how to create a web service in Microsoft .Net framework using Visual Basic language. 

NOTE: I have used Visual Studio 2010 for describing this.


1. Goto File>New Website> ASP.Net Empty Website.
2. Right click on solution in Solution explorer> click on Add New Item
3. Select Web Service, set its name as MyService.asmx and click ok:

4. Now you can see the web service "MyService.asmx" file and code file "MyService.vb" is added to solution

5. Double click on MyService.asmx to open it :
    I have written web service method "Greetings" as example. You can write your own web service method in similar manner. 

The important thing to keep in mind is that when you are publishing your web service make sure you set the appropriate namespace for your service. Currently it is by default value "". 

6. Hit Run(F5) to start Cassini( your local web server that comes with VS). This will take you to the service description page where service is available for consumption:

7. Click on the service name "Greetings" to open the page from where you can test the web service:

Enter the name parameter and hit "Invoke" button and see the result :

8. You can hit navigate to the URL : http://localhost:30149/WebSite1/MyService.asmx?WSDL 
to view the WSDL file for this service:

You may then share this WSDL with the consumer of your service. Then it is very easy to generate the client using WSDL to invoke the service.

I hope you find this post helpful in understanding how to create SOAP based web services on the fly with .Net framework.



Uoptutorial said...

Thanks for sharing fabulous information. It' s my pleasure to read it.I have also bookmarked you for checking out new posts. by HRM 531 Entire Course

Minal Kapoor said...

I really like this amazing and helpful post,.
Hi, I do think this is an excellent web site. I book marked it.
Seo Company Nagpur


Much obliged for a such wonderfull blog yours...!
Graphic Web Design Company in Delhi

Mithun Mithun said...

Thanks for your informative articel .its very useful
best dot net training in chennai | dot net training in chennai | dot net training and placement in chennai

Karthika Shree said...

Wonderful bloggers like yourself who would positively reply encouraged me to be more open and engaging in commenting.So know it's helpful.
Dot Net Training in Chennai

Priya Kannan said...

Usually I do not read post on blogs, but I would like to say that this write-up very forced me to try and do it! Your writing style has been surprised me. Great work admin.Keep update more blog.
Dot Net Training in Chennai

Vamshi Krishna said...

Hai Author, Very Good informative blog post,
Thanks for Sharing

Shine Handicraft said...

Very nice...thanks
Very nice tutorial and nice blog about web services...thanks

Words Doctorate said...

I read this article. I think You put a lot of effort to create this article. I appreciate your work.
thesis Writing Service

Meta Forum said...

Great post , Thanks for sharing with us.

Web Designing Training in Chennai

Augurs Technologies Pvt Ltd. said...

SOAP Web Services India, Soap Web Services Annotations India

mounika said...

Thanks for sharing, It 's excellent post
.Net Online Training

pooja saravanan said...

Thanks for one marvelous posting! I enjoyed reading it; you are a great author. I will make sure to bookmark your blog and may come back someday. I want to encourage that you continue your great posts, have a nice weekend!

MEAN stack training in Chennai

MEAN stack training in bangalore

MEAN stack training in tambaram

MEAN stack training in annanagar

johnsy sai said...

The knowledge of technology you have been sharing thorough this post is very much helpful to develop new idea. here by i also want to share this.

Devops Training in pune

Devops training in tambaram
Devops training in velachery
Devops training in annanagar
DevOps online Training

digi mark said...

Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.

rpa training in Chennai

rpa training in anna nagar | rpa training in marathahalli

rpa training in btm | rpa training in kalyan nagar

rpa training in electronic city | rpa training in chennai

rpa online training | selenium training in training

Mouni yoga said...

We are a group of volunteers and starting a new initiative in a community. Your blog provided us valuable information to work on.You have done a marvellous job!
python training institute in chennai
python training in velachery
python training institute in chennai

sudha P said...

It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...

java training in chennai | java training in bangalore

java online training | java training in pune

Anoushka Sakthi said...

Amazing post. It will be very helpful for beginners like me. Thank you very much for this kind of post.Waiting for your next blog.
French Classes in Chennai
French Course in Chennai
French Language Classes in Chennai
French Training Institutes in Chennai
French Class in Chennai
French Training
French Training in Chennai

mounika r said...

Thanks for sharing this info
Dot Net Online Training Hyderabad

shalinipriya said...

Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
Data Science training in rajaji nagar | Data Science with Python training in chenni
Data Science training in electronic city | Data Science training in USA
Data science training in pune | Data science training in kalyan nagar

sathya shri said...

This is very good content you share on this blog. it's very informative and provide me future related information.
angularjs-Training in velachery

angularjs Training in bangalore

angularjs Training in bangalore

angularjs Training in btm

angularjs Training in electronic-city

sandy star said...

Hello! This is my first visit to your blog! We are a team of volunteers and starting a new initiative in a community in the same niche. Your blog provided us useful information to work on. You have done an outstanding job.

Best AWS Training in Chennai | Amazon Web Services Training in Chennai

AWS Training in Bangalore | Amazon Web Services Training in Bangalore

AWS Training in Pune | Best Amazon Web Services Training in Pune

Amazon Web Services Training in OMR , Chennai | Best AWS Training in OMR,Chennai

Dwarakesh babu said...

Hello! This is my first visit to your blog! We are a team of volunteers and starting a new initiative in a community in the same niche. Your blog provided us useful information to work on. You have done an outstanding job.

AWS Training in Bangalore | Amazon Web Services Training in Bangalore

AWS Interview Questions And Answers

Learn Amazon Web Services Tutorial |AWS Tutorials For Beginners

Amazon Web Services Training in OMR , Chennai | Best AWS Training in OMR,Chennai

AWS Training in Chennai |Best Amazon Web Services Training in Chennai

Anoushka Sakthi said...

Its my great pleasure to be here on your article!! for sure ill be back to read the next blog of yours.
Selenium Training in Chennai
software testing selenium training
ios developer course in chennai
French Classes in Chennai
cloud computing training centers in chennai
cloud computing training institutes in chennai

Vicky Ram said...

Thanks for sharing this valuable information.Its more useful to us.its very interesting to know the blog with clear vision.

Guest posting sites

Tez Host said...

Thanks for sharing a useful information.
Web Hosting in Pakistan

anusha said...

Selenium Training in Chennai Searching for Best Selenium Training in Chennai ?.BITA Academy is the Best Selenium Training Institute in Chennai.. Our Selenium testing course is taught by Experts.Become a Selenium Certified Professional.