Connecting To WebSphere ESB And WebSphere Process Server

Transcription

IBM Software Services for WebSphereConnecting to WebSphere ESB and WebSphereProcess ServerAndrew Ferrier, IT ConsultantWebSphere ESB Specialistandrew.ferrier@uk.ibm.com 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServerHistory Loosely based on RedbookConnecting EnterpriseApplications to WebSphereEnterprise Service Bus (andRedbooks workshop of the samename) Will also mention some new 6.1items (e.g. HTTP binding, WTXdata bindings, data handlers)2 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServerAgenda WebSphere ESB and WebSphere PS – What arethey? Overview of SCA, SDO, and Bindings Simple Example of WebSphere MQ Data Binding Overview of Other Bindings Overview of Data Handlers3 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServerWebSphere SOA StackWebSphereWebSphere ProcessServerProcessChoreography,Business LogicIntegration Developer(tooling)WebSphere ESBMessage Transformation,Augmentation, RoutingWebSphere Application ServerJ2EE ApplicationHosting, SupportingServices4 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServerService Component ArchitectureSCA ModuleIExportIRequest /ReplyISCAComponentSCAComponentRRRequest /ReplyOne-wayI5ExportIImport 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServerTypes of Module and Component WebSphere ESB supportsonly Mediation Modules,with:– Mediation FlowComponents– Java Components WebSphere PS alsosupports (Integration)Modules, with:– BPEL (Process)– 6 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServerService Data ObjectDataObject customer createCustomer();customer.setString(“name”, “Fred”);customer.setString(“address”, “123 Anytown”);customer.setDate(“dateOfBirth”, new Date(1975, 2, 1)); Dynamic Java API used foraccessing (mostly) structureddatacustomer.setYearsACustomer(0); customer name Fred /name address 123 Anytown /address date 1975-02-01 /date yearsACustomer 0 /yearsACustomer /customer Business Object is definitionof SDO at design time(underlying representation isXML Schema)7 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServerBusiness Object Definition of a Service Data Object at design time Underlying definition is an XML Schema xsd:schema xmlns:xsd "http://www.w3.org/2001/XMLSchema"targetNamespace "http://mm1" xsd:complexType name "Customer" xsd:sequence xsd:element minOccurs "0" name "name" type "xsd:string"/ xsd:element minOccurs "0" name "address“ type "xsd:string“/ xsd:element minOccurs "0" name "dateOfBirth“ type "xsd:date“/ xsd:element minOccurs "0" name "yearsACustomer“ type "xsd:int“/ /xsd:sequence /xsd:complexType /xsd:schema 8 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServerTypes of Import and Export (Bindings) Web Services Bindings Messaging Bindings:– WebSphere MQ and MQ / JMS Bindings– JMS Bindings (incl. Generic – new in 6.1) HTTP Binding (new in 6.1) Stateless Session Bean Binding (import only) Standalone Reference (export only) JCA (WebSphere) Adapters– Application– Technology WebSphere Business Integration Adapters9 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServerData BindingsExternal Data ‘Bindings’ are reallytransport bindings Also the concept of databindingsData Binding– Some inbuilt, some custom Web Services (transport)binding is the only onewithout a data binding10SDO 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServerData Binding Common Superinterfaceimport commonj.connector.runtime.DataBinding;public interface DataBinding extends Serializable {public DataObject getDataObject();public void setTransportDataObject(DataObject dataObject);public void setSpecificData(xyz);public XYZ getTransportSpecificData();}11 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServerFunction SelectorFunction Selector (Java Class)Function (native method)Method BindingsOperation on interface12 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServerWebSphere MQ Bindings Provide a way to read and write messages toWebSphere MQ– Expose services via exports– Invoke services via imports MQ data binding needed for body of message Inbuilt support for MQRFH and MQRFH2 headers Other headers supported via custom headerbindings13 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServerExample Interaction with MQ ExportQueue ManagerWebSphere ESBRecv. QMQSend Q14ExportComponent 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServerSupplied MQ l.Serialized as XMLMQDataBindingImplXMLSerialized Java ObjectMQDataBindingImplJavaUnstructured Text MessageMQDataBindingImplText(uses JMSTextBody BO)Unstructured Binary MessageMQDataBindingImplBinary(uses JMSBytesBody BO)WTX Data Binding 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServerUnstructured Data Bindings Use JMSTextBody andJMSBytesBody pre-definedBusiness Objects16 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServerImplementing a Custom MQ Data Binding Interface is– com.ibm.websphere.sca.mq.data.MQBodyDataBinding (implements commonj.connector.runtime.DataBinding) Most important additional methods:– public void read(MQMD md, List headers, MQDataInputStream input);– public void write(MQMD md, List headers, MQDataOutputStreamoutput); Other methods:– public boolean isBusinessException();– public void �� public void setFormat(String format);– public String getFormat();17 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServerImplementing a Custom MQ Data bject()Data ObjectsetDataObject() 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServerSimple Example – Getting Customer Info19 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServerCustomer and CustomerInfo CustomerInfo:struct CustomerIdentifier {MQCHAR[8] id;MQINT[32] geographyNumber;} Customer:struct Customer {MQCHAR[32] name;MQCHAR[256] address;MQCHAR[8] dateOfBirth;// YYYYMMDDMQINT[32] yearsACustomer;}20 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process Serverread() methodpublic class CustomerMQBinding implements MQBodyDataBinding {private int geographyNumber;private String id;public void read(MQMD mqmd, List headers, MQDataInputStreaminputStream){id inputStream.readMQCHAR(8);geographyNumber inputStream.readMQINT32();}21 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServergetDataObject() methodpublic DataObject getDataObject() throws DataBindingException {DataObject object tifier");object.setString("id", id);object.setInt("geographyNumber", geographyNumber);return object;}private DataObject constructBusinessObject(String namespace, String name) {BOFactory bofactory (BOFactory) sphere/bo/BOFactory");DataObject object bofactory.create(namespace, name);return object;}22 2008 IBM Corporation

Connecting to WebSphere ESB and WebSphere Process ServersetDataObject() methodprivate String name;private String address;private int totalSpend;private Date dateOfBirth;public void setDataObject(DataObject arg0){name arg0.getString("name");address arg0.getString("address");dateO

WebSphere Process Server WebSphere ESB WebSphere Application Server Process Choreography, . WebSphere Business Integration Adapters. Connecting to WebSphere ESB and WebSphere Process Server . Queue Manager WebSphere ESB MQ Export Recv. Q Send Q Component.