msdnshared.blob.core.windows.net · web viewthe orchestration should show up as below in the...

Post on 15-May-2020

1 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Biztalk adapter for Host files :

Insert Scenario :

Create a Send Port: Static two ways solicit response

Configure port :

Configure the port (Host file provider connection and may be command to execute)

e.g. Connection string

User ID=BVT22;Password=***************;Network Transport Library=TCP;Host CCSID=37;PC Code Page=1252;Network Address=CONDOR;Network Port=446;Process Binary as Character=False;Persist

Security Info=True;Cache Authentication=False;Location=CONDOR;Default Library=BVT22;Repair Host Keys=False;Strict Validation=False;Metadata=C:\HISTests\DataTests\Binaries\HostFileProvider\Library_AS400.DLL;

e.g request :

<ns0:RequestHF xmlns:ns0="BAHFTest"> <sync> <after> <Library_AS400.BVTTESTS OUT1_CHAR1="TEST_0">BVT22.BVTTESTS</Library_AS400.BVTTESTS> </after> </sync></ns0:RequestHF>

Not that Document Target Namespace can be anything like BAHFTest

Response Root element is the element name that will appear in XML response.

When Creating ports for Orchestration, send pipeline and Receive pipeline should be XMLTransmit and XML receive respectively.

We are not setting any other properties apart from General section

Create orchestration :

Generate XSD and XML instance:

Create new Biztalk type project in visual studio . right click the project name ( in solution explorer ) and hit add generated items :

In the wizard , add adapter metadata . and proceed – finish . At the end you will see , the xsd is created for Metadata like in e.g. below :

  <?xml version="1.0" encoding="utf-16" ?> - <xs:schema xmlns:tns="BAHFTest"

xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="BAHFTest" xmlns:xs="http://www.w3.org/2001/XMLSchema">

- <xs:element name="RequestHF">+ <xs:complexType>

  </xs:element>- <xs:element name="ReponseHF">- <xs:complexType>- <xs:sequence>+ <xs:element name="Success">

  </xs:sequence>  </xs:complexType>  </xs:element>  </xs:schema>

More closely , Request element is :

- <xs:element name="RequestHF">- <xs:complexType>- <xs:sequence>- <xs:element xmlns:updategram="urn:schemas-microsoft-com:xml-updategram"

updategram:Prefix="updg" minOccurs="1" maxOccurs="unbounded" name="sync">- <xs:complexType>- <xs:sequence>- <xs:element updategram:Prefix="updg" minOccurs="0" maxOccurs="unbounded"

name="after">- <xs:complexType>- <xs:sequence>- <xs:element minOccurs="0" maxOccurs="unbounded"

name="Library_AS400.BVTTESTS">- <xs:complexType>- <xs:simpleContent>- <xs:extension base="xs:string">  <xs:attribute name="OUT1_CHAR1" type="xs:string" />

  </xs:extension>  </xs:simpleContent>  </xs:complexType>  </xs:element>  </xs:sequence>  </xs:complexType>  </xs:element>  </xs:sequence>  </xs:complexType>  </xs:element>  </xs:sequence>  </xs:complexType>  </xs:element>

- <xs:element name="ReponseHF">

Response element is :

<xs:element name="ReponseHF">- <xs:complexType>- <xs:sequence>- <xs:element name="Success">- <xs:complexType>- <xs:sequence>  <xs:element minOccurs="0" maxOccurs="1" name="RowsAffected" type="xs:int" />

  </xs:sequence>  </xs:complexType>  </xs:element>  </xs:sequence>  </xs:complexType>  </xs:element>

Generate instance of the xsd ;

the instance will look like following XML :

<ns0:RequestHF xmlns:ns0="BAHFTest"> <sync> <after> <Library_AS400.BVTTESTS OUT1_CHAR1="OUT1_CHAR1_0">Library_AS400.BVTTESTS_0</Library_AS400.BVTTESTS> <Library_AS400.BVTTESTS OUT1_CHAR1="OUT1_CHAR1_0">Library_AS400.BVTTESTS_1</Library_AS400.BVTTESTS> <Library_AS400.BVTTESTS OUT1_CHAR1="OUT1_CHAR1_0">Library_AS400.BVTTESTS_2</Library_AS400.BVTTESTS> </after> <after> <Library_AS400.BVTTESTS OUT1_CHAR1="OUT1_CHAR1_0">Library_AS400.BVTTESTS_0</Library_AS400.BVTTESTS> <Library_AS400.BVTTESTS OUT1_CHAR1="OUT1_CHAR1_0">Library_AS400.BVTTESTS_1</Library_AS400.BVTTESTS> <Library_AS400.BVTTESTS OUT1_CHAR1="OUT1_CHAR1_0">Library_AS400.BVTTESTS_2</Library_AS400.BVTTESTS> </after> <after> <Library_AS400.BVTTESTS OUT1_CHAR1="OUT1_CHAR1_0">Library_AS400.BVTTESTS_0</Library_AS400.BVTTESTS> <Library_AS400.BVTTESTS OUT1_CHAR1="OUT1_CHAR1_0">Library_AS400.BVTTESTS_1</Library_AS400.BVTTESTS> <Library_AS400.BVTTESTS OUT1_CHAR1="OUT1_CHAR1_0">Library_AS400.BVTTESTS_2</Library_AS400.BVTTESTS> </after> </sync>

</ns0:RequestHF>

Change it to more acceptable format for Host file adapter:

<ns0:RequestHF xmlns:ns0="BAHFTest"> <sync> <after> <Library_AS400.BVTTESTS OUT1_CHAR1="TEST_0">BVT22.BVTTESTS</Library_AS400.BVTTESTS> </after> </sync>

</ns0:RequestHF>

Now store this XML file into some directory say c:\BAHFprojects

Now we will create Orchestration :

Click on the BizTalk Orchestration.odx file and you will get the work area to create ports .

As shown below create 3 ports :

Explanation of wizards for configuring ports shown above:

Note in above screen we have mentioned Transport = FILE and URI = c:\input\*.xml. This is the receive location where the XML file created for Insert request will be placed.

Receive pipeline is : XML recieve

Similarly create Host file send receive port through Wizard .

This will be :

I will be sending a Host file request and receiving a host file response back on this two way port.

Now that you have created ports, create the flow of messages by using orchestration toolbox.

Drag and drop receive send ports on the flow chart :

Create messages as displayed in below orchestration view of project explorer.

Assign messages and operations as below :

Now give a key to assembly and deploy the orchestration project .

. after successful deploy , go to Biztalk administration and hit refresh .

The orchestration should show up as below in the Application where you have created your send receive host files port.

Now start all ports and then enlist the orchestration .( NOTE: make sure you have configured the binding for Host file send – recieve port before )

Now drop the Input XML file into c:\input

This will go away in some time and you will see the response in:

C:\outpuyt\po.xml

Also now if you browse the online file, you should see the inserted row there .

Thus we complete the insert scenario for BAHF.

top related