Presentation is loading. Please wait.

Presentation is loading. Please wait.

 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 23 — Simple Object Access Protocol (SOAP) and Microsoft BizTalk™ Outline 23.1Introduction 23.2Simple.

Similar presentations


Presentation on theme: " 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 23 — Simple Object Access Protocol (SOAP) and Microsoft BizTalk™ Outline 23.1Introduction 23.2Simple."— Presentation transcript:

1  2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 23 — Simple Object Access Protocol (SOAP) and Microsoft BizTalk™ Outline 23.1Introduction 23.2Simple Object Access Protocol (SOAP) 23.3Microsoft BizTalk 23.3.1BizTalk Framework 23.3.2BizTalk Server 23.3.3BizTalk Schema Library 23.3.4Microsoft BizTalk Server 2000

2  2001 Prentice Hall, Inc. All rights reserved. 2 23.1 Introduction Interoperability –Primary goal of many businesses Simple Object Access Protocol (SOAP) –Addresses interoperability problems –Combines HTTP and XML –Provides extensible mode of communication between software systems Microsoft BizTalk –Business messaging and transaction framework –Supports SOAP processing

3  2001 Prentice Hall, Inc. All rights reserved. 3 23.2 Simple Object Access Protocol (SOAP) SOAP –Developed by IBM, Lotus, Microsoft, DevelopMentor and Userland –Supported by Sun Microsystems –HTTP-XML-based protocol Applications communicate over the Internet SOAP messages Compatible with any object model –Platform and software independent

4  2001 Prentice Hall, Inc. All rights reserved. 4 23.2 Simple Object Access Protocol (SOAP) SOAP message –Envelope –header element Means for additional processing Build in more complex protocols –Body Contains application-specific data Remote Procedure Call (RPC) –Request made to another machine to run a task –Uses XML vocabulary –Sent through HTTP POST –Asynchronous RPC

5  2001 Prentice Hall, Inc. All rights reserved. Outline 5 1 // Fig. 23.1 : SimpleService.java 2 // implementation for the requested method on the server 3 4 public class SimpleService { 5 6 public String getWelcome( String message ) throws Exception 7 { 8 String text = 9 "Welcome to SOAP!\nHere is your message: " + message; 10 11 return text; // return text to the request 12 } 13 } SimpleService.java Method getWelcome returns a string when invoked

6  2001 Prentice Hall, Inc. All rights reserved. 6 23.2 Simple Object Access Protocol (SOAP) Fig. 23.2SOAP Package administration tool.

7  2001 Prentice Hall, Inc. All rights reserved. 7 23.2 Simple Object Access Protocol (SOAP) Fig. 23.3Description of deployed service.

8  2001 Prentice Hall, Inc. All rights reserved. Outline 8 1 // Fig. 23.4 : GetMessage.java 2 // Program that makes a SOAP RPC 3 4 import java.io.*; 5 import java.net.*; 6 import java.util.*; 7 import org.apache.soap.*; 8 import org.apache.soap.rpc.*; 9 10 public class GetMessage { 11 12 public static void main( String args[] ) { 13 String encodingStyleURI = Constants.NS_URI_SOAP_ENC; 14 String message; 15 16 if ( args.length != 0 ) 17 message = args[ 0 ]; 18 else 19 message = "Thanks!"; 20 21 try { 22 URL url = new URL( 23 "http://localhost:8080/soap/servlet/rpcrouter" ); 24 25 // build the call 26 Call remoteMethod = new Call(); 27 remoteMethod.setTargetObjectURI( 28 "urn:xml-simple-message" ); 29 30 // set the name of the remote method to be invoked 31 remoteMethod.setMethodName( "getWelcome" ); 32 remoteMethod.setEncodingStyleURI( encodingStyleURI ); 33 34 // set the parameters for the remote method GetMessage.java Client making a SOAP request Imports SOAP package that provides the API for SOAP implementation. Package org.apache.soap.rpc provides implementation for RPC over SOAP Specifies the encoding style used for the message if statemenet assigns message sither string input at the command line or the string “Thanks!” Specifies the server-side URL to which message’s value is sent Instantiates a call object assigned to reference remoteMethod Sets remoteMethod ’s URISets getWelcome as method to be invoked Sets encoding style for the message

9  2001 Prentice Hall, Inc. All rights reserved. Outline 9 35 Vector parameters = new Vector(); 36 parameters.addElement( new Parameter( "message", 37 String.class, message, null ) ); 38 remoteMethod.setParams( parameters ); 39 Response response; 40 41 // invoke the remote method 42 response = remoteMethod.invoke( url, "" ); 43 44 // get the response 45 if ( response.generatedFault() ) { 46 Fault fault = response.getFault(); 47 48 System.out.println( "CALL FAILED:\nFault Code = " 49 + fault.getFaultCode()+ "\nFault String = " 50 + fault.getFaultString() ); 51 } 52 else { 53 Parameter result = response.getReturnValue(); 54 55 // display the result of call 56 System.out.println( result.getValue() ); 57 } 58 } 59 catch ( MalformedURLException me ) { 60 me.printStackTrace(); 61 System.exit( 1 ); 62 } 63 catch ( SOAPException se ) { 64 System.err.println( "Error message: " + se.getMessage() ); 65 System.exit( 1 ); 66 } 67 } 68 } GetMessage.java Client making a SOAP request Builds the parameters passed to remoteMethod for processing Builds a new parameter for the method by constructing a Parameter object Name of the variable or reference Class to which the Parameter object belongs Value of the parameter Specifies the application’s default encoding Invokes the remoteMethod SOAPException is invoked if any network error occurs while the SOAP request is being sent Result is sent to client and stored in the response object Lines 45-51 Determines whether the received message is an error message Lines 53-56 print the output if no error is received

10  2001 Prentice Hall, Inc. All rights reserved. Outline 10 java GetMessage Welcome to SOAP! Here is your message: Thanks! java GetMessage "my message" Welcome to SOAP! Here is your message: my message GetMessage.java Client making a SOAP request Output

11  2001 Prentice Hall, Inc. All rights reserved. 11 23.3 Microsoft BizTalk Business to Business (B2B) transactions –Inter-platform compatibility –Establish protocols and data formats for e-commerce –XML Simplifies data packaging for sharing B2B Schemas –Must have common vocabulary Data transmission and translation –Standardized BizTalk Framework –Three Parts BizTalk Framework BizTalk Server BizTalk Schema Library

12  2001 Prentice Hall, Inc. All rights reserved. 12 23.3.1 BizTalk Framework BizTalk framework –Set of guidelines for publishing schemas Uses XML messages to integrate software systems –Based on SOAP www.biztalk.org –XML schemas necessary for e-commerce and B2B transactions using XML BizTalk schemas –Follow the XML Data Reduced format. Simplified version of XML Data Provides vocabulary of XML elements Standard set of tags for XML messaging between apps. –XML document traverse network as SOAP messages

13  2001 Prentice Hall, Inc. All rights reserved. 13 23.3.1 BizTalk Framework Microsoft Message Queuing (MSMQ) –Distributed computing –Frees up client applications from waiting for the server to complete a transaction –Client posts message to the queue

14  2001 Prentice Hall, Inc. All rights reserved. 14 23.3.2 BizTalk Server Parse, translate and route inbound and outbound XML messages Microsoft BizTalk Server 2000 –Manages XML messages –Uses XSLT to perform translations Formats data

15  2001 Prentice Hall, Inc. All rights reserved. 15 23.3.2 BizTalk Server Fig. 23.5Sample BizTalk interaction between a store, a supplier and a warehouse.

16  2001 Prentice Hall, Inc. All rights reserved. 16 23.3.3 BizTalk Schema Library Schema Library –Collection of BizTalk Framework schemas Common repository for common XML schemas –Found at www.biztalk.orgwww.biztalk.org


Download ppt " 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 23 — Simple Object Access Protocol (SOAP) and Microsoft BizTalk™ Outline 23.1Introduction 23.2Simple."

Similar presentations


Ads by Google