Web services and mobile technology by qjk18715

VIEWS: 9 PAGES: 22

									          MAS
          Web services and mobile technology

•   Format:
•   Pre-amble
•   What is a web service?
•   Web services technology
•   Web services for mobiles
    – Why?
    – Support
• Conclusion

Version 1.0           j.c.westlake@staffs.ac.uk      Slide 1
                     y.j.f.cartwright@staffs.ac.uk
April 2007
          MAS
                     Pre-amble
• How to get into this subject
• Not required for the assignment
    – No code examples on schedule
    – Yet to be exercised by me
• An exam topic however




Version 1.0           j.c.westlake@staffs.ac.uk      Slide 2
                     y.j.f.cartwright@staffs.ac.uk
April 2007
           MAS
           What is a web service?
•   “definition”
•   discrete, stand-alone, but highly interoperable business function.
     –   cross application, cross-platform and cross-network business processes
     –   Custom
     –   openly available web services available on the internet that can be embedded into your
         applications to provide new functionality to your user
           •   Oasis
           •   W3c and this from the W3C
     –   A web service adheres to collection of protocols and standards used for exchanging
         data between applications.

     –   Web Services can also form the basis of a Service Oriented Architecture
•   See http://en.wikipedia.org/wiki/Web_service
•   See http://www.w3schools.com/ngws/ngws_webservices.asp

•   Not to confused with web-based services
     –   Example http://www.ukoln.ac.uk/services/treasure/




Version 1.0                                 j.c.westlake@staffs.ac.uk                Slide 3
                                           y.j.f.cartwright@staffs.ac.uk
April 2007
          MAS
          Web services technology
• Web services – Service Oriented
  Architectures
    – Google
          • http://code.google.com/
          • Example Web Service using Google (non-mobile)
    –   Nokia
    –   IBM
    –   Microsoft
    –   Sun
          • Java - midlets


Version 1.0                   j.c.westlake@staffs.ac.uk      Slide 4
                             y.j.f.cartwright@staffs.ac.uk
April 2007
          MAS
              What is a Web Service?
• A Web Service: a software system designed to support
  interoperable machine-to-machine interaction over a
  network (the Internet)
   – A Web Service provides the definitions (and
      infrastructure) to allow applications to remotely
      exchange XML messages with each other
• Also more recently called a Service Oriented Architecture
  (SOA)




Version 1.0              j.c.westlake@staffs.ac.uk      Slide 5
                        y.j.f.cartwright@staffs.ac.uk
April 2007
          MAS
              What is a Web Service?
• Web services are based on the concept of service-
  oriented architecture (SOA)
• Web services implement functionality using a Remote
  Procedure Call (RPC) paradigm over the Internet
  using a standard protocol called the Simple Object
  Access Protocol (SOAP)
• Web services are self-describing modular business
  extensions that expose logic as services over Internet
  protocols (HTTP) <repeat this as important>
• Any service on a web server than can understand a
  SOAP message can be exposed as a web service


Version 1.0            j.c.westlake@staffs.ac.uk      Slide 6
                      y.j.f.cartwright@staffs.ac.uk
April 2007
            Web services: Four Core
          MAS
                       Standards
•   XML
•   SOAP
•   WSDL (Web Services Description Language)
•   UDDI (Universal Description, Discovery, and
    Integration)




Version 1.0             j.c.westlake@staffs.ac.uk      Slide 7
                       y.j.f.cartwright@staffs.ac.uk
April 2007
           What a business needs to
          MAS
                     implement
3 Main Components
• SOAP: envelope for wrapping and transporting
  data
• WSDL: (wizzdel) the Web Service interface i.e. its
  description
• UDDI: the repository i.e. the yellow pages of
  where you find information about Web Services
• We will now look into the detail of each of these
  after a diagram has been walked through


Version 1.0           j.c.westlake@staffs.ac.uk      Slide 8
                     y.j.f.cartwright@staffs.ac.uk
April 2007
          MAS
          Diagram to show a Web Service/SOA


                      Find e.g. UDDI -> WSDL
              Requestor   Publish                         Registry
                          e.g. WSDL ->
                          UDDI
          Bind
          e.g. SOAP,
          WSDL
                             A Service B Provider C Provider
                             Provider
Version 1.0                j.c.westlake@staffs.ac.uk            Slide 9
                          y.j.f.cartwright@staffs.ac.uk
April 2007
          MAS
              What a business needs?
• Web Services can be implemented in a variety of
  languages;
    – C#, Visual Basic, Java, C++, Perl, Python,
• Web services are not meant to interact with users
  (i.e., in providing HTML output) as a Java Servlet/JSP
  or ASP .NET application might
    – – so no GUI – more of a message
    – Web services deliver XML-based data over defined
      interfaces to other application components utilising their
      services
    – Web services use industry-standard protocols like HTTP for
      transports, thus bypassing most firewall problems which
      might not recognise the message otherwise

Version 1.0                 j.c.westlake@staffs.ac.uk      Slide 10
                           y.j.f.cartwright@staffs.ac.uk
April 2007
          MAS
          SOAP
• SOAP is a free, standard for a lightweight XML-based
  messaging protocol
• SOAP is the messaging protocol for transport of
  structured data on top of HTTP, etc.
    – SOAP is a communication protocol standard similar to other
      binary protocols like IIOP (CORBA) or JRMP (RMI) or XDR
      (RPC), but uses a text-based (UNICODE) data
      representation and definition that is XML-based
    – SOAP defines a lightweight protocol that embeds an
      encoding format for the representation of data types
      supporting multiple target languages
• I’m using the Soap Toolkit from Microsoft – see the
  practical sheet for the download link (for home use)

Version 1.0                j.c.westlake@staffs.ac.uk      Slide 11
                          y.j.f.cartwright@staffs.ac.uk
April 2007
          MAS
          Soap example – an envelope
<?xml version="1.0" encoding="UTF-8" ?> - <SOAP-ENV:Envelope
  xmlns:SOAP-
  ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/1999/XMLSchema">- <SOAP-
  ENV:Body>- <ns1:doGetCachedPage
  xmlns:ns1="urn:GoogleSearch" SOAP-
  ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encod
  ing/"> <key
  xsi:type="xsd:string">00000000000000000000000000000000<
  /key> <url
  xsi:type="xsd:string">http://www.google.com/</url> </ns1:d
  oGetCachedPage> </SOAP-ENV:Body> </SOAP-
  ENV:Envelope>



Version 1.0              j.c.westlake@staffs.ac.uk      Slide 12
                        y.j.f.cartwright@staffs.ac.uk
April 2007
          MAS
          WSDL (wizzdel)
• Web Services Definition Language (WSDL) is an
  XML format for describing available network services
  and interfaces
    – WSDL is used as the metadata language for defining web
      services
    – WSDL describes the web services functionalities offered by
      service providers as well as location services
• A WSDL file looks like the slide next but see the
  handout
    – What do you notice?


Version 1.0                  j.c.westlake@staffs.ac.uk      Slide 13
                            y.j.f.cartwright@staffs.ac.uk
April 2007
          MAS
                   Google wsdl file
• <?xml version="1.0" ?> - <!-- WSDL description of the Google
  Web APIs. The Google Web APIs are in beta release. All
  interfaces are subject to change as we refine and extend our
  APIs. Please see the terms of use for more information. --> -
  <!-- Revision 2002-08-16 --> - <definitions
  name="GoogleSearch"
  targetNamespace="urn:GoogleSearch"
  xmlns:typens="urn:GoogleSearch"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/
  " xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns="http://schemas.xmlsoap.org/wsdl/">- <!-- Types for
  search - result elements, directory categories --> - <types>
Version 1.0               j.c.westlake@staffs.ac.uk      Slide 14
                         y.j.f.cartwright@staffs.ac.uk
April 2007
          MAS
                              UDDI
• Universal Description, Discovery, and Integration
  defines standard interfaces in XML for registries
  serving as location services for web services
• UDDI exposes a universal distributed federated
  database for the naming and location of web-based
  services
• A UDDI registry looks like this…….




Version 1.0           j.c.westlake@staffs.ac.uk      Slide 15
                     y.j.f.cartwright@staffs.ac.uk
April 2007
          MAS
              UDDI – a “yellow pages”
• UDDI Entry
<businessEntity businessKey="..."> <name>Ficticious
  News Company</name> <businessServices>
  <businessService serviceKey="..." businessKey="...">
  <name>Sample Feed</name> <bindingTemplates>
  <bindingTemplate bindingKey="..." serviceKey="...">
  <description xml:lang="en">Sample
  Description</description> <accessPoint
  URLType="http">http://www.example.com/sample/rss
  .xml</accessPoint>
• See also www.uddi.org for more information



Version 1.0           j.c.westlake@staffs.ac.uk      Slide 16
                     y.j.f.cartwright@staffs.ac.uk
April 2007
          MAS
          Web services for mobiles
• Implementing a Google Web Service in VB.Net
• http://www.developerfusion.co.uk/show/3694/
• This is an application but could be converted into a
  mobile application
• To consume a web service from a Pocket PC
    – http://www.devbuzz.com/content/zinc_compact_framework_
      web_service_xml_pg1.asp
    – http://www.codeproject.com/netcf/GoPaWebSrvBegnrs.asp




Version 1.0              j.c.westlake@staffs.ac.uk      Slide 17
                        y.j.f.cartwright@staffs.ac.uk
April 2007
          MAS
          Why?
• Review of web services and mobile
  technology
• http://www.eweek.com/article2/0,1895,19394
  40,00.asp
• http://webservices.xml.com/pub/a/ws/2003/08
  /19/mobile.html




Version 1.0        j.c.westlake@staffs.ac.uk      Slide 18
                  y.j.f.cartwright@staffs.ac.uk
April 2007
          MAS
          Conclusion
• The need?
• Research indicates that the next generation of the Web will
  be about data, not text
• Companies are in need of standard mechanisms to be able
  to:
    – Publish
    – Advertise
    – And discover links to actual data sources, rather than web pages


And the first step is – representation …

Version 1.0                   j.c.westlake@staffs.ac.uk         Slide 19
                             y.j.f.cartwright@staffs.ac.uk
April 2007
          MAS
          Conclusion
• Constructing application-to-application Web
  services is simple, in principle.
• SOAP, WSDL, and UDDI are unavoidable
  frameworks for XML communication and
  service description
• surprisingly complicated and their benefits are
  not always obvious, although the basic ideas
  behind them are great
• still under development...

Version 1.0         j.c.westlake@staffs.ac.uk      Slide 20
                   y.j.f.cartwright@staffs.ac.uk
April 2007
          MAS
          Conclusion
• Web services benefits are mainly because of the open
  architecture nature and include:
   – are cross platform
   – are cross language
   – are cross operating system
   – enable interoperability among heterogeneous applications
   – can be invoked through XML-based RPC mechanisms
     across firewalls augmenting standard protocols
   – promote loosely-coupled architectures defined on common
     interfaces



Version 1.0               j.c.westlake@staffs.ac.uk      Slide 21
                         y.j.f.cartwright@staffs.ac.uk
April 2007
          MAS
          Conclusion
• webservices.xml.com
    – XML.com's Web service section
• webservices.xml.com/pub/a/ws/2002/02/12/webservicefaqs.html
    – "Top Ten FAQs for Web Services"
• www.w3.org/2002/ws
    – W3C's Web Services activity
• ws.apache.org
    – Apache's Web Service project
• www.onjava.com/pub/a/onjava/excerpt/java_xml_2_ch2
    – chapter on SOAP from the book "Java and XML"
• wsindex.org
    – Web service links and resources


Version 1.0                  j.c.westlake@staffs.ac.uk      Slide 22
                            y.j.f.cartwright@staffs.ac.uk
April 2007

								
To top