Copy Experiment 2
Copy Experiment 2
NetBeans IDE v8.0.2, Glassfish Server, Java Development Kit, Web Browser
3. Theory:
WSDL stands for Web Service Description Language. WSDL is written in XML and is used to
describe Web Services. A WSDL document defines services as collections of network
endpoints, also known as ports. In WSDL, the abstract definition of endpoints and messages is
separated from their concrete network deployment or data format bindings. This allows the
reuse of abstract definitions: messages, which are abstract descriptions of the data being
exchanged, and port types which are abstract collections of operations. The concrete protocol
and data format specifications for a particular port type constitutes a reusable binding. A port is
defined by associating a network address with a reusable binding, and a collection of ports
define a service. Hence, a WSDL document uses the following elements in the definition of
network services:
Types– a container for data type definitions using some type system (such as XSD).
Message– an abstract, typed definition of the data being communicated.
Operation– an abstract description of an action supported by the service.
Port Type–an abstract set of operations supported by one or more endpoints.
Binding– a concrete protocol and data format specification for a particular port type.
Port– a single endpoint defined as a combination of a binding and a network address.
Service– a collection of related endpoints.
i. Click on files in top left corner and choose new project. Choose “Java Web” as
category and “Web Application” as project. Enter a project name of your choice. You
need not change anything else and just finish creating the project.
ii. Once the project is created, right click on your project, choose New->Web Service.
Give the Web Service a suitable name, and choose the package as “si.com”. Finish
creating the Web Service.
iii. Now go to Projects->Web Services->NewWebService. Create a new operation named
sum with two integer parameters, that returns sum of both the parameters.
iv. Now run the Web Application. To run the Web Application, right click->Build,
followed by right click->Deploy, followed by right click->Run.
v. A web server is deployed at your local system. Go to localhost:8080. Click on the first
link, i.e., “go to administration console”.
vi. Click on Applications in left hand side list and open the Web Application we created.
Scroll down and click on the last link, i.e., “View Endpoint”.
vii. Click on the Tester link, and click on the test link. Enter the two numbers in the text
box and click on sum button. You will get a sum method invocation and the SOAP
Request and Response accordingly.
Notice that the SOAP request and response is in XML.
5. Output:
Evaluation Grid (To be created as per the SOP and Assessment guidelines by the faculty):