Beruflich Dokumente
Kultur Dokumente
=====================
First, a Web service can have a public interface, defined in a common XML gramma
r. The interface describes all the methods available to clients and specifies th
e 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 mech
anism for you to publish this fact. Likewise, there should be some simple mechan
ism for interested parties to locate the service and locate its public interface
. The most prominent directory of Web services is currently available via UDDI (
Universal Description, Discovery, and Integration).
Behind the scenes, it ties together SOAP, WSDL, and UDDI to provide a simple plu
g-and-play interface for finding and invoking Web services.
The Web service protocol stack is an evolving set of protocols used to define, d
iscover, and implement Web services. 4 layers
Service Transport: This layer is responsible for transporting messages between a
pplications. Currently, this includes HTTP, SMTP, FTP
XML Messaging: This layer is responsible for encoding messages in a common XML f
ormat 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 interfa
ce to a specific Web service. Currently, service description is handled via the
WSDL
Service Discovery: This layer is responsible for centralizing services into a co
mmon registry, and providing easy publish/find functionality. Currently, service
discovery is handled via the UDDI.
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 i
n the body of the HTTP response.
Example (XML-RPC)
=================
<methodCall>
<methodName>weather.getWeather</methodName>
<params>
<param><value>10016</value></param>
</params>
</methodCall>
=========================
<methodResponse>
<params>
<param>
<value><int>65</int></value>
</param>
</params>
</methodResponse>
==========================
Example SOAP
=============
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:getWeather
xmlns:ns1="urn:examples:weatherservice"
SOAP-ENV:encodingStyle=" http://www.w3.org/2001/09/soap-encoding
<zipcode xsi:type="xsd:string">10016</zipcode>
</ns1:getWeather>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
==========================
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:getWeatherResponse
xmlns:ns1="urn:examples:weatherservice"
SOAP-ENV:encodingStyle="http://www.w3.org/2001/09/soap-encoding">
<return xsi:type="xsd:int">65</return>
</ns1:getWeatherResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
===========================
WSDL Example
=============
In a nutshell, WSDL is an XML grammar for specifying a public interface for a We
b service.
Contains information on all publicly available functions.
Data type information for all XML messages.
Binding information about the specific transport protocol to be used.
Address information for locating the specified service.
============================
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="WeatherService"
targetNamespace="http://www.ecerami.com/wsdl/WeatherService.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.ecerami.com/wsdl/WeatherService.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<message name="getWeatherRequest">
<part name="zipcode" type="xsd:string"/>
</message>
<message name="getWeatherResponse">
<part name="temperature" type="xsd:int"/>
</message>
<portType name="Weather_PortType">
<operation name="getWeather">
<input message="tns:getWeatherRequest"/>
<output message="tns:getWeatherResponse"/>
</operation>
</portType>
<binding name="Weather_Binding" type="tns:Weather_PortType">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getWeather">
<soap:operation soapAction=""/>
<input>
<soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:examples:weatherservice"
use="encoded"/>
</input>
<output>
<soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:examples:weatherservice"
use="encoded"/>
</output>
</operation>
</binding>
<service name="Weather_Service">
<documentation>WSDL File for Weather Service</documentation>
<port binding="tns:Weather_Binding" name="Weather_Port">
<soap:address
location="http://localhost:8080/soap/servlet/rpcrouter"/>
</port>
</service>
</definitions>
================
UDDI
====
First, UDDI is a technical specification for building a distributed directory of
businesses and Web services. Data is stored within a specific XML format, and t
he UDDI specification includes API details for searching existing data and publi
shing new data.
Second, the UDDI Business Registry is a fully operational implementation of the
UDDI specification. The UDDI registry now enables anyone to search existing UDDI
data. It also enables any company to register themselves and their services.
The data captured within UDDI is divided into three main categories:
White Pages: This includes general information about a specific company. For exa
mple, business name, business description, and address.
Yellow Pages: This includes general classification data for either the company o
r the service offered. For example, this data may include industry, product, or
geographic codes based on standard taxonomies.
Green Pages: This includes technical information about a Web service. Generally,
this includes a pointer to an external specification, and an address for invoki
ng the Web service.
==================================================================
List searchResult = (List) request.getAttribute("searchResult");
for(Iterator itr = searchResult.iterator(); itr.hasNext();) {
roseindia.net.dao.hibernate.Tutorial tutorial =(roseindia.net.dao.hibernate.
Tutorial)itr.next();
}
class Test{
public static void main(String[] args)throws Exception{
for(int i=0;i<args.length;i++){
System.out.println(s);
}
A class with static members is known as a static class. In such cases, before a
class instance is created, an object of its class will also be created by the JV
M. The class object is allocated to the heap itself. The primordial class loader
will load the class object.
memory leaks
what is major concepts in oops.
ans:Abstraction,polymorphism,encapsulation,inheritance
48.what is implicit object.
ans:Implicit objects are a set of Java objects that the JSP Container makes avai
lable to developers in each page
49.how many implicit objects in jsp
ans:out,page,session,request,response,application,page context,config
-------------------------HOW STRUTS WORK
--------------A client requests a path that matches the Action URI pattern.
The container passes the request to the ActionServlet.
The ActionServlet selects the appropriate module,looks up the mapping for the pa
th, the mapping specifies a form bean, the ActionServlet creates one after valid
ation.If a form bean is there, the ActionServlet resets and populates it from th
e HTTP request.
If the mapping has the validate property set to true, it calls validate on the f
orm bean.
If it fails, the servlet forwards to the path specified by the input pro
perty and this control flow ends.
If the mapping specifies an Action type, it is reused if it already exists or in
stantiated.
The Action s execute method is called and passed the instantiated form bean (or nu
ll).
The Action may populate the form bean, call business objects, and do whatever el
se is needed.
DataAccessException - org.springframework.dao.DataAccessException