8
Web Services How the application hosted on Microsoft server can talk to the application hosted on Unix How the .Net application can talk to java or php application XML is the standard language , any programming language can understand Using web services, consumer can call the service and send the input in XML format. web service responds to the call by sending response in XML format as both consumer and sender can understand XML How does the consumer know what the web service offers? What kind of input the web service is expecting? Using What protocol (http,smtp) consumer can call the web service? WSDL(Web Service Description Language) is an XML document that tells all the above things. We can think of it as a contract. If you want to use my service ,you have to send the input in the format described in WSDL. Contents of WSDL Types – define all inputs and outputs either in the wsdl or in xsd. Use of another XSD is preferred way. When you define in XSD, you have to import the xsd in the types section so that the elements defined in XSD are available in WSDL Messages – define input and output messages based on the elements from XSD. Message has a child element called part which has name and element. If an operation takes two unrelated parameters, you have to define two part elements.(More about style in binding) PortType- specifies all the operations and input and output messages for the operations. Can think of a Java class or PL/SQL package which specifies all the methods.

Web Services BASCIS

  • Upload
    anudeep

  • View
    213

  • Download
    0

Embed Size (px)

DESCRIPTION

This has all the basics of webservices

Citation preview

Page 1: Web Services BASCIS

Web Services

How the application hosted on Microsoft server can talk to the application hosted on Unix

How the .Net application can talk to java or php application XML is the standard language , any programming language can understand Using web services, consumer can call the service and send the input in XML format.

web service responds to the call by sending response in XML format as both consumer and sender can understand XML

How does the consumer know what the web service offers? What kind of input the web service is expecting? Using What protocol (http,smtp) consumer can call the web service?

WSDL(Web Service Description Language) is an XML document that tells all the above things. We can think of it as a contract. If you want to use my service ,you have to send the input in the format described in WSDL.

Contents of WSDL Types – define all inputs and outputs either in the wsdl or in xsd. Use of another

XSD is preferred way. When you define in XSD, you have to import the xsd in the types section so that the elements defined in XSD are available in WSDL

Messages – define input and output messages based on the elements from XSD. Message has a child element called part which has name and element. If an operation takes two unrelated parameters, you have to define two part elements.(More about style in binding)

PortType- specifies all the operations and input and output messages for the operations. Can think of a Java class or PL/SQL package which specifies all the methods.

Binding- specifies how the operations defined in PortType will actually be transmitted over the wire i.e protocols(HTTP GET, HTTP POST or SOAP).<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>Style specifies how the inputs and outputs of an operation are wrapped. When we use document style, all the input arguments should be wrapped under one. There should be at most one part element under message. When we specify rpc style we can have any number of arguments. Message can have more than one part.

Service specifies the end point i.e the location where the service is located.It is a Url.

Page 2: Web Services BASCIS
Page 3: Web Services BASCIS
Page 4: Web Services BASCIS

1. Create a WSDL for the following requirementMain Hospital wants to automate the patient appointment system. Small clinics can use this service to take an appointment or to cancel or to find out the status on behalf of their patients. Service name PatientAppointmentService.which offers the following operations

1. RegisterNewPatient : input:RegisterNewPatientRequest output: RegisterNewPatientResponse. See List1 for the schema definition.

2. CancelAppointment: input:AppointmentCancellationRequest output:AppointmentCacellationResponse. See List2 for the schema definition

3. getAppointmentStatus: input:AppointmentStatusRequest output:AppointmentStatusResponse. See List 3 for the schema.

Page 5: Web Services BASCIS

List 1:

Page 6: Web Services BASCIS

List 2:

List 3: