cern ids. cern – european organization for nuclear research administrative support - internet...
TRANSCRIPT
CERNIDS
CERN – European Organization for Nuclear Research
Administrative Support - Internet Development Services
Implementing Soap & Web ServicesImplementing Soap & Web Services
By Jozef Dranseld (ST-MA) &
Derek Mathieson (AS-IDS)
CERNIDS
Presentation RoadmapPresentation Roadmap
Past
Future
Present
CERNIDS
Why Web Services?Why Web Services?
““The Web can grow significantly in power and scope The Web can grow significantly in power and scope if it is extended to support communication between if it is extended to support communication between applications, from one program to another.”applications, from one program to another.”
- From the W3C XML Protocol Working Group Charter
CERNIDS
The HypeThe Hype
New paradigm?Reason to move platforms?Replacement for EDI?
CERNIDS
Plateau ofproductivity
Slope of enlightenment
Trough of disillusionment
Peak of inflated
expectationsTechnology
trigger
Gartner’s ‘Hype’ CurveGartner’s ‘Hype’ CurveKey: Time to “plateau”
Less than two yearsTwo to five yearsFive to 10 yearsBeyond 10 years
Biometrics Grid Computing
Web Services
Nanocomputing
Personalfuel cells
Text-to-speech
WirelessLANs/802.11
Virtualprivatenetworks
Visibility
Maturity
Source: Gartner Group June 2002
Natural-language search
Identity services
Personal digitalassistant phones
E-tags
Speech recognition incall centers
Voice over IP
Bluetooth
Public key infrastructure
Speech recognition on desktopsLocationsensing
WAP/WirelessWeb
Peer-to-peercomputing
CERNIDS
What are Web Services?What are Web Services?
Identified by a URIInterfaces defined using XMLCan be discovered by other systemsInteract using XML based messages
conveyed by Internet protocols
Source: Web Services Glossary
CERNIDS
What are Web Services?What are Web Services?
XML
Application 2Application 1
Is this New?Is this New?
CERNIDS
CERNIDS
A Brief History …A Brief History …
CERNIDS
Is this Different?Is this Different?
Platform neutralOpen Standards
– InteroperableBased on ubiquitous software
– XML Parsers– HTTP Server
CERNIDS
The ComponentsThe Components
CERNIDS
TransportTransport
HTTP POST is most commonBut other protocols such as
– FTP– SMTP– HTTP GET
And other exotic ones:– Jabber– BEEP
CERNIDS
Packaging – SoapPackaging – Soap
Used to mean – Simple– Object– Access– Protocol
From SOAP 1.2 > SOAP is no longer an acronym
Two Types of SOAP
CERNIDS
Packaging – SoapPackaging – Soap
SOAP RPC:– encode and bind data structures into xml.– encode an RPC call
CERNIDS
SerializationSerialization
class PurchaseOrder {
String item = “socks”;
int amount = 1;
}
<PurchaseOrder>
<item type=“xsd:string”>
socks
</item>
<amount type=“xsd:int”>
1
</amount>
</PurchaseOrder>
Serializer
CERNIDS
Packaging - SOAPPackaging - SOAP
SOAP ‘document style’– packages xml in an envelope
CERNIDS
Packaging – SoapPackaging – Soap
HTTP Post
SOAP Envelope
SOAP Body
SOAP Head
CERNIDS
Packaging – SoapPackaging – Soap
<s:Envelope xmlns:s=“URN”>
<s:header>
<s:transaction xmlns:m=“soap-transaction”>
<m:transactionID>
1234 </m:transactionID
>
</s:transaction>
</s:header>
CERNIDS
Packaging – SoapPackaging – Soap
<s:Body>
<n:purchaseOrder xmlns:n=“URN”>
<n:item>socks</n:item>
<n:amount>1</n:amount>
</n:purchaseOrder>
</s:Body>
</s:Envelope>
CERNIDS
Description – WSDLDescription – WSDL
Web Services Description Language“Web Services Description Language
(WSDL) provides a model and an XML format for describing Web services.” w3c.org
CERNIDS
Description – WSDLDescription – WSDL
Messages
Types
Operations
Encoding
Endpoint
CERNIDS
TypesTypes
<types>
<schema targetNamespace=" IMessageService.xsd"
xmlns="…/XMLSchema" xmlns:SOAPENC="…/soap/encoding/"/>
</types>
CERNIDS
MessagesMessages
<message name=“purchase">
<part name=“item" type="xsd:string"/>
<part name=“quantity" type="xsd:integer"/>
</message>
CERNIDS
OperationsOperations
<operation name="setMessage">
<input name="setMessageRequest“ message="tns:setMessageRequest"/>
<output name="setMessageResponse“ message="tns:setMessageResponse"/>
</operation>
CERNIDS
EncodingEncoding
<soap:operation soapAction="" style="rpc"/>
<input name="setMessage0Request">
<soap:body use="encoded" namespace="MessageService" encodingStyle="…/soap/encoding/"/>
</input>
CERNIDS
EndpointEndpoint
<service name="MessageService">
<port name="MessageServicePort" binding="tns:MessageServiceBinding">
<soap:address location="http://localhost:8080/setMessage/"/>
</port>
</service>
CERNIDS
Discovery – UDDIDiscovery – UDDI
Universal Description, Discovery and Integration
A UDDI Server acts as a registry for Web Services and makes them searchable.
CERNIDS
Discovery – UDDIDiscovery – UDDI
Demonstration:
https://uddi.ibm.com/ubr/registry.html
CERNIDS
Discovery – UDDIDiscovery – UDDI
UDDI RegistryInquiry
Publish
CERNIDS
Discovery – UDDIDiscovery – UDDI
UDDI RegistryInquiry
Publish
CERNIDS
ExamplesExamples
Java– Client– Server
VBScript– Client –high level API– Client – low level API
.NET– C# Client– C# Server
CERNIDS
Design RecommendationsDesign Recommendations
Create a local classCreate a method with the same name
CERNIDS
Examples (Java Client)Examples (Java Client)
URL endpointURL = new URL(endpoint);
Call call = new Call();
call.setSOAPTransport(m_httpconn);
call.setTargetObjectURI("MessageService");
call.setMethodName("setMessage");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
CERNIDS
Examples (Java Client)Examples (Java Client)
Vector params = new Vector();params.addElement(new Parameter("name", java.lang.String.class, name, null));
params.addElement(new Parameter("colour", java.lang.String.class, colour, null));
call.setParams(params);Response response = call.invoke(endpointURL, "");
CERNIDS
Examples (Java Client)Examples (Java Client)
Demonstration
CERNIDS
Examples (Java Server)Examples (Java Server)
A Web service Server is simple:– New class with method
Then:– Register class with soap router– Or– Place the source code in a jws file
CERNIDS
Examples (VB Client)Examples (VB Client)
High Level API (After adding a Web Service Reference)
Dim serv As clsws_MessageService
Set serv = New clsws_MessageService
serv.wsm_setMessage txtName.Text, txtColor.Text
CERNIDS
Examples (VB Client)Examples (VB Client)
Serializer.Init Connector.InputStreamSerializer.startEnvelope , ENC
Serializer.SoapNamespace "xsi", XSISerializer.SoapNamespace "SOAP-ENC", ENCSerializer.SoapNamespace "xsd", XSDSerializer.startBody
Serializer.startElement Method, URI, , "method"
Serializer.startElement “parameter“Serializer.SoapAttribute "type", ,
"xsd:string", "xsi"Serializer.writeString usernameSerializer.endElement
Serializer.endBodySerializer.endEnvelope
Connector.EndMessage
CERNIDS
Examples (VB Client)Examples (VB Client)
Call Web Service
Name
Colour
CERNIDS
Examples (C# Client)Examples (C# Client)
Add a Web References to a project
Localhost.MessageService serv = new Localhost.MessageService();
serv.setMessage(x, y);
CERNIDS
Examples (C# Client)Examples (C# Client)
Demonstration
CERNIDS
Examples (C# Server)Examples (C# Server)
public class Demo : System.Web.Services.WebService {
public Demo() { InitializeComponent();
}
[Web Method]public string HelloWorld() {
return “Hello World”;}
}
Web ServicesWeb ServicesFutureFuture
CERNIDS
CERNIDS
SecuritySecurity
Bookstore
Client Application
CERNIDS
SecuritySecurity
Client Application
Bookstore
Bank
Warehouse
CERNIDS
WS Security StandardisationWS Security Standardisation
W3C - http://www.w3c.org – XML Encryption– XML Digital Signatures
WS-I - http://www.ws-i.org– WS Security Profile
OASIS - http://www.oasis-open.org– WS-Security – SAML - Security Assertion Markup Language– XACML - Extensible Access Control Markup
Language– XKMS - XML Key Management Specification
CERNIDS
Fire WallFire Wall
Security – Fire WallsSecurity – Fire Walls
Bookstore
Client Application
CERNIDS
WS-IWS-I
Web Services Interoperability Organization
http://www.ws-i.org
R1017 A RECEIVER MUST NOT mandate the use of the xsi:type attribute in messages except as required in order to indicate a derived type
WS-I Basic Profile Version 1.0
CERNIDS
Missing PiecesMissing Pieces
Security– Single Sign-on, credentials
TransactionsQuality of service
– Timeliness guaranteesAsynchronous operations
– Co-ordination, workflow
CERNIDS
Real ExamplesReal Examples
Amazon Web Services APIGoogle Web APIHP & IBM online stores
CERNIDS
Next StepsNext Steps
Overtime InterfaceOther documents (Materials Request,
TID, Transport Request)E-Business – with ebXML
CERNIDS
Plateau ofproductivity
Slope of enlightenment
Trough of disillusionment
Peak of inflated
expectationsTechnology
trigger
Gartner’s ‘Hype’ CurveGartner’s ‘Hype’ CurveKey: Time to “plateau”
Less than two yearsTwo to five yearsFive to 10 yearsBeyond 10 years
Web Services
Visibility
Maturity
Source: Gartner Group June 2002
CERNIDS
Thank you Thank you
Presentation and source code of demos:
http://ais.cern.ch/presentations