150 likes | 307 Views
XML4BPM. PASSAU. Wrapping Legacy Software for Reuse in a SOA Harry M. Sneed AneCon GmbH, Wien E-mail: Harry.Sneed@anecon.com. Sources of Web Services Salvaging Web Services from Legacy Systems Wrapping Legacy Components Sample of a Legacy Component Sample Wrapping of the Component
E N D
XML4BPM PASSAU Wrapping Legacy Software for Reuse in a SOAHarry M. SneedAneCon GmbH, WienE-mail: Harry.Sneed@anecon.com • Sources of Web Services • Salvaging Web Services from Legacy Systems • Wrapping Legacy Components • Sample of a Legacy Component • Sample Wrapping of the Component • Linking the Wrapped Component to a Business Process • Pros & Cons of Using this Technology • Open Issues in Web Service Technology
Sources of Web Services Business Process (BPEL) WSDL Interfaces First Level Web Services Second Level Web Services Service Oriented Architecture Purchased components Open Source components Self developed components Salvaged components
Salvaging Components from Legacy Code Business Rule Legacy Code Code statements traversed to implement rule Data Used by Source effected Results
Wrapping Salvaged Components Service Request WSDL Interfaces Generate from Inputs Generate from Outputs Generated Wrapper Routines Input Parameters Output Parameters Procedural Code (section, Procedure or Function
XM059 CSECT REGISTER * XM059 EWIGER KALENDER 1901 - 1999 * PARAMETER * --------- * P1: DATUM TT,MM,JJ 8 BYTES AN * P2: SPRACHCODE 1,2,3 * WENN UNGUELTIG = 1 1 BYTE AN * P3: ALINIERUNG L (LINKS) * R (RECHTS) * WENN UNGUELTIG = L 1 BYTE AN * P4: WOCHENTAG OUTPUT 10 BYTES AN * WENN P1 NICHT PLAUSIBEL, WIRD P4 MIT '?' GEFUELLT * DIESER KALENDER BERUHT AUF DER TATSACHE, DASS AM * 1. JANUAR 1901 D I E N S T A G WAR. STM R14,R12,12(R13) BALR R12,0 USING *,R12 ST R13,SAVE+4 LA R11,SAVE ST R11,8(R13) LA R13,SAVE LM R2,R5,0(R1) ********************************************************************* * CHECK INPUT FOR VALIDITY MVC DD,0(R2) MVC MM,3(R2) MVC YY,6(R2) MVC SPC,0(R3) MVC LRS,0(R4) * MVI P16,C'0' CALL XM016,(DDMMYY,P16),VL CLI P16,C'0' BE A1 MVC 0(10,R5),=10C'?' B RET An Assembler Routine to compute the week day
WRAP *LINKAGE SECTION. WRAP 01 xm059-PARAMS. 02 P1. 03 P1-TT PIC 99. 03 P1-MM PIC 99. SNEED 03 P1-CE PIC 99. 03 P1-JJ PIC 99. 02 P2. 03 LANG-CODE PIC 9. 02 P3. 03 DIRECTION PIC X. 02 P4. 03 DAY-NAME PIC X(10). ***************** COBWRAP XML parameters *********************** XMLINS 01 XML-PARAMS. 05 XML-FUNCODE PIC XX. 05 XML-RETCODE PIC 99. 05 XML-FILNAME PIC X(8). COBINS 01 X-COBOL-PARAMS. 05 X-REC-LNG PIC 999. 05 X-MAP-LNG PIC 999. 05 X-ACCEPT-LNG PIC 999. 05 X-DISPLAY-LNG PIC 999. 05 X-ACCEPT-TEXT PIC X(80). 05 X-DISPLAY-TEXT PIC X(80). ***************************************************************** WRAP *PROCEDURE DIVISION USING P1 P2 P3 P4. WRAP PROCEDURE DIVISION. WRAP xm059-WRAPPED-ENTRY. WRAP MOVE 'RD' TO XML-FUNCODE WRAP MOVE ZEROES TO XML-RETCODE WRAP MOVE 'xm059i' TO XML-FILNAME WRAP MOVE 256 TO X-REC-LNG WRAP CALL 'XM059I ' USING XML-FUNCODE, XML-RETCODE, XML-FILNAME, WRAP xm059-PARAMS, X-REC-LNG. The same Routine in COBOL converted und wrapped
Generated XML Schema for the Request <?xml version = "1.0"> <!--This schema was generated from prog:inputs\XM059i.cpy by the Sneed Tool GENSCHEMA on date:040112 --> <schema name = "xm059i" xmlns= "XSDCOB"> <XSDCOB:complexType type = "#file" name = "xm059i" content = "eltOnly" model = "closed"> <XSDCOB:element type = "#char" name = "RETURN-CODE" content = "TextOnly" model = "closed" level = "02" occurs = "1" minOccurs = "0001" maxOccurs = "0001" pos = "0000" lng = "0002" pic = "XX" usage = "DISPLAY"/> <XSDCOB:complexType type = "#params" name = "XM059-PARAMS" content = "eltOnly" model = "closed" level = "02" occurs = "ONEORMORE" minOccurs = "0001" maxOccurs = "unbounded"> <XSDCOB:complexType type = "#group" name = "P1" content = "eltOnly" model = "closed" level = "02" occurs = "ONEORMORE" minOccurs = "0001" maxOccurs = "0001"> <XSDCOB:element type = "#dec" name = "DAY" content = "TextOnly" model = "closed" level = "03" occurs = "ONEORMORE" minOccurs = "0001" maxOccurs = "0001" pos = "0001" lng = "0002" pic = "99" usage = "DISPLAY"/> <XSDCOB:element type = "#dec" name = "MONTH" content = "TextOnly" model = "closed" level = "03" occurs = "ONEORMORE" minOccurs = "0001" maxOccurs = "0001" pos = "0003" lng = "0002" pic = "99" usage = "DISPLAY"/> <XSDCOB:element type = "#dec" name = "YEAR" content = "TextOnly" model = "closed" level = "03" occurs = "ONEORMORE" minOccurs = "0001" maxOccurs = "0001" pos = "0005" lng = "0004" pic = "9999" usage = "DISPLAY"/> </XSDCOB:complexType>
Generated XML Schema for the Request (Continued) <XSDCOB:complexType type = "#group" name = "P2" content = "eltOnly" model = "closed" level = "02" occurs = "ONEORMORE" minOccurs = "0001" maxOccurs = "0001"> <XSDCOB:element type = "#dec" name = "LANGUAGE" content = "TextOnly" model = "closed" level = "03" occurs = "ONEORMORE" minOccurs = "0001" maxOccurs = "0001" pos = "0009" lng = "0001" pic = "9" usage = "DISPLAY"/> </XSDCOB:complexType> <XSDCOB:complexType type = "#group" name = "P3" content = "eltOnly" model = "closed" level = "02" occurs = "ONEORMORE" minOccurs = "0001" maxOccurs = "0001"> <XSDCOB:element type = "#char" name = "ALIGNMENT" content = "TextOnly" model = "closed" level = "03" occurs = "ONEORMORE" minOccurs = "0001" maxOccurs = "0001" pos = "0010" lng = "0001" pic = "X" usage = "DISPLAY"/> </XSDCOB:complexType> <XSDCOB:complexType type = "#group" name = "P4" content = "eltOnly" model = "closed" level = "02" occurs = "ONEORMORE" minOccurs = "0001" maxOccurs = "0001"> <XSDCOB:element type = "#char" name = "DAY-NAME" content = "TextOnly" model = "closed" level = "03" occurs = "ONEORMORE" minOccurs = "0001" maxOccurs = "0001" pos = "0011" lng = "0010" pic = "X(10)" usage = "DISPLAY"/> </XSDCOB:complexType> </XSDCOB:complexType> </XSDCOB:complexType> </schema>
Generated XML Schema for the Response <?xml version = "1.0"> <!--This schema was generated from prog:inputs\XM059o.cpy --> <schema name = "xm059o" xmlns= "XSDCOB"> <XSDCOB:complexType type = "#file" name = "xm059o" content = "eltOnly" model = "closed"> <XSDCOB:element type = "#char" name = "RETURN-CODE" content = "TextOnly" model = "closed" level = "02" occurs = "1" minOccurs = "0001" maxOccurs = "0001" pos = "0000" lng = "0002" pic = "XX" usage = "DISPLAY"/> <XSDCOB:complexType type = "#params" name = "DayofWeekResponse" content = "eltOnly" model = "closed" level = "02" occurs = "ONEORMORE" minOccurs = "0001" maxOccurs = "unbounded"> <XSDCOB:complexType type = "#group" name = "P4" content = "eltOnly" model = "closed" level = "02" occurs = "ONEORMORE" minOccurs = "0001" maxOccurs = "0001"> <XSDCOB:element type = "#char" name = "DAYOFWEEK" content = "TextOnly" model = "closed" level = "03" occurs = "ONEORMORE" minOccurs = "0001" maxOccurs = "0001" pos = "0011" lng = "0010" pic = "X(10)" usage = "DISPLAY"/> </XSDCOB:complexType> </XSDCOB:complexType> </XSDCOB:complexType> </schema>
XML Request with the Date <?xml version = "1.0" encoding = "ISO-8859-1"?> <!DOCTYPE "xm059i" SYSTEM "xm059i.xsd"> <xm059i> <DayofWeekRequest> <P1> <DAY>12</DAY> <MONTH>10</MONTH> <YEAR>1977</YEAR> </P1> <P2> <LANGUAGE>3</LANGUAGE> </P2> <P3> <ALIGNMENT>1</ALIGNMENT> </P3> <P4> <DAYOFWEEK>XXXXXXXXXX</DAYOFWEEK> </P4> <RETURN-CODE>00</RETURN-CODE> </DayofWeekRequest> </xm059i>
XML Response with the Day of Week <?xml version = "1.0" encoding = "ISO-8859-1"?> <!--DOCTYPE XM059O SYSTEM "XM059O.xsd"--> <XM059O> <DayofWeekResponse> <RETURN-CODE>00</RETURN-CODE> <P4> <DAYOFWEEK>MERCOLEDI</DAYOFWEEK> </P4> </DayofWeekResponse> </XM059O>
Pros & Cons of using this Technology PROS: • Legacy Components are readily available • Legacy Components can be wrapped automatically • Legacy Components have been tested thru the years • Web Services can be made available in a short time CONS: • Legacy components to not always fit • Legacy components are costly to change • Legacy components to not conform to modern technology, there may be hidden incompatibilities
Open Issues in Web Service Technology • What is the proper granularity of a Web Service ? • too large components do not fit into the business process • the business process must be built around the components • too small components are difficult to manage and control • the components must be adapted to fit the business process • Who is responsible for testing the Web Services ? • Should Web Services be owned by the user or should he only use them - Computing on Demand ? • Will Web Services really reduce costs and improve the IT Service or is this just another gimmick to get money from silly IT users ?