Plz. help me in this concern. I have gone through books still i'm not able to understand it. Always i have been rejected in all interview due to this. plz. tell me what are the basic questions on web service. thanks
blah blah blah is here! blah blah » Close
1 answers
Web Services are VERY simple. Don't make them more complicated than they are.
A web service is just a piece of logic, that resides on a web server, that is called from another application (doesn't matter what kind, or where, or what language).
You can write web services in .NET, Java, or just about any other web based language you want. Though, .NET and Java have at least been standardized.
To create a web service, you simply create a new Web Service project in Visual Studio .NET, OR, you can add a web service to an existing ASP.NET application. It's just a file with a .ASMX file extension.
Once the web service is created, you have to expose the functionality you need. So, you create methods that get exposed in your web service.
The WebService class that you create extends System.Web.Services.WebService. Then, the method to expose the functionality of the web service is marked [WebMethod]. This identifies that method as a method to be exposed.
So. Let's say you are writing an app for a sun glasses manufacturer. They want to be able to give ALL their resellers information on inventory levels, no matter what platform their resellers are using. Web Services fit this scenario VERY well.
You would create the WebService, called, Inventory.
Then, you would create the function, called GetInventoryLevel, which would accept an Integer to identify the type of inventory to get. The implementation might look like this.
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
namespace InventoryWebService
{
[WebService(Namespace="http://tempuri.org/ ")]
public class Inventory : System.Web.Services.WebService
{
[WebMethod]
public int GetInvetoryLevel(int Identity)
{
int ReturnLevel = -1;
//go talk to the database to get the inventory level
//for the item corresponding to that identity
return ReturnLevel;
}
}
}
So, that's how web services work. You can use them for all kinds of cool things. Your imagination is the limit.
It's basically a way to do web based distributed programming.
Cheers,
Pathogen
answered 2 years ago by:
0
Ok let me tell u in even simple words.Suppose u r doing a project which includes calculating interest for a certian amount.Then u write that kinda of functions ina webservice and add a webreference to ur project.So by this u can simply call the method on the webservice just by creating a instance of it.Thats it its ur webservice.Coming to the interview part learn the tutorials of SOAP in http://w3schools.com.
answered 2 years ago by:
0
hi pal,
Although i have not worked extensively on web services but i have done (POC) in web services.
It can be as simple explanation as web service can be treated as a class whose object u create and then use it in the program .
But the catch is the class is not in your system but hosted all over the internet.If u want u can use them
Now there is a lot of talks about the web service being language independent.
It is true
Let me concentrte on Two technologies
1>Microsoft C#
2>Sun java
U can make the webservice and the client really fast and in ease with the Microsoft technologies.
Also u can make the client for the sun java technoloy webservice really at ease .
But the same cannot be said about sun java.For sun java u got to import some two three packages to make a webservice run on the server(Tomcat)Making the webservce code is also quit simple just take any java file that is working take the <Filename>.java and rename it as <FileName>.jws (jws stands for java web service).
And put it in the appropriate folder .This will host the web service.
As i said earlier the client for this web service can be made really fast and with ease in .Net environment but not so in the java
Unlike .Net there is no single java version we have sun java ,Ibm implementation of java .. like that
These tips are only start up that can help u think what the technology are and how are they behaving in the real world
Hope they helped u out
regards
aryasheel
answered 2 years ago by:
0
This post was imported from csharpfriends, if you have a similiar question please ask it again.
All previous members have been migrated, hope you enjoy the new platform!