Introduction to WebServices, Schemas, and the New Programming Paradigm

Last Updated:.

View this page as series of slides through the magic of xslt.

  1. Overview
    1. What are Web Services?
    2. What's the big problem?
    3. Examples of Web Services
    4. How does a web service work? (mercifully short, but including some terms to bore your friends: XML, XSD, SOAP, WSDL, UDDI)
    5. Why is this important for software companies like Microsoft,Sun, IBM, and PeopleSoft?
    6. Problems with Web Services
    7. Future of Web Services
  2. Background

    The history of web services can be traced back to a French Gunsmith named Honore' Blanc back in 1790. He is credited by some to have started using interchangeable parts to make muskets for Napoleon.

  3. Introduction

    Web service
    1.A Web service is a software system identified by a URI [RFC 2396], whose public interfaces and bindings are defined and described using XML. Its definition can be discovered by other software systems. These systems may then interact with the Web service in a manner prescribed by its definition, using XML based messages conveyed by Internet protocols.
    -World Wide Web Consortium definition

    Mitch's definition: "Web Services" are web pages created by machines for machines.

    Note: Web Services are not revolutionary, they are just the next logical step in the connection of computers in the Internet.

  4. What's the big problem?

    We need to share data on different computers from different companies running different operating systems in different formats with different users.

    Communication is the problem to the answer -10CC

    1. Two retailers buying goods from a branded manufacturer

    2. Two retailers buying goods from multiple unbranded manufacturers

    3. Sharing internal data of legacy systems

    4. Issuing sell orders to two different brokerages

    5. Company getting information from a supplier

    6. Company executing programs on other computers

      GRID computing (SETI, UnitedDevices). Confluence of GRID computing and Web Services occurring.

    "Why can't we all just get along?" -20th Century Philosopher

  5. How does a web service work?
    from www.developer.com:
    pic
  6. Terms
    1. XML - Extensible Markup Language
    2. XSD - XML Schema Definition
    3. SOAP - Simple Object Access Protocol
    4. WSDL - Web Services Description Language
    5. UDDI - Universal Description, Discovery, and Integration xmethods.com
  7. Example of XML
    <GroupStatus xmlns="http://tempuri.org/GroupStatusExample1.xsd" name="Test1" lang="en-UK">
        <SurveyStatus name="JN9G" dateStart="3/16/2003 2:33:56 PM" dateEnd="3/23/2003 2:33:56 PM">
            <CellStatus name="gender" value="male" completed="5" pending="0" target="10" />
        </SurveyStatus>
        <SurveyStatus name="MBCT" dateStart="3/16/2003 2:33:56 PM" dateEnd="3/23/2003 2:33:56 PM">
            <CellStatus name="gender" value="male" completed="32" pending="2" target="60" />
        </SurveyStatus>
        <SurveyStatus name="PNDCHK" dateStart="3/16/2003 2:33:56 PM" dateEnd="3/23/2003 2:33:56 PM">
            <CellStatus name="gender" value="male" completed="5" pending="1" target="30" />
        </SurveyStatus>
        <SurveyStatus name="PNDCHK2" dateStart="3/16/2003 2:33:56 PM" dateEnd="3/23/2003 2:33:56 PM">
            <CellStatus name="gender" value="male" completed="23" pending="0" target="30" />
        </SurveyStatus>
    </GroupStatus>
    
  8. XSD Example

    <?xml version="1.0" ?>
    <xs:schema id="NewDataSet" targetNamespace="http://tempuri.org/GroupStatusExample1.xsd" xmlns:mstns="http://tempuri.org/GroupStatusExample1.xsd" xmlns="http://tempuri.org/GroupStatusExample1.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified" elementFormDefault="qualified">
    	<xs:element name="GroupStatus">
    		<xs:complexType>
    			<xs:sequence>
    				<xs:element name="SurveyStatus" minOccurs="0" maxOccurs="unbounded">
    					<xs:complexType>
    						<xs:sequence>
    							<xs:element name="CellStatus" minOccurs="1" maxOccurs="unbounded">
    								<xs:complexType>
    									<xs:attribute name="name" form="unqualified" type="xs:string" />
    									<xs:attribute name="value" form="unqualified" type="xs:string" />
    									<xs:attribute name="completed" form="unqualified" type="xs:int" />
    									<xs:attribute name="pending" form="unqualified" type="xs:int" />
    									<xs:attribute name="target" form="unqualified" type="xs:int" />
    								</xs:complexType>
    							</xs:element>
    						</xs:sequence>
    						<xs:attribute name="name" form="unqualified" type="xs:string" />
    						<xs:attribute name="dateStart" form="unqualified" type="xs:dateTime" />
    						<xs:attribute name="dateEnd" form="unqualified" type="xs:dateTime" />
    					</xs:complexType>
    				</xs:element>
    			</xs:sequence>
    			<xs:attribute name="name" form="unqualified" type="xs:string" />
    			<xs:attribute name="lang" form="unqualified" type="xs:string" />
    		</xs:complexType>
    	</xs:element>
    	<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:EnforceConstraints="False">
    		<xs:complexType>
    			<xs:choice maxOccurs="unbounded">
    				<xs:element ref="GroupStatus" />
    			</xs:choice>
    		</xs:complexType>
    	</xs:element>
    </xs:schema>
    
  9. SOAP Examples

    Web service request as SOAP

    POST /wsquotaproxy/qpservice.asmx HTTP/1.1
    Host: d0065
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "http://mb.SurveyDirector.QuotaProxy.WebService/GetSurveyStatusXml"
    
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <GetSurveyStatusXml xmlns="http://mb.SurveyDirector.QuotaProxy.WebService">
          <name>Test1</name>
          <lang>en-UK</lang>
          <nameValueString>gender:male</nameValueString>
        </GetSurveyStatusXml>
      </soap:Body>
    </soap:Envelope>
    
    
  10. SOAP Examples

    Web service request as SOAP

    POST /wsquotaproxy/qpservice.asmx HTTP/1.1
    Host: d0065
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "http://mb.SurveyDirector.QuotaProxy.WebService/GetSurveyStatusXml"
    
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <GetSurveyStatusXml xmlns="http://mb.SurveyDirector.QuotaProxy.WebService">
          <name>Test1</name>
          <lang>en-UK</lang>
          <nameValueString>gender:male</nameValueString>
        </GetSurveyStatusXml>
      </soap:Body>
    </soap:Envelope>
    

    Web service response as SOAP

    HTTP/1.1 200 OK
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <GetSurveyStatusXmlResponse xmlns="http://mb.SurveyDirector.QuotaProxy.WebService">
          <GetSurveyStatusXmlResult>
    
          <GroupStatus name="Test2" lang="en-UK" >
           <SurveyStatus name="JN9G" dateStart="3/15/2003 1:51:41 PM" dateEnd="3/22/2003 1:51:41 PM">
    	<CellStatus name="gender" value="male" completed="0" pending="0" target="10" />
          </SurveyStatus>
          <SurveyStatus name="MBCT" dateStart="3/15/2003 1:51:41 PM" dateEnd="3/22/2003 1:51:41 PM">
    	<CellStatus name="gender" value="male" completed="0" pending="0" target="60" />
          </SurveyStatus>
          <SurveyStatus name="PNDCHK" dateStart="3/15/2003 1:51:41 PM" dateEnd="3/22/2003 1:51:41 PM">
    	<CellStatus name="gender" value="male" completed="0" pending="0" target="30" />
          </SurveyStatus>
          <SurveyStatus name="PNDCHK2" dateStart="3/15/2003 1:51:41 PM" dateEnd="3/22/2003 1:51:41 PM">
    	<CellStatus name="gender" value="male" completed="0" pending="0" target="30" />
           </SurveyStatus>
          </GroupStatus>
    
    </GetSurveyStatusXmlResult>
        </GetSurveyStatusXmlResponse>
      </soap:Body>
    </soap:Envelope>
    

    Web service request as HTTP GET

    
    GET /wsquotaproxy/qpservice.asmx/GetSurveyStatusXml?name=Test2&lang=en-UK&nameValueString=gender:male HTTP/1.1
    Host: d0065
    

    Web service response as HTTP GET

    HTTP/1.1 200 OK
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    
    <?xml version="1.0" encoding="utf-8"?>
    <string xmlns="http://mb.SurveyDirector.QuotaProxy.WebService">
    
          <GroupStatus name="Test2" lang="en-UK" >
           <SurveyStatus name="JN9G" dateStart="3/15/2003 1:51:41 PM" dateEnd="3/22/2003 1:51:41 PM">
    	<CellStatus name="gender" value="male" completed="0" pending="0" target="10" />
          </SurveyStatus>
          <SurveyStatus name="MBCT" dateStart="3/15/2003 1:51:41 PM" dateEnd="3/22/2003 1:51:41 PM">
    	<CellStatus name="gender" value="male" completed="0" pending="0" target="60" />
          </SurveyStatus>
          <SurveyStatus name="PNDCHK" dateStart="3/15/2003 1:51:41 PM" dateEnd="3/22/2003 1:51:41 PM">
    	<CellStatus name="gender" value="male" completed="0" pending="0" target="30" />
          </SurveyStatus>
          <SurveyStatus name="PNDCHK2" dateStart="3/15/2003 1:51:41 PM" dateEnd="3/22/2003 1:51:41 PM">
    	<CellStatus name="gender" value="male" completed="0" pending="0" target="30" />
           </SurveyStatus>
          </GroupStatus>
    
    </string>
    
  11. WSDL Example
    
    <?xml version="1.0" encoding="utf-8"?>
    <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://www.millwardbrown.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://www.millwardbrown.com" xmlns="http://schemas.xmlsoap.org/wsdl/">
      <types>
        <s:schema elementFormDefault="qualified" targetNamespace="http://www.millwardbrown.com">
          <s:element name="GetSurveyStatus">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="group" type="s:string" />
                <s:element minOccurs="0" maxOccurs="1" name="language" type="s:string" />
                <s:element minOccurs="0" maxOccurs="1" name="nameValuePairs" type="s:string" />
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="GetSurveyStatusResponse">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="GetSurveyStatusResult" type="s:string" />
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="string" nillable="true" type="s:string" />
        </s:schema>
      </types>
      <message name="GetSurveyStatusSoapIn">
        <part name="parameters" element="s0:GetSurveyStatus" />
      </message>
      <message name="GetSurveyStatusSoapOut">
        <part name="parameters" element="s0:GetSurveyStatusResponse" />
      </message>
      <message name="GetSurveyStatusHttpGetIn">
        <part name="group" type="s:string" />
        <part name="language" type="s:string" />
        <part name="nameValuePairs" type="s:string" />
      </message>
      <message name="GetSurveyStatusHttpGetOut">
        <part name="Body" element="s0:string" />
      </message>
      <message name="GetSurveyStatusHttpPostIn">
        <part name="group" type="s:string" />
        <part name="language" type="s:string" />
        <part name="nameValuePairs" type="s:string" />
      </message>
      <message name="GetSurveyStatusHttpPostOut">
        <part name="Body" element="s0:string" />
      </message>
      <portType name="GetGroupStatusService1Soap">
        <operation name="GetSurveyStatus">
          <input message="s0:GetSurveyStatusSoapIn" />
          <output message="s0:GetSurveyStatusSoapOut" />
        </operation>
      </portType>
      <portType name="GetGroupStatusService1HttpGet">
        <operation name="GetSurveyStatus">
          <input message="s0:GetSurveyStatusHttpGetIn" />
          <output message="s0:GetSurveyStatusHttpGetOut" />
        </operation>
      </portType>
      <portType name="GetGroupStatusService1HttpPost">
        <operation name="GetSurveyStatus">
          <input message="s0:GetSurveyStatusHttpPostIn" />
          <output message="s0:GetSurveyStatusHttpPostOut" />
        </operation>
      </portType>
      <binding name="GetGroupStatusService1Soap" type="s0:GetGroupStatusService1Soap">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
        <operation name="GetSurveyStatus">
          <soap:operation soapAction="http://www.millwardbrown.com/GetSurveyStatus" style="document" />
          <input>
            <soap:body use="literal" />
          </input>
          <output>
            <soap:body use="literal" />
          </output>
        </operation>
      </binding>
      <binding name="GetGroupStatusService1HttpGet" type="s0:GetGroupStatusService1HttpGet">
        <http:binding verb="GET" />
        <operation name="GetSurveyStatus">
          <http:operation location="/GetSurveyStatus" />
          <input>
            <http:urlEncoded />
          </input>
          <output>
            <mime:mimeXml part="Body" />
          </output>
        </operation>
      </binding>
      <binding name="GetGroupStatusService1HttpPost" type="s0:GetGroupStatusService1HttpPost">
        <http:binding verb="POST" />
        <operation name="GetSurveyStatus">
          <http:operation location="/GetSurveyStatus" />
          <input>
            <mime:content type="application/x-www-form-urlencoded" />
          </input>
          <output>
            <mime:mimeXml part="Body" />
          </output>
        </operation>
      </binding>
      <service name="GetGroupStatusService1">
        <documentation>Given respondent attributes, returns surveys needing this respondent</documentation>
        <port name="GetGroupStatusService1Soap" binding="s0:GetGroupStatusService1Soap">
          <soap:address location="http://127.0.0.1/SurveyDirector/GetGroupStatusService1.asmx" />
        </port>
        <port name="GetGroupStatusService1HttpGet" binding="s0:GetGroupStatusService1HttpGet">
          <http:address location="http://127.0.0.1/SurveyDirector/GetGroupStatusService1.asmx" />
        </port>
        <port name="GetGroupStatusService1HttpPost" binding="s0:GetGroupStatusService1HttpPost">
          <http:address location="http://127.0.0.1/SurveyDirector/GetGroupStatusService1.asmx" />
        </port>
      </service>
    </definitions>
    
    
  12. UDDI Example

    xmethods.com

  13. Development Environments - Why is this important for software companies like Microsoft,Sun, IBM and BEA?
    1. .Net - Web Service Extensions
    2. J2EE (Oracle, IBM, BEA...)

    Big Idea: The companies that make it easy for developers to create and deploy robust, scalable web services quickly will have an advantage in enticing developers to their platform. (Same issue with Pervasive computing).

    Why are Web Services important for software companies like PeopleSoft and SAP?

    Unbundling of Software - Web Services offers a mix and match option of software, like Lego or stereo components. With BizTalk large companies can 'network' legacy applications together using web services.

  14. Problems with Web Services
    1. Security!!!

      who can read, or alter, or duplicate my orders?

    2. Interoperability

      Can Microsoft web services talk with Java web services?

    3. Definitions of xml objects. ("Carrier" vs. "Airline")

      RosettaNet

    4. Reliability - message lost or duplicated

    5. Process - we really have a series of steps, not just a single form - Process Execution Language for Web Services (BPEL4WS)

  15. Future Nirvana

    BPEL4WS, RosettaNet, and WebServices are used to tie internal and external business systems together into a seamless, frictionless, money making machine.

  16. Current State

    Most companies are just struggling to tie together their internal systems and waiting for security to branch out and do true business to business web services.

  17. Future Small web services on your local PC?

    One vision of future desktop software is for all the major components of your PC will be integrated using local "web services". Need a new speller for Word or WordPerfect? Simply install a new "speller" web service and redirect your apps to use it.

  18. Review
    1. What are Web Services?
    2. What's the big problem?
    3. Examples of Web Services
    4. How does a web service work?
    5. Why is this important for software companies like Microsoft,Sun, IBM, and PeopleSoft?
    6. Problems with Web Services
    7. Future of Web Services
  19. Summary

    Web Services can significantly increase business efficiency, but it will take time and money to realize the benefits and it won't be easy.