Stages to Services (1)
Web processes perform work Here a CGI script controls programs which analyse bibliographic data in a PDF document
Stages to Services (2)
Results returned in XML Instead of returning flat text, structured XML results are displayed in the output frame.
Stages to Services (3)
Results re-used in new ways Search engine queries can be shown in a WAP environment, as a KWIC list or as page thumbnails.
If only search engines returned XML…
Pre-Web Services
Web server sends a document to a user
Post-Web Services
Web server sends data to a program
invoice
item
item
name
price
ref
name
price
number=1
number=2
type = info
id = xyz
Requirements for Services
We need common transfer formatsSOAP
We need to know how to contact the serviceWDSL
We need to know who offers servicesUDDI
Web Service
A translation service is advertised
SOAP Exposed
How the request and response are constructed
What’s German for “legality” ?
Using SOAP
Construction of SOAP messages is automatic Call call = new Call();
call.setTargetObjectURI("urn:demo1:exchange");
call.setMethodName("getRate");
Vector params = new Vector();
params.addElement( new Parameter("country1", String.class, "USA", null ));
params.addElement( new Parameter( "country2", String.class, "japan", null ));
call.setParams( params );
Response response = call.invoke("http://xmethods.net/soap", "" );
Using APACHE SOAP / see IBM Web Services (R)evolution Tutorial
Connecting to a Service
The client can invokeA local service (with no knowledge)
A Web Service (with currency expertise)
Making A Service
Most hard work is achieved by reflection
public class Exchange
{
public float getRate(String country1,String country2 )
{
return 144.52F;
}
}
Automation
In previous example, client was constructedBy handFrom a human-readable web page
We require a way of describing the service which is machine readable
WSDL
Web Services Description LanguageSimilar to IDLdescribes methods, parameters and resultsallows both SOAP and raw HTTP comms
WSDL Automation
WSDL descriptions can be derived automatically from source codee.g. IBM WSTK or Microsoft .NET
Development environment may automatically wrap as service, produce UI and manage service collectione.g. Microsoft .NET
WS Advantages
InteroperabilityPlatformLanguageDevelopment environment
UbiquityHTTP / XML
Low barrier to takeup Industry Support
WS Disadvantages
Not there yet!SOAP is fairly mature, allowing explicit RPC
Apache / Jakarta
WSDL allows automatic generation of SOAP interfaces
Microsoft .NET IBM WSTK
Statuses
SOAP (v1.2) is a W3C Working Draft WSDL is a W3C Note UDDI is an Industry Initiative
Conclusion
Web Services are a significant focus for Web community
Development is ongoing Obvious step for E-commerce