What is XML-RPC?What is the Web service protocol stack?I keep reading about Web services, but I have never actually seen one. Can you show me a real Web service in action?What is a Web service?What does 403 Forbidden mean?What is DNS?What is SSL? How SSL Works ?What is the difference between a web browser and a web server?What is a web server? How Web Servers Work?What is .htaccess? ~ Interview Questions & Answers

Wednesday, February 9, 2011

What is XML-RPC?

XML-RPC is a protocol that uses XML messages to perform Remote Procedure Calls. Requests are encoded in XML and sent via HTTP POST; XML responses are embedded in the body of the HTTP response.
More succinctly, XML-RPC = HTTP + XML + Remote Procedure Calls.
Because XML-RPC is platform independent, diverse applications can communicate with one another. For example, a Java client can speak XML-RPC to a Perl server.
To get a quick sense of XML-RPC, here is a sample XML-RPC request to a weather service (with the HTTP Headers omitted):
<?xml version="1.0" encoding="ISO-8859-1"?>
<methodCall>
<methodName>weather.getWeather</methodName>
<params>
<param><value>10016</value></param>
</params>
</methodCall>
The request consists of a simple element, which specifies the method name (getWeather) and any method parameters (zip code).
Here is a sample XML-RPC response from the weather service:
<?xml version="1.0" encoding="ISO-8859-1"?>
<methodResponse>
<params>
<param>
<value><int>65</int></value>
</param>
</params>
</methodResponse>
The response consists of a single element, which specifies the return value (the current temperature). In this case, the return value is specified as an integer.
In many ways, XML-RPC is much simpler than SOAP, and therefore represents the easiest way to get started with Web services.
The official XML-RPC specification is available at XML-RPC.com. Dozens of XML-RPC implementations are available in Perl, Python, Java, and Ruby. See the XML-RPC home page for a complete list of implementations.

What is the Web service protocol stack?

The Web service protocol stack is an evolving set of protocols used to define, discover, and implement Web services.
The core protocol stack consists of four layers:
Service Transport: This layer is responsible for transporting messages between applications. Currently, this includes HTTP, SMTP, FTP, and newer protocols, such as Blocks Extensible Exchange Protocol (BEEP).
XML Messaging: This layer is responsible for encoding messages in a common XML format so that messages can be understood at either end. Currently, this includes XML-RPC and SOAP.
Service Description: This layer is responsible for describing the public interface to a specific Web service. Currently, service description is handled via the WSDL.
Service Discovery: This layer is responsible for centralizing services into a common registry, and providing easy publish/find functionality. Currently, service discovery is handled via the UDDI.
Beyond the essentials of XML-RPC, SOAP, WSDL, and UDDI, the Web service protocol stack includes a whole zoo of newer, evolving protocols. These include WSFL (Web Services Flow Language), SOAP-DSIG (SOAP Security Extensions: Digital Signature), and USML (UDDI Search Markup Language).
Fortunately, you do not need to understand the full protocol stack to get started with Web services. Assuming you already know the basics of HTTP, it is best to start at the XML Messaging layer and work your way up.

I keep reading about Web services, but I have never actually seen one. Can you show me a real Web service in action?

If you want a more intuitive feel for Web services, try out the IBM Web Services Browser, available on the IBM Alphaworks site. The browser provides a series of Web services demonstrations. Behind the scenes, it ties together SOAP, WSDL, and UDDI to provide a simple plug-and-play interface for finding and invoking Web services. For example, you can find a stock-quote service, a traffic-report service, and a weather service. Each service is independent, and you can stack services like building blocks. You can, therefore, create a single page that displays multiple services--where the end result looks like a stripped-down version of my.yahoo or my.excite.

What is a Web service?

A web service is any piece of software that makes itself available over the Internet and uses a standardized XML messaging system.
XML is used to encode all communications to a Web service.
For example, a client invokes a Web service by sending an XML message, then waits for a corresponding XML response. Because all communication is in XML, Web services are not tied to any one operating system or programming language--Java can talk with Perl; Windows applications can talk with Unix applications.
Beyond this basic definition, a Web service may also have two additional (and desirable) properties:
First, a Web service can have a public interface, defined in a common XML grammar. The interface describes all the methods available to clients and specifies the signature for each method. Currently, interface definition is accomplished via the Web Service Description Language (WSDL).
Second, if you create a Web service, there should be some relatively simple mechanism for you to publish this fact. Likewise, there should be some simple mechanism for interested parties to locate the service and locate its public interface. The most prominent directory of Web services is currently available via UDDI, or Universal Description, Discovery, and Integration.
Web services currently run a wide gamut from news syndication and stock-market data to weather reports and package-tracking systems. For a quick look at the range of Web services currently available, check out the XMethods directory of Web services.

What does 403 Forbidden mean?

403 Forbidden is the HTTP status code produced by a web server when you are not permitted to access a particular URL. Usually a 403 Forbidden error means that the page in question does exist but cannot be accessed by you.
Some websites are locked down so that only those on the local company or school network can access parts of the site. You will often see 403 Forbidden errors when browsing such sites from "off-campus."
 
Sometimes webmasters try to set up dynamic web programming features like PHP or Perl/CGI but fail to do so correctly. This can also result in 403 Forbidden errors until the web server is correctly configured.
 
403 Forbidden can appear in other situations at the discretion of the webmaster, so you may see it in scenarios other than these.

What is DNS?

Every time you follow a link or type in the name of a website, such as www.scriptscart.com, that name must be translated into an IP address on the Internet. This translation is done by the domain name system.
A DNS server is a program that participates in the task of providing this service. Some DNS servers respond to queries from web browsers and other programs, make further inquiries, and return IP addresses, such as 208.27.35.236. Other DNS servers have primary responsibility for answering DNS inquiries about names within a particular domain, such as the scriptscart.com domain. Every time a new domain is registered, a DNS server must be configured to give out address information for that domain, so that users can actually find websites in that domain. In most cases, web hosting companies provide this service for the domains that they host; it is rare for webmasters to run their own DNS servers.

What is SSL? How SSL Works ?

SSL (Secure Sockets Layer), also known as TLS (Transport Layer Security), is a protocol that allows two programs to communicate with each other in a secure way. Like TCP/IP, SSL allows programs to create "sockets," endpoints for communication, and make connections between those sockets. But SSL, which is built on top of TCP, adds the additional capability of encryption. The HTTPS protocol spoken by web browsers when communicating with secure sites is simply the usual World Wide Web HTTP protocol, "spoken" over SSL instead of directly over TCP.
In addition to providing privacy, SSL encryption also allows us to verify the identity of the party we are talking to. This can be very important if we don't trust the Internet. While it is unlikely in practice that the root DNS servers of the Internet will be subverted, a "man in the middle" attack elsewhere on the network could substitute the address of one Internet site for another. SSL prevents this scenario by providing a mathematically sound way to verify the other program's identity. When you log on to your bank's website, you want to be very, very sure you are talking to your bank!
SSL provides both privacy and security using a technique called "public/private key encryption" (often called "asymmetric encryption" or simply "public key encryption").
A "public key" is a string of letters and numbers that can be used to encrypt a message so that only the owner of the public key can read it. This is possible because every public key has a corresponding private key that is kept secret by the owner of the public key.

What is the difference between a web browser and a web server?

A web browser is what you're probably looking at right now: a program on yourcomputer that shows you stuff that's on the web. A web server is a program on a server computer, somewhere out on the Internet, that delivers web pages to web browsers.
The term web server also refers to an actual, physical computer that is running web server software.

What is a web server? How Web Servers Work?

A web server is a computer program that delivers (serves) content, such as web pages, using the Hypertext Transfer Protocol (HTTP), over the World Wide Web. The term web server can also refer to the computer or virtual machine running the program.
In large commercial deployments, a server computer running a web server can be rack-mounted with other servers to operate a web farm.
The primary function of a web server is to deliver web pages to clients. This means delivery of HTML documents and any additional content that may be included by a document, such asimages, style sheets and JavaScripts.
A client, commonly a web browser or web crawler, initiates communication by making a request for a specific resource using HTTP and the server responds with the content of that resource, or an error message if unable to do so. The resource is typically a real file on the server's secondary memory, but this is not necessarily the case and depends on how the web server is implemented.

What is .htaccess?

.htaccess is an extension of the Directory Hierarchy that serves to enable users to set directives for themselves, subject to permissions (AllowOverride) set up by the server administrator.