68
CSV to XML Task 1 Converting CSV to XML CSV XML Exp219, Shankar,Bose ------------------ <Employee> <Empid>Exp219</Empid> <Name> Shankar</Name> <Last Name>Bose</LastName> </Employee>

IIB Tutorials

Embed Size (px)

DESCRIPTION

IIB Tutorials

Citation preview

CSV to XML

CSV to XMLTask 1 Converting CSV to XML

CSV XMLExp219, Shankar,Bose ------------------ Exp219 ShankarBose CSV to XMLStep1 Create Que Using IBMWebsphere MQ ExplorerInput Que : CSV2XML.IN1 Input Que : CSV2XML.OUT1 Que Manger: IBM9QMGR ( This is the default Que Manager)

CSV to XMLStep1 Create Que Using IBMWebsphere MQ ExplorerInput Que : CSV2XML.IN1 (Create Input Put Que Under Default Que Manger IBM9QMGR )

CSV to XMLStep1 Create Que Using IBMWebsphere MQ ExplorerInput Que : CSV2XML.IN1

CSV to XMLStep1 Create Que Using IBMWebsphere MQ ExplorerInput Que : CSV2XML.IN1

CSV to XMLStep1 Create Que Using IBMWebsphere MQ ExplorerInput Que : CSV2XML.IN1

CSV to XMLStep1 Create Que Using IBMWebsphere MQ ExplorerOut Put Que : CSV2XML.OUT1 (Create Out Put Que Under Default Que Manger IBM9QMGR same as CSV2XML.IN1)

CSV to XMLStep2 Creating New Application Named CSV2XML using IBM Integration Toolkit

CSV to XMLStep3 Creating Message Model Under Application Named CSV2XML

CSV to XML

CSV to XMLStep3 Creating Message Model Under Application Named CSV2XML>> Creating Schema >>Add Message to Schema

CSV to XMLStep4 Creating Message Model Under Application Named CSV2XML>> Creating Schema>>Add Message to Schema

CSV to XMLStep5Creating Message Model Under Application Named CSV2XML>> Creating Schema>>Add Message to Schema>> Test Parse Model

CSV to XMLStep6 Creating Message Model Under Application Named CSV2XML>> Creating Schema>>Add Message to Schema>> Test Parse ModelNote: Create Input CSV file named CSV2XMLIN.txt to be transformed to XML

CSV to XMLStep6 Creating Message Model Under Application Named CSV2XML>> Creating Schema>>Add Message to Schema>> Test Parse ModelInput Schema tested

CSV to XMLStep6 Creating Message Model Under Application Named CSV2XML>> Creating Schema for Out Put Xml

CSV to XMLStep6 Creating Message Model Under Application Named CSV2XML>> Creating Schema for Out Put Xml

CSV to XMLStep6 Creating Message Model Under Application Named CSV2XML>> Creating Schema for Out Put Xml

CSV to XMLStep7 Creating Message Model Under Application Named CSV2XML>> Creating Schema for Out Put Xml>> Creating XSDOpen http://www.freeformatter.com/xsd-generator.html to generate XSD

CSV to XMLStep7 Creating Message Model Under Application Named CSV2XML>> Creating Schema for Out Put Xml>> Creating XSD1. Paste the XSD in the Source as shown in the Screen shot and Save

CSV to XMLStep7 Creating Message Model Under Application Named CSV2XML>> Creating Schema for Out Put Xml>> Creating XSD1. Close the CSV2XML_OUTPUT.xsd and reopen It2. Click the Design Tab

CSV to XMLStep8 Creating Message Model Under Application Named CSV2XML>> Creating Message Flow

CSV to XMLStep8 Creating Message Model Under Application Named CSV2XML>> Creating Message Flow

CSV to XMLStep9 Creating Message Model Under Application Named CSV2XML>> Creating Message Flow>> Input Node propertyPaste The Que name as CSV2XML.IN1

CSV to XMLStep9 Creating Message Model Under Application Named CSV2XML>> Creating Message Flow>> Compute Node property

CSV to XMLStep9 Creating Message Model Under Application Named CSV2XML>> Creating Message Flow>> Out Put Node propertyPaste The Que name as CSV2XML.OUT1 AND Queue Manager name as IB9QMGR

CSV to XMLStep9 Creating Message Model Under Application Named CSV2XML>> Creating Message Flow>> Compute Node property

CSV to XMLStep9 Creating Message Model Under Application Named CSV2XML>> Creating Message Flow>> EsqlClick Compute Node and add the Following Code

CSV to XMLStep9 Creating Message Model Under Application Named CSV2XML>> Deploying Message Flow

CSV to XMLStep10 Write and read from Queue using RfhUtil

CSV to XML>> Using Debug Mode>> Launching Debugger

CSV to XML>> Using Debug Mode>> Launching Debugger

CSV to XML>> Using Debug Mode>> Launching Debugger

CSV to XML>> Using Debug Mode>> Launching DebuggerCSV to XML (LOOP)Task 2 Converting CSV to XML

Kroger,MR.,Vivek,Arora,EXP268Kroger,MR.,Shankar,Bose,EXP219Kroger,MS.,Isha,Arora,EXP214Kroger2,Mr.,Zeeshan,Ahmad,EXP209

Vivek Arora EXP268 Shankar Bose EXP219 Isha Arora EXP214 Zeeshan Ahmad EXP209

CSV to XML(LOOP)

CSV to XML (LOOP)

CSV to XML (LOOP) >> ESQLCREATE FUNCTION Main() RETURNS BOOLEANBEGIN-- CALL CopyMessageHeaders();-- CALL CopyEntireMessage();

DECLARE org_name CHARACTER 'abc';DECLARE i INTEGER 1;DECLARE j INTEGER 0;

FOR index1 AS InputRoot.DFDL.CSV2XML_LOOP_IN.record[] DO IF org_name index1.organizationTHEN set org_name=index1.organization; SET j=j+1; Set i=1; SET OutputRoot.XMLNS.Organizations.Org[j].(XML.Attribute)OrgName= index1.organization; END IF ; /*Write Element and then attribute*/ SET OutputRoot.XMLNS.Organizations.Org[j].Employee[i].(XML.Element)EmployeeFirstName =index1.firstname; SET OutputRoot.XMLNS.Organizations.Org[j].Employee[i].EmployeeFirstName.(XML.Attribute)Salutation =index1.salutation; SET OutputRoot.XMLNS.Organizations.Org[j].Employee[i].EmployeetLastName =index1.lastname; SET OutputRoot.XMLNS.Organizations.Org[j].Employee[i].EmployeeID =index1.empid; SET org_name= index1.organization; SET i=i+1; END FOR ;

RETURN TRUE;END;XML to CSV (LOOP)Task 3 Converting CSV to XML

Kroger,MR.,Vivek,Arora,EXP268Kroger,MR.,Shankar,Bose,EXP219Kroger,MS.,Isha,Arora,EXP214Kroger2,Mr.,Zeeshan,Ahmad,EXP209

Vivek Arora EXP268 Shankar Bose EXP219 Isha Arora EXP214 Zeeshan Ahmad EXP209

XML to CSV(LOOP) >> ESQLCREATE COMPUTE MODULE XML2CSV_ComputeCREATE FUNCTION Main() RETURNS BOOLEANBEGIN-- CALL CopyMessageHeaders();-- CALL CopyEntireMessage();

DECLARE i INTEGER 1; FOR index AS InputRoot.XMLNS.Organizations.Org[] DO FOR index2 AS index.Employee[] DO SET OutputRoot.DFDL.CSV2XML_LOOP_IN.record[i].organization=index.OrgName; SET OutputRoot.DFDL.CSV2XML_LOOP_IN.record[i].salutation=index2.EmployeeFirstName.Salutation; SET OutputRoot.DFDL.CSV2XML_LOOP_IN.record[i].firstname=index2.EmployeeFirstName; SET OutputRoot.DFDL.CSV2XML_LOOP_IN.record[i].lastname=index2.EmployeetLastName; SET OutputRoot.DFDL.CSV2XML_LOOP_IN.record[i].empid=index2.EmployeeID; SET i =i+1; END FOR; END FOR;

RETURN TRUE;END;Dynamic QueTask 3 At run Time The Queue need to decided

Dynamic QueueTask 3 At run Time The Queue need to decided

Dynamic QueueTask 3 At run Time The Queue need to decided

Dynamic QueueTask 3 At run Time The Queue need to decided

SOAPTask 4: Currency Convertor using the Web Service : http://www.webservicex.com/CurrencyConvertor.asmx

SOAPStep1 : Copy the WSDL from http://www.webservicex.com/CurrencyConvertor.asmx?wsdl and save it Step2: Test the Webservice using SOAP UTILStep3: Create the Message Flow as shown in the Previous SlideStep4: Click the SOAP request and Select the WSDL file

SOAPStep5 : Add the following Code in Compute Node

Note the name space you get From WSDL

Creating Web ServiceTask : Publish the Message Flow as Service

Creating Web Service

Step1 : Create New Application Named WebService Creating Web ServiceStep2 : Create WSDL for Web Service>> Setting Message Set Preferences

Creating Web ServiceStep2 : Create WSDL for Web Service>> Creating Message Set

Creating Web ServiceStep2 : Create WSDL for Web Service>> Creating Message Set

Creating Web Service

Step2 : Create WSDL for Web Service>> Creating Message Set Creating Web ServiceStep2 : Create WSDL for Web Service>> Creating Message Set

Creating Web ServiceStep2 : Create WSDL for Web Service>> Creating Message Set>> Message Definition File

Creating Web ServiceStep2 : Create WSDL for Web Service>> Creating Message Set>> Message Definition File >> Message

Creating Web ServiceStep2 : Create WSDL for Web Service>> Creating Message Set>> Message Definition File >> MessageNote : Message named Currency_Convertor_Msg is for SOAP Input

Creating Web ServiceStep2 : Create WSDL for Web Service>> Creating Message Set>> Message Definition File >> Message Create Message named Conversion_Rate ( similar to Currency_Convertor_Msg ) for SOAP Reply

Creating Web ServiceStep2 : Create WSDL for Web Service>> Creating Message Set>> Message Definition File >> Message>> Generate WSDL

Creating Web ServiceStep2 : Create WSDL for Web Service>> Creating Message Set>> Message Definition File >> Message>> Generate WSDL

Creating Web ServiceStep3 : Create Message Flow

Creating Web ServiceStep3 : Create Message Flow

Creating Web ServiceStep3 : Create Message Flow

Creating Web ServiceStep3 : Create Message Flow

Creating Web ServiceStep3 : Create Message Flow

Modify the Default Message Flow

Creating Web ServiceStep3 : Create Message Flow> Compute Node

Test Message Flow

Test Message Flow Using SOAP UI

Note : Create WSDL again from message set and while creating it export it to external Directory and refer the same WSDL in SOAP UI