DOC PREVIEW
CMU ISM 95702 - XSDL and WSDL

This preview shows page 1-2-3-25-26-27 out of 27 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Web Services Description LanguageXSDL and WSDLWSDLSlide 4WSDL StructureSlide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12Slide 13Slide 14Slide 15Slide 16WSDL Message Exchange PatternsWriting A Google ClientA Google Client in JavaSlide 20Slide 21A Google Client in C#Slide 23Another simple clientCode GenerationWrite a Java ClientSimulated OutputWeb Services Description Languagehttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwebsrv/html/understandWSDL.aspNotes from article by Aaron Skonnard found atXSDL and WSDL•XSDL (The XML Schema Definition Language) allows us to describe the structure of an XML message•WSDL allows us to describe message exchangesWSDL•A message exchange is called an operation•Related operations are grouped into interfaces•A binding specifies concrete details about what goes on the wireWSDL•Describes the contract between applications•Can be automatically generated from a collection of Java or C# classes•Can be read by utilities that generate client side stub code or server side ties•See wscompile (Sun’s J2EE) or wsdl.exe on the Microsoft sideWSDL Structure<definition> <!– abstract definitions  <types> <messages> <portType> <!– concrete definitions  <binding> <service></definition>WSDL Structure<definition> <!– Terms found in application code  <types> <messages> <portType> <!– Handled by XML infrastructure  <binding> <service></definition>WSDL Structure<definition> <types> - a container for XSDL Type definitions - element names may be defined here as wellWSDL Structure<definition> <types> For example, in Google’s WSDL,GoogleSearchResult is defined as a complex type with many elements.WSDL Structure<definition> <types> <message> - May have more than one part (think parameters) - Define the input or output of an operation - RPC style messages associate a name with a type (defined above) - Document style messages associate a name with an XML element</definition>WSDL Structure<definition> <types> <message> Two examples: - In Google’s WSDL, a doGoogleSearch message is defined with many parts of basic xsd types. - In Google’s WSDL, a doGoogleSearchResponse message is defined as of type GoogleSearchResult </definition>WSDL Structure<definition> <types> <messages> <portType> - The definition of an interface or group of operations - The term “portType” will be replaced with the term “interface” in WSDL 1.2 - Each operation has a name and normally specifies both input and output messages</definition>WSDL Structure<definition> <types> <messages> <portType> - For example, in Google’s WSDL, GoogleSearchPort contains three operations. - The operation doGoogleSearch has an input message (doGoogleSearch) and an output message (doGoogleSearchResponse.)</definition>WSDL Structure<definition> <types> <messages> <portType><binding> - Each binding has a unique name that is associated with a particular interface. - The protocol used is specified. - Details found here specify how the data will look on the wire.</definition>WSDL Structure<definition> <types> <messages> <portType><binding> - For example, in Google’s WSDL, the binding name GoogleSearchBinding is introduced and is associated with the interface GoogleSearchPort. - Each operation within that interface is described as soap operations.</definition>WSDL Structure<definition> <types><messages><portType><binding> <service> - Defines a collection of ports (endpoints) that exposes a particular bindind - An address is associated with a binding</definition>WSDL Structure<definition> <types><messages><portType><binding> <service> For example, in Google’s WSDL, the service name GoogleSearchService is introduced. The interface GoogleSearchPort is associated with the binding GoogleSearchBinding. The service element holds the address of the service.</definition>WSDL Message Exchange Patterns An interface may define four types of operations:•One-Way The endpoint receives a message.•Request-response The endpoint receives a message and returns a message.•Solicit-response The endpoint sends a message and receives a response.•Notification The endpoint sends a message.Writing A Google Client(1) Get the WSDL from http://www.google.com/apis/(2) If using .NET run wsdl.exe on GoogleSearch.wsdl.(3) If using Java and Axis run wsdl2java.bat on GoogleSearch.wsdl.(4) wsdl2java.bat holds the line java org.apache.axis.wsdl.WSDL2Java %1 The WSDL2Java class is in axis.jarA Google Client in Java// Running a simple Google RPC client for spell checkingimport GoogleSearch.*; // wsdl2java generated packagepublic class MyGoogleClient{ private static String endpointAddress = "http://api.google.com/search/beta2"; public static void main(String[] args) throws Exception { if(args.length != 1) { System.out.println("Usage1: java MyGoogleClient wordToSpellCheck"); System.out.println("Usage2: java MyGoogleClient \"a phrase to spell check\""); System.exit(0); }System.out.println("Contacting Google Web Service at " + endpointAddress); System.out.println("Checking on spelling of '" + args[0]+"'"); GoogleSearchServiceLocator loc = new GoogleSearchServiceLocator(); GoogleSearchPort gp = loc.getGoogleSearchPort(); String answer = gp.doSpellingSuggestion( "n6lHU/FQFHIHzpbzRTPFvrUP4Cw+/k+N", args[0]); if(answer == null) System.out.println("Google likes the spelling of '" + args[0]+"'" ); else System.out.println("Google suggests the spelling '" + answer +"'" ); }}GoogleSpring2005\java>java MyGoogleClient "Cornegi Melon Universeti"Contacting Google Web Service at http://api.google.com/search/beta2Checking on spelling of 'Cornegi Melon Universeti‘Google suggests the spelling 'Carnegie Mellon University'A Google Client in C#// run a client against Google's web serviceusing System;namespace ConsoleApp{class GoogleClient{ public static void Main(string[] args) { try {


View Full Document

CMU ISM 95702 - XSDL and WSDL

Documents in this Course
Homework

Homework

12 pages

Lecture

Lecture

25 pages

Lecture

Lecture

21 pages

Lecture

Lecture

24 pages

Exam

Exam

11 pages

Homework

Homework

16 pages

Homework

Homework

38 pages

lecture

lecture

38 pages

review

review

7 pages

lecture

lecture

18 pages

review

review

8 pages

Chapter2

Chapter2

32 pages

Lecture 4

Lecture 4

47 pages

Lecture

Lecture

22 pages

Naming

Naming

26 pages

lecture

lecture

34 pages

lecture

lecture

42 pages

lecture

lecture

112 pages

Lecture

Lecture

33 pages

Axis

Axis

43 pages

lecture

lecture

32 pages

review

review

17 pages

Lecture

Lecture

53 pages

Lecture

Lecture

80 pages

Lab

Lab

14 pages

Load more
Download XSDL and WSDL
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view XSDL and WSDL and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view XSDL and WSDL 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?