webservices.ppt
TRANSCRIPT
Web Services
Webservice is Distributed & Interoperable technology.
Types of WS:
Soap Based – Used for heavy weight machines
Restful -Used for lightweight application.
Android developers use Restful only.
Web Services
Web Services components• SOAP• WSDL• UDDI
Language (XML/JSON)Medium (Internet)Protocol (HTTP)
WSDL (Webservice Description Language):
• WSDL• Gives the complete description about the Project in XML format.
WSDL
Consumer Provider
getInfo(----) { --------- --------- }
SOAP
SOAP is an XML file classified into 2 parts.
<header> -meta info,authentication<body>
UDDI
• UDDI-Universal Description Discovery and Integration• Is a centralized repository to hold the WSDLs.
UDDI
WSDL
WSDL
WSDL
WSDL WSDL
oGo and Search in UDDI for WSDL.
XML - Textual DB,
Transfer the Data,
Deployment Descriptors.
Rules are provided to an XML file using….
• DTD
•XSD
XML
XML Parsers:
JAXP -- DOM CURD
SAXReadonly
JAXB -- Android does not support JAXB.
DOM:•DOM(Document Object Model) is a methodology to parse
Java object to XML.
•Maintains data in tree structure.
Work with DOM parser:
Step1:Create Document Builder Factory Object.
Step2:Create Document Builder object.
3: Document .
4: Element root
5: Element child root
6: Text Node
7: Transformer Factory
8: Transformer - transform(source,Dest);
<student> sid.appendChild(n1)
<sid>123<sid> sname.appendChild(n2)
<sname>AAA<sname>
</student> student.appendChild(sid);
student.appendChild(sname);
Web Services & Android:
Request Headers: GET,POST
To interact with webservice:
Default HttpclientHttpGetHttpResponseInputstream