web services the “langua franca” of distributed systems? developed by larry lefever for cs616:...

51
Web Services The “langua franca” of distributed Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University, White Plains, NY

Post on 15-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Web Services

The “langua franca” of distributed systems?

Developed by Larry LeFever for CS616: Software Engineering SeminarSpring 2003, Pace University, White Plains, NY

Page 2: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

A Definition of a “Web Service”A functionality-set or module of computational utility accessible via a network, whether LAN or WAN (e.g., the Internet) by use of textual open standard protocols such as ASCII (actually, UTF-8), XML (especially SOAP) and HTTP, especially in the interest of facilitating interoperation of nodes of an heterogeneous distributed system.

Page 3: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Typical “Web Services” Technology-Stack:

UDDIWSDLSOAPXML

UTF-8HTTP

TCP/IPEthernet/PPP/Wireless

Page 4: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

A Kind ofObject-Oriented

Remote Procedure Call (a.k.a. RPC)Architecture

With anOpen standards based

Textual interfaceSupporting

Dynamic service-discovery

Page 5: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Können Siedas lesen?

Page 6: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Können Sie det lesen?

Page 7: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

The ProblemJust as “no man is an island”, no enterprise is an island either – not anymore.

In the “good old days”, when IBM was, as it were, Microsoft, the enterprise was, indeed, an island: it invested in one massive comprehensive solution from the same vendor – named IBM, for instance.

There was no Internet yet, and no need, or at least no means yet, for automated communication between different enterprises – i.e., between different systems.

UPSHOT:previously, isolated homogeneous systems

Page 8: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Information Systems

Information Systems

Information Systems

IBM

IBM

maybe notIBM

Enterprise-islands

Acquisitive, Inc.

Not So Acquisitive, Inc.

Take-Over Target, Inc.

Page 9: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Information Systems

Information Systems

Information Systems

IBM

IBM

maybe notIBM

Enterprise-islands

Monopolists ‘R’ Us Wishful Thinking, Inc.

Information SystemsInformation Systems

IBM

maybe notIBM

Almost All of It, Inc.

Not So Acquisitive, Inc.

Page 10: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Information Systems

Information Systems

Information Systems

IBM

IBM

maybe notIBM

Enterprise-islands

Monopolists ‘R’ Us Wishful Thinking, Inc.

Information SystemsInformation Systems

IBM

maybe notIBM

<= “Können Sie det lesen?” =>

Not So Acquisitive, Inc.

Almost All of It, Inc.

Page 11: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Cp500 -- IBM proprietary (EBCDIC, “Extended Binary Coded Decimal Interchange Code”):

D2 CC 95 95 85 95 40 E2 89 85 40 84 85 A3 40 93 85 A2 85 95 65

4B F6 6E 6E 65 6E 20 53 69 65 20 64 65 74 20 6C 65 73 65 6E 3F

ISO-8859-1 -- ANSI (public) standard (LATIN1, an “Extended ASCII”, 8-bit ASCII):

Character-Encodings

Character codes from: http://std.dkuug.dk/i18n/charmaps/

Page 12: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Cp500 -- IBM proprietary (EBCDIC, “Extended Binary Coded Decimal Interchange Code”):

D2 CC 95 95 85 95 40 E2 89 85 40 84 85 A3 40 93 85 A2 85 95 65

4B F6 6E 6E 65 6E 20 53 69 65 20 64 65 74 20 6C 65 73 65 6E 3F

ISO-8859-1 -- ANSI (public) standard (LATIN1, an “Extended ASCII”, 8-bit ASCII):

K ö n n e n S i e d e t l e s e n ?

Character-Encodings

Character codes from: http://std.dkuug.dk/i18n/charmaps/

Page 13: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Cp500 -- IBM proprietary (EBCDIC, “Extended Binary Coded Decimal Interchange Code”):

D2 CC 95 95 85 95 40 E2 89 85 40 84 85 A3 40 93 85 A2 85 95 65

4B F6 6E 6E 65 6E 20 53 69 65 20 64 65 74 20 6C 65 73 65 6E 3F

ISO-8859-1 -- ANSI (public) standard (LATIN1, an “Extended ASCII”, 8-bit ASCII):

K ö n n e n S i e d e t l e s e n ?

Character-Encodings

Character codes from: http://std.dkuug.dk/i18n/charmaps/

Page 14: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Cp500 -- IBM proprietary (EBCDIC, “Extended Binary Coded Decimal Interchange Code”):

D2 CC 95 95 85 95 40 E2 89 85 40 84 85 A3 40 93 85 A2 85 95 65

4B F6 6E 6E 65 6E 20 53 69 65 20 64 65 74 20 6C 65 73 65 6E 3F

ISO-8859-1 -- ANSI (public) standard (LATIN1, an “Extended ASCII”, 8-bit ASCII):

K ö n n e n S i e d e t l e s e n ?

Character-Encodings

Character codes from: http://std.dkuug.dk/i18n/charmaps/

Page 15: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Cp500 -- IBM proprietary (EBCDIC, “Extended Binary Coded Decimal Interchange Code”):

D2 CC 95 95 85 95 40 E2 89 85 40 84 85 A3 40 93 85 A2 85 95 65

4B F6 6E 6E 65 6E 20 53 69 65 20 64 65 74 20 6C 65 73 65 6E 3F

ISO-8859-1 -- ANSI (public) standard (LATIN1, an “Extended ASCII”, 8-bit ASCII):

K ö n n e n S i e d e t l e s e n ?

Character-Encodings

Character codes from: http://std.dkuug.dk/i18n/charmaps/

Page 16: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

We need a common language.

Nicht wahr?

Or, rather, computers need a common character-encoding for dealing with different natural languages -- and, for that matter, even for one given language, such as English.

Page 17: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Proprietary variants of EBCDIC, roughly one per character-set (i.e., alphabet). 8-bit encoding

Proprietary variants of ASCII, roughly one per character-set (i.e., alphabet). 8-bit encoding

UNICODE 16-bit encoding

UTF-8 -- 8-bit, if it fits, else 16-bit or more (“UCS Transformation Format”) (UCS: Universal Character Set)

Page 18: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

ISO/IEC 10646-1 defines a multi-octet character set called the Universal Character Set (UCS) which encompasses most of the world's writing systems. Multi-octet characters, however, are not compatible with many current applications and protocols, and this has led to the development of a few so-called UCS transformation formats (UTF), each with different characteristics. UTF-8, …, has the characteristic of preserving the full US-ASCII range, providing compatibility with file systems, parsers and other software that rely on US-ASCII values but are transparent to other values… It is noteworthy that the same set of characters is defined by the Unicode standard [UNICODE]

(http://www.ietf.org/rfc/rfc2279.txt; Abstract & Intro.)

Page 19: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Character-encodings may be thought of as part of a system’s:

ABI (application binary interface)

… along with its:

- endianness - address-alignment

Page 20: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

#if defined(BIG_ENDIAN) && !defined(LITTLE_ENDIAN)

#define htons(A) (A)

#define htonl(A) (A)

#define ntohs(A) (A)

#define ntohl(A) (A)

#elif defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN)

#define htons(A) ((((uint16)(A) & 0xff00) >> 8) | \

(((uint16)(A) & 0x00ff) << 8))

#define htonl(A) ((((uint32)(A) & 0xff000000) >> 24) | \

(((uint32)(A) & 0x00ff0000) >> 8) | \

(((uint32)(A) & 0x0000ff00) << 8) | \

(((uint32)(A) & 0x000000ff) << 24))

#define ntohs htons

#define ntohl htohl

From: http://www.netrino.com/Publications/Glossary/Endianness.html

Page 21: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

struct padded {

char a;

double e; /* might start on 8-byte boundary! */

int x, y;

struct f g;

};

printf("%d\n", sizeof( struct padded ) );

From: http://ciips.ee.uwa.edu.au/~morris/Year1/CLP110/struct.html

Page 22: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

From: http://ciips.ee.uwa.edu.au/~morris/Year1/CLP110/struct.html

Page 23: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

“By printing out sizeof (struct t_labelled_point -- see following, ed. LL), you discovered that your machine pads the structure to 16 bytes. By examining the binary file, you've confirmed that there are 7 null bytes after each character. However, the same exercise on the target machine shows that the struct isn't padded, i.e., it only takes 9 bytes, so we need to do some hacking to read the file.”

From: http://ciips.ee.uwa.edu.au/~morris/Year1/CLP110/struct.html

Page 24: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

#include "labelled_point.h"

#define BUF_LEN 16

#define Z_OFFSET 8 /* <== EMPHASIS ADDED !!! */

int load_point_array( labelled_point a[], int n ) {

/* a is an array of objects constructed by calls to the

appropriate constructor */

int f, i, nb;

char buf[BUF_LEN];

f = open( "dump.dat", 0 );

for(i=0;i<n;i++) {

/* Read data into a character buffer */

nb = read( f, buf, BUF_LEN );

a[i]->a = buf[0]; /* First char is the label */

memcpy( &(a[i]->z), &buf[Z_OFFSET], sizeof(double) ); /* <== EMPHASIS ADDED !!! */

}

..

return ..

}

Page 25: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

One might say that what we need is an:

ATI(application textual interface*)

*a term of my own devising

Page 26: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Enter:

XML(extensible mark-up language)

A “meta-mark-up language”,A mark-up language for defining

Other markup languages

Page 27: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

From: http://javaboutique.internet.com/tutorials/SOAP/index.html

POST /StockQuote HTTP/1.1Host: www.stockquoteserver.comContent-Type: text/xml; charset="utf-8”Content-Length: nnnnSOAPAction:"Some-URI"

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <m:GetLastTradePrice xmlns:m="Some-URI"> <symbol>DIS</symbol> </m:GetLastTradePrice> </SOAP-ENV:Body ></SOAP-ENV:Envelope>

<==== simple datatype, as opposedto composite type, like C-struct

Page 28: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

From: http://javaboutique.internet.com/tutorials/SOAP/index.html

HTTP/1.1 200 OKContent-Type: text/xml; charset="utf-8”Content-Length: nnnn

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/ > <SOAP-ENV:Body> <m:GetLastTradePriceResponse xmlns:m="Some-URI"> <Price>34.5</Price> </m:GetLastTradePriceResponse> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Page 29: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Parameter-Marshalling

- DCE-RPC, X/Open-RPC, MS-DCOM, CORBA, Sun-RMI - binary

- Web Services - textual (XML => SOAP)

Page 30: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

typedef struct {

p_context_id_t p_cont_id;

u_int8 n_transfer_syn; /* number of items */

u_int8 reserved; /* alignment pad, m.b.z. */

p_syntax_id_t abstract_syntax; /* transfer syntax list */

p_syntax_id_t [size_is(n_transfer_syn)] transfer_syntaxes[];

} p_cont_elem_t;

typedef struct {

u_int8 n_context_elem; /* number of items */

u_int8 reserved; /* alignment pad, m.b.z. */

u_short reserved2; /* alignment pad, m.b.z. */

p_cont_elem_t [size_is(n_cont_elem)] p_cont_elem[];

} p_cont_list_t;

http://www.opengroup.org/onlinepubs/009629399/chap12.htm#tagcjh_17_02

DCE Network Data Representation (NDR)(similar to X/Open’s External Data Representation (XDR))

Page 31: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

class Person { String name; int age;}class Aservice { public String acceptPerson(Person p) { //do something here return “a string”; }}||||||||||||||||||||||||||||| XML for calling “acceptPerson” |||||||||||||||||||||||||||||||||||||||||||||<SOAP-ENV:Body> <ns1:acceptPerson xmlns:ns1=”urn:the urn of the service” SOAP-ENV:encodingStyle = “http://schemas.xmlsoap.org/soap/encoding/”> <serviceParam xmlns:ns2=”some uri” xsi:type=”ns2:Person”> <age xsi:type=” xsd:int”>22</age> <name xsi:type=xsd:string”>Samudra</name> </serviceParam> </ns1:acceptPerson></SOAP-ENV:Body>

http://javaboutique.internet.com/tutorials/SOAP/index2.html

<== composite datatype

<== extremely simple “Web Service”

Page 32: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

public static void main(String[] args) { String urlString = args[0]; String name = args[1]; SoapClient client = new SoapClient(urlString); Person nameObject = new Person(); nameObject.setName(name); nameObject.setAge(22);

Call call = new Call(); call.setTargetObjectURI("urn:greetingService"); call.setMethodName("sayGreeting"); call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

SOAPMappingRegistry smr = new SOAPMappingRegistry(); BeanSerializer bsr = new BeanSerializer(); <== !!! QName qn = new QName("urn:greetingService", "sam.soap.client.Person"); smr.mapTypes.(Constants.NS_URI_SOAP_ENC, qn, sam.soap.client.Person.class, bsr, bsr); call.setSOAPMappingRegistry(smr); Vector v = new Vector(); Parameter param1 = new Parameter("name", sam.soap.client.Person.class, nameObject, null); v.addElement(param1); call.setParams(v);

http://javaboutique.internet.com/tutorials/SOAP/client2.html

Apache SOAP: Example Web Service Invocation

Page 33: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Response res = call.invoke(new URL(client.urlString), ""); if( res.generatedFault() ==false) { Parameter retValue = res.getReturnValue(); Object value = retValue.getValue(); System.out.println(value);} else { System.out.println("The fault is: "+res.getFault().getFaultString());}

Apache SOAP: Example Web Service Invocation(cont.)

http://javaboutique.internet.com/tutorials/SOAP/client2.html

Page 34: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Apache SOAP: Custom Serialization

http://javaboutique.internet.com/tutorials/SOAP/index3.html

public class PersonSerializer extends Object implements Serializer, Deserializer{ public void marshall(String inScopeEncStyle, Class javaType, Object src, Object context, Writer sink, NSStack nsStack, XMLJavaMappingRegistry xjmr, SOAPContext ctx) throws IllegalArgumentException,IOException {

inScopeEncStyle: This represents the encodingStyleURI as specified in the enclosing Call or Response object. javaType: This is the run-time type of the object that is to be serialized. src: This is a reference to the ***Java object *** to be serialized. context: A String denoting the accessor name It must be non-null. sink: The destination to which the *** SOAP XML instance *** will be written. nsStack: A data structure that implements a stack of namespace declarations that are currently in scope. xjmr: This is the XMLJavaMappingRegistry object. ctx: This is used to pass in things like javax.servlet.http.HttpServletRequest and javax.servlet.http.HttpSession from the servlet context.

Page 35: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

SoapEncUtils.generateStructureHeader(inScopeEncStyle, javaType, context, sink, nsStack, xjmr);sink.write(StringUtils.lineSeparator);Person person = (Person)src;String name = person.getName();int age = person.getAge();if(name !=null) { xjmr.marshall(inScopeEncStyle, String.class, name, "name", sink, nsStack, ctx); //fill the gap for the age parameter yourself…… sink.write(StringUtils.lineSeparator);}sink.write("</" + context + '>');

|||||||||||||||||||||||||||||| The Generated XML-instance |||||||||||||||||||||||||||||||||||||||||||||||||||

<serviceParam xmlns:ns2=”some uri” xsi:type=”ns2:Person”> <age xsi:type=” xsd:int”>22</age> <name xsi:type=xsd:string”>Paul</name></serviceParam>

Apache SOAP: Custom Serialization(cont.)

http://javaboutique.internet.com/tutorials/SOAP/index3.html

Page 36: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

public class BeanSerializer implements Serializer, Deserializer { public void marshall(String inScopeEncStyle, Class javaType, Object src, Object context, Writer sink, NSStack nsStack, XMLJavaMappingRegistry xjmr, SOAPContext ctx) throws IllegalArgumentException, IOException { … PropertyDescriptor[] properties = getPropertyDescriptors(javaType); for (int i = 0; i < properties.length; i++) { String propName = properties[i].getName(); Class propType = properties[i].getPropertyType(); // Serialize every property except the "class" property. if (!propType.equals(Class.class)){ Method propReadMethod = properties[i].getReadMethod(); // Only serialize readable properties. if (propReadMethod != null){ Object propValue = null; // Get the property's value. try{ if (src != null) { propValue = propReadMethod.invoke(src, new Object[]{}); } } catch (Exception e) {…} // Serialize the property. Parameter param = new Parameter(propName, propType, propValue, null); xjmr.marshall(Constants.NS_URI_SOAP_ENC, Parameter.class, param, null, sink, nsStack, ctx);

Apache SOAP: Default Serialization

Page 37: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

private PropertyDescriptor[] getPropertyDescriptors(Class javaType) throws IllegalArgumentException {

BeanInfo beanInfo = null; try { beanInfo = Introspector.getBeanInfo(javaType); } …

Apache SOAP: Default Serialization(cont.)

From: \soap-src-2.3\soap-2_3\src\org\apache\soap\encoding\soapenc\BeanSerializer.java

Page 38: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Web Services Description Language (WSDL):WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. The operations and messages are described abstractly, and then bound to a concrete network protocol and message format to define an endpoint(from: http://www.w3.org/TR/wsdl#_soap-e)

Universal Description, Discovery & Integration (UDDI):The UDDI Business Registry is the implementation of the specification developed by uddi.org. The UDDI Business Registry is a core element of the infrastructure that supports web services. The UDDI Business Registry provides a place for a company to register its business and the services that it offers. People or businesses that need a service can use this registry to find a business that provides the service.(from: http://www.uddi.org/faqs.html#who)

Page 39: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

<?xml version="1.0"?> <definitions name="StockQuote" targetNamespace="http://example.com/stockquote.wsdl" xmlns:tns="http://example.com/stockquote.wsdl" xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" xmlns:xsd1="http://example.com/stockquote.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">

<message name="GetTradePriceInput"> <part name="tickerSymbol" element="xsd:string"/> <part name="time" element="xsd:timeInstant"/> </message>

<message name="GetTradePriceOutput"> <part name="result" type="xsd:float"/> </message>

<portType name="StockQuotePortType"> <operation name="GetTradePrice"> <input message="tns:GetTradePriceInput"/> <output message="tns:GetTradePriceOutput"/> </operation> </portType>

WSDL Example (from: http://www.w3.org/TR/wsdl#_soap-e)

Page 40: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

<binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="GetTradePrice"> <soap:operation soapAction="http://example.com/GetTradePrice"/> <input> <soap:body use="encoded" namespace="http://example.com/stockquote" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="http://example.com/stockquote" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation>> </binding>

<service name="StockQuoteService"> <documentation>My first service</documentation> <port name="StockQuotePort" binding="tns:StockQuoteBinding"> <soap:address location="http://example.com/stockquote"/> </port> </service> </definitions>

WSDL Example (cont.)

Page 41: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Q: How does UDDI relate to WSDL?A: There is no formal relationship between UDDI and WSDL (Web Services Description Language), although the technologies are complementary. WSDL can be used to specify a web service interface. The tModel (see following, ed. LL) entry for the service type could point to a WSDL abstract description, and the binding template for a specific service could point to a WSDL concrete description.(from: http://www.uddi.org/faqs.html#web)

Page 42: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

The “tModel” (“t” for Taxonomy):<tModel authorizedName="..." operator="..." tModelKey="..."> <name>StockQuote Service</name> <description xml:lang="en"> WSDL description of a standard stock quote service interface </description> <overviewDoc> <description xml:lang="en"> WSDL source document. </description> <overviewURL> http://example.com/stockquote.wsdl </overviewURL> </overviewDoc> <categoryBag> <keyedReference tModelKey=" uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4" keyName="uddi-org:types" keyValue="wsdlSpec"/> </categoryBag> </tModel>

From: http://www.oasis-open.org/committees/uddi-spec/doc/bp/uddi-spec-tc-bp-using-wsdl-v108-20021110.htm

Page 43: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

The “Binding Template”:

<businessService businessKey="..." serviceKey="..."> <name>StockQuoteService</name> <description> (...) </description> <bindingTemplates> <bindingTemplate> (...) <accessPoint urlType="http"> http://example.com/stockquote </accessPoint> <tModelnstanceDetails> <tModelnstanceInfo tModelKey="..."> </tModelnstanceInfo> <tModelnstanceDetails> </bindingTemplate> </bindingTemplates> </businessService>

From: http://www.oasis-open.org/committees/uddi-spec/doc/bp/uddi-spec-tc-bp-using-wsdl-v108-20021110.htm

Page 44: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

What is Axis?

Axis is essentially a SOAP engine -- a framework for constructing SOAP processors such as clients, servers, gateways, etc. The current version of Axis is written in Java ....

…Axis isn't just a SOAP engine -- it also includes: a simple stand-alone server, a server which plugs into servlet engines such as Tomcat, extensive support for the Web Service Description Language (WSDL), emitter tooling that generates Java classes from WSDL. some sample programs, and a tool for monitoring TCP/IP packets.

(from: http://ws.apache.org/axis/ -- Axis User’s Guide)

Page 45: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Axis provides a utility to generate the skeletons from the WSDL.. An example invocation follows:

java org.apache.axis.wsdl.WSDL2Java --server-side --skeletonDeploy true MessageObject.wsdl

Axis provides a utility to generate the stubs from the WSDL.. An example invocation follows:

java org.apache.axis.wsdl.WSDL2Java MessageObject.wsdl

From: http://www.cs.unc.edu/Courses/comp190/docs/lessons/ws/ws_wsdl/

Page 46: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Security: (from: http://216.239.57.100/search?q=cache:GyWSEczHfFQC:

www.oasis-open.org/presentations/security/PMishra.ppt+SAML+basic+example&hl=en&ie=UTF-8)

- various standards being developed - for example, Security Assertions Markup Language (SAML)

<saml:assertion Issuer=“example.com”…> <saml:Conditions NotBefore=… NotAfter=…/> <saml:AuthenticationStatement AuthenticationMethod=… AuthenticationInstant=… > <saml:subject …>John Doe</saml:subject> </saml:AuthenticationStatement> <saml:AttributeStatement> <saml:subject …>John Doe</saml:subject> <saml:Attribute AttributeName=“Title” …> <saml:AttributeValue>Manager</AttributeValue> </saml:Attribute> <saml:Attribute AttributeName=“SpendLimit” …> <saml:AttributeValue>10,000</AttributeValue> </saml:Attribute> </saml:AttributeStatement> </saml:Assertion>

Page 47: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

WS-I (Web Services Interoperability Organization):

WS-I was formed specifically for the creation, promotion, or support of Generic Protocols for Interoperable exchange of messages between services. Generic Protocols are protocols that are independent of any specific action indicated by the message beyond actions necessary for the secure, reliable, or efficient delivery of messages; "Interoperable" means suitable for and capable of being implemented in a neutral manner on multiple operating systems and in multiple programming languages.

(from: http://www.ws-i.org/)

Page 48: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

1. Web Services testing and implementation guidance to accelerate customer deployments

a. Encourage best-practices use of "baseline" Web Services today (XML, SOAP, WSDL, UDDI)

b. Deliver a set of self-administered test suites for conformance of baseline specification implementations aimed at improving interoperation of infrastructure and applications.

What the WS-I does:

(from: http://www.ws-i.org/FAQ.aspx#A01)

Page 49: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

A Definition of a “Web Service”A functionality-set or module of computational utility accessible via a network, whether LAN or WAN (e.g., the Internet) by use of textual open standard protocols such as ASCII (actually, UTF-8), XML (especially SOAP) and HTTP, especially in the interest of facilitating interoperation of nodes of an heterogeneous distributed system.

Page 50: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Typical “Web Services” Technology-Stack:

UDDIWSDLSOAPXML

UTF-8HTTP

TCP/IPEthernet/PPP/Wireless

Page 51: Web Services The “langua franca” of distributed systems? Developed by Larry LeFever for CS616: Software Engineering Seminar Spring 2003, Pace University,

Haben SieFragen?

“Can you read that?” :- )