Profil de Denzil PintoTheBuzzPhotosBlogListes Outils Aide

Blog


16 mai

Call an External Assembly from a map

BizTalk Map gives you the ability to call an external assembly by using a Scrpting functoid. Sometimes you need some additional functionality and the ability to call an external assembly is great.
 
We are going to get started by creating a new BizTalk project file in Visual studio. Then we are going to create two new schemas
 
OrderItems
 ---------------
 
1. Right click on your project file and click on Add > Add New Item . Select Schema from the Templates provided and enter the name OrderItems.xsd and click on Open.
2. In the Schema Editor Right click on the Root Node and select Rename from the list and enter the name Order and press Enter.
3. Right Click on Order and select Insert Schema Node and select Child Field Element. Enter the name OrderID and press Enter. Again Right click on order and select Insert Schema node and select Child Field Element. Enter the name Description and press Enter.
4. Now we are going to add a new Child Record. Again Right click on Order and select Insert Schema Node and select Child Record, enter the name Unit and press Enter.
5. Follow the 3 step and create new Child Field Elements called UnitID, Description,TotalUnits,Price.
6. Now click on TotalUnits and right click and select properties, goto the DataType and select xs:int. Follow the same steps for the Price and select xs:int for the datatype.
7. We have now created our first schema
 
Now lets create our second schema called Purchase.xsd
 
Purchase
-------------
 
1. Right Click on your project file and click on Add > Add New Item. Select Schema from the templates provided and enter the name Purchase.xsd and click on Open.
2. In the Schema Editor Right click on the Root Node and select Rename from the list and enter the name Purchase and press Enter.
3. Right Click on Purchase and select Insert Schema Node and select Child Field Element. Enter the name OrderID. Follow the same step and create another Child Field Element called Description.
4. Now add a new Child Record called Unit. To do that right click on Purchase node and select Insert Schema Node and select Child Record, enter the name Unit and press Enter.
5. Follow the 3 step and create new child field elements called Description, Units, Price and Total.
6. Now click on Total and right click and select properties, goto the DataType and select xs:int.
7. We have now created our second schema. The Total in this schema will be (Price X Units).
 
OrderItemsToPurchasemap
------------------------------------
 
1. Now lets create a new Map call it OrderItemsToPurchasemap.btm. For that you need to right click on the project file and select Add > Add New Items and from the templates select map, enter the name "OrderItemsToPurchasemap.btm" and select open.
2. In the Mapper tool, click on open source schema and drilldown Schema and select Order Items and then click on Open Destination Schema and drilldown Schema and select Purchase.
3. Now click on OrderID in the Source Schema and then drag it across the grid to the destination field " OrderID" in the destination schema. Do the same for Description. 
4. Click on Description the child field element from Unit and drag it across the grid to the destination field "Description" in the destination schema.
5. Click on TotalUnits and drag it across the grid to the destination field Units in the destination schema. Click on Price and drag it across the grid to the destination field Price in the destination schema.
 
Now we are going to add a functoid.
 -----------------------------------------------
 
1.  If you dont have the Toolbox open Click on View > ToolBox.
2. Click on Advanced Functoids and click on scripting, drag and drop it on the grid portion of the mapper.
3. Click on TotalUnits in your Source Schema (OrderItems), and drag and drop it on the Scripting Functoid.
4. Click on Price in your Source Schema(OrderItems), and drag and drop it on the Scripting Functoid.
 
Class Library
------------------
 
1. Well lets now create a new Class Library. Go to your Solution Explorer, click on your Solution, right click and select New Project.
2. From the Project Types select Visual C# Projects and from the templates select Class Library. Enter a new Name and click OK.
3. Rename Class1 to TestClass.cs. To do that right click on Class1 and select Rename, enter the name TestClass.cs.
4. Open the new class and paste the code below
 
using System;
namespace BizTalkLink
{
  public class TestClass
 {
  public TestClass()
  {
   
  }
  public int calculateTotal(int unit, int price)
  {
   int total;
   total=(unit * price);
   return total;
  }
 }
}
 
5. Now lets build your solution. Save all your work. Click on Build > Build Solution.
 
Strong Name Key
------------------------
 
1. Now we need to strong key your class library. Open the command prompt, Click on All Programs > Microsoft Visual Studio .Net 2003 > Visual Studio .Net Tools > Visual Studio .Net 2003 Command Prompt.
2. Navigate to where your have created your new class library project.
3. To derive a strong key type the following command: sn -k test.snk.
 
 
4. Once you have done that then go to you class library AssemblyInfo.cs.
5. We need to edit the assemblykeyfile : [assembly: AssemblyKeyFile("c:\\solutions\\biztalksolution\\externalassemblytest\\test.snk")]. So now it will contain the location to your strong key file you just generated. Here we have specified the physical path, but you can specify relative path and that will be covered in another example.
 
6. Click on Build Solution again and make sure there are no errors.
 
gacutil
-----------
 
1. Now we need gac your new dll.
2. Go to your command prompt again and navigate to the bin/debug folder. for instance in my case that would be c:\solutions\biztalksolution\externalassembly\bin\debug.
3. There you should find a dll which in my case is externalassembly.dll.
4. Now lets gac it. Type the following command : gacutil /if externalassembly.dll.
5. Open your windows explorer and goto your windows folder and then click on assembly. You should see your new dll there for instance in my case is "externalassembly".
 
 You need to now add a reference to your biztalk project for you to be able to access your new dll.
 
1. Now lets add a new reference to our BizTalk project. In your BizTalk project right click on references > add reference.
2. Click on the Projects Tab and select your project click on select and click on OK.
3. Now you have added a new reference to your biztalk project
 
 
1. Now lets go back to our Scripting Functoid in our OrderItemsToPurchasemap.btm.
2. Right Click on the Scripting functoid and select Properties.
3. Click on Input Parameters and select the ellipsis, you will notice that TotalUnits and Price are the input parameters
4. Click OK to close and click on Script and click on the ellipsis. From the Script Type drop down select External Assembly
5. From the Script Assembly select your class library project file that you just created.
6. From the script class select the class.
7. From the Script method select the method.
8. Click on OK.
9. Click on Total in your destination schema and drag and drop it on the scripting functoid.
10. Save your work. 
 
 
1. Well we havent finished as yet, we still need to verify that the version number and the public key token of our external assembly is the right one
2. so now right click on OrderItemsToPurchasemap.btm and select open with > HTML/XML Editor and click open. Click ok if prompted that the document is already open.
3. Now you can see the XML if your document is not formatted correctly. Select View > Toolbars > HTML Editor.
4. If you move your mouse over the html editor you will find an icon that formats your whole document. Click on that. It should be the first icon on your html editor toolbar.
 
1. Now scroll down to <ScripterCode>
2. Now if you scroll to the right you will see the Version and the PublicKeyToken.
3. If you havent already lets again open our explorer and click on the windows folder and then the assembly folder. Select externalassembly from the right pane and rightclick on it and choose properties.
4. Copy the version and the publickeytoken and replace it in your orderItemsToPurchasemap.btm.
5. Save your work.
6. Now right click on your OrderItemsToPurchaseMap.btm in your solutions explorer and click on Test Map.
 

Commentaires (4)

Veuillez patienter...
Le commentaire entré est trop long. Raccourcissez-le.
Vous n'avez rien entré. Réessayez.
Il est actuellement impossible d'ajouter votre commentaire. Réessayez plus tard.
Pour ajouter un commentaire, tu dois avoir l'autorisation de tes parents. Demander l'autorisation
Tes parents ont désactivé les commentaires.
Il est actuellement impossible de supprimer votre commentaire. Réessayez plus tard.
Vous avez dépassé le nombre maximal de commentaires qu'il est possible d'envoyer le même jour. Réessayez dans 24 heures.
Votre compte a pu laisser les commentaires désactivés parce que nos systèmes indiquent que vous risquez d'arroser d'autres utilisateurs de messages. Si vous pensez que votre compte a été désactivé par erreur, contactez l'assistance en ligne de Windows Live.
Effectuez la vérification de sécurité ci-dessous pour finaliser l'envoi de votre commentaire.
Les caractères entrés pour la vérification de sécurité doivent correspondre à ceux de l'image ou du fichier audio.

Pour ajouter un commentaire, connectez-vous avec votre identifiant Windows Live ID (si vous utilisez Messenger ou Xbox LIVE, vous avez un identifiant Windows Live ID). Connectez-vous


Vous n'avez pas d'identifiant Windows Live ID ? Inscrivez-vous

Aucun noma écrit :
http://www.bestlaptopbattery.com.au/hp/mini-1000.htm Hp mini 1000 battery
http://www.bestlaptopbattery.com.au/hp/mini-1001.htm Hp mini 1001 battery
http://www.bestlaptopbattery.com.au/hp/mini-1010nr.htm Hp mini 1010nr battery
http://www.bestlaptopbattery.com.au/hp/mini-1014.htm Hp mini 1014 battery
http://www.bestlaptopbattery.com.au/hp/mini-1035nr.htm Hp mini 1035nr battery
http://www.bestlaptopbattery.com.au/hp/mini-1050.htm Hp mini 1050 battery
http://www.bestlaptopbattery.com.au/hp/nc2400.htm Hp nc2400 battery
http://www.bestlaptopbattery.com.au/hp/nc4000.htm Hp nc4000 battery
http://www.bestlaptopbattery.com.au/hp/nc4010.htm Hp nc4010 battery
http://www.bestlaptopbattery.com.au/hp/nc6000.htm Hp nc6000 battery
http://www.bestlaptopbattery.com.au/hp/nc6100.htm Hp nc6100 battery
http://www.bestlaptopbattery.com.au/hp/nc6110.htm Hp nc6110 battery
http://www.bestlaptopbattery.com.au/hp/nc6120.htm Hp nc6120 battery
http://www.bestlaptopbattery.com.au/hp/nc6230.htm Hp nc6230 battery
http://www.bestlaptopbattery.com.au/hp/nc6400.htm Hp nc6400 battery
http://www.bestlaptopbattery.com.au/hp/nc8000.htm Hp nc8000 battery
http://www.bestlaptopbattery.com.au/hp/nc8200.htm Hp nc8200 battery
http://www.bestlaptopbattery.com.au/hp/nc8230.htm Hp nc8230 battery
http://www.bestlaptopbattery.com.au/hp/nc8430.htm Hp nc8430 battery
http://www.bestlaptopbattery.com.au/hp/nw8000.htm Hp nw8000 battery
http://www.bestlaptopbattery.com.au/hp/nw8200.htm Hp nw8200 battery
http://www.bestlaptopbattery.com.au/hp/nx5000.htm Hp nx5000 battery
http://www.bestlaptopbattery.com.au/hp/nx6100.htm Hp nx6100 battery
http://www.bestlaptopbattery.com.au/hp/nx6120.htm Hp nx6120 battery
http://www.bestlaptopbattery.com.au/hp/nx7000.htm Hp nx7000 battery
http://www.bestlaptopbattery.com.au/hp/nx8200.htm Hp nx8200 battery
http://www.bestlaptopbattery.com.au/hp/pavilion-dv4.htm Hp pavilion dv4 battery
http://www.bestlaptopbattery.com.au/hp/pavilion-dv5.htm Hp pavilion dv5 battery
http://www.bestlaptopbattery.com.au/hp/pavilion-dv6.htm Hp pavilion dv6 battery
http://www.bestlaptopbattery.com.au/hp/pavilion-zd7000.htm Hp pavilion zd7000 battery
http://www.bestlaptopbattery.com.au/hp/pavilion-zd8000.htm Hp pavilion zd8000 battery
http://www.bestlaptopbattery.com.au/hp/pavilion-zv5000.htm Hp pavilion zv5000 battery
http://www.bestlaptopbattery.com.au/hp/pavilion-zv6000.htm Hp pavilion zv6000 battery
http://www.bestlaptopbattery.com.au/hp/pavilion-zx5000.htm Hp pavilion zx5000 battery
http://www.bestlaptopbattery.com.au/hp/pb992a.htm Hp pb992a battery
http://www.bestlaptopbattery.com.au/hp/pb994a.htm Hp pb994a battery
http://www.bestlaptopbattery.com.au/hp/pm579a.htm Hp pm579a battery
http://www.bestlaptopbattery.com.au/hp/presario-2230s.htm Hp presario 2230s battery
http://www.bestlaptopbattery.com.au/hp/presario-c700.htm Hp presario c700 battery
http://www.bestlaptopbattery.com.au/hp/presario-m2000.htm Hp presario m2000 battery
http://www.bestlaptopbattery.com.au/hp/presario-v2000.htm Hp presario v2000 battery
http://www.bestlaptopbattery.com.au/hp/presario-v3000.htm Hp presario v3000 battery
http://www.bestlaptopbattery.com.au/hp/presario-v4000.htm Hp presario v4000 battery
http://www.bestlaptopbattery.com.au/hp/presario-v6000.htm Hp presario v6000 battery
21 Nov.
http://www.toplaptopbatteries.com/dell/d5318.htm dell d5318 battery
http://www.toplaptopbatteries.com/acer/as07b41.htm acer as07b41 battery
http://www.toplaptopbatteries.com/acer/as07b42.htm acer as07b42 battery
http://www.toplaptopbatteries.com/acer/as07b72.htm acer as07b72 battery
http://www.toplaptopbatteries.com/acer/batbl50l6.htm acer batbl50l6 battery
http://www.toplaptopbatteries.com/acer/travelmate-4200.htm acer travelmate 4200 battery
http://www.toplaptopbatteries.com/acer/aspire-5100.htm acer aspire 5100 battery
http://www.toplaptopbatteries.com/dell/original-inspiron-1525.htm dell original inspiron 1525 battery
http://www.toplaptopbatteries.com/hp/dv6000.htm hp dv6000 battery
http://www.toplaptopbatteries.com/dell/inspiron-6400.htm dell inspiron 6400 battery
http://www.toplaptopbatteries.com/dell/1501.htm dell 1501 battery
http://www.toplaptopbatteries.com/dell/e1505.htm dell e1505 battery
http://www.toplaptopbatteries.com/dell/d620.htm dell d620 battery
http://www.toplaptopbatteries.com/dell/d630.htm dell d630 battery
http://www.toplaptopbatteries.com/dell/inspiron-1520.htm dell inspiron 1520 battery
http://www.toplaptopbatteries.com/gateway/m680.htm gateway m680 battery
http://www.toplaptopbatteries.com/gateway/m360.htm gateway m360 battery
http://www.toplaptopbatteries.com/gateway/m460.htm gateway m460 battery
http://www.toplaptopbatteries.com/hp/dv9000.htm hp dv9000 battery
http://www.toplaptopbatteries.com/hp/dv9700.htm hp dv9700 battery
http://www.toplaptopbatteries.com/hp/510.htm hp 510 battery
http://www.toplaptopbatteries.com/dell/latitude-d620.htm dell latitude d620 battery
http://www.toplaptopbatteries.com/hp/530.htm hp 530 battery
http://www.toplaptopbatteries.com/sony/vgp-bps2a.htm sony vgp-bps2a battery
http://www.toplaptopbatteries.com/sony/vgp-bps2b.htm sony vgp-bps2b battery
http://www.toplaptopbatteries.com/sony/vgp-bps2.htm sony vgp-bps2 battery
http://www.toplaptopbatteries.com/dell/latitude-d820.htm dell latitude d820 battery
http://www.toplaptopbatteries.com/sony/vgp-bps2c.htm sony vgp-bps2c battery
http://www.toplaptopbatteries.com/toshiba/pa3399u-1brs.htm toshiba pa3399u-1brs battery
http://www.toplaptopbatteries.com/toshiba/pa3536u.htm toshiba pa3536u battery
http://www.toplaptopbatteries.com/dell/xps-1330.htm dell xps 1330 battery
http://www.toplaptopbatteries.com/dell/xps-m1330.htm dell xps m1330 battery
http://www.toplaptopbatteries.com/dell/inspiron-1300.htm dell inspiron 1300 battery
http://www.toplaptopbatteries.com/dell/inspiron-b130.htm dell inspiron b130 battery
http://www.toplaptopbatteries.com/toshiba/PA3356U-3BAS.htm toshiba PA3356U-3BAS battery
http://www.toplaptopbatteries.com/toshiba/PA3356U-3BRS.htm toshiba PA3356U-3BRS battery
http://www.toplaptopbatteries.com/toshiba/PA3456U-1BRS.htm toshiba PA3456U-1BRS battery
http://www.toplaptopbatteries.com/dell/inspiron-1100-series.htm dell inspiron 1100 series battery ,
http://www.toplaptopbatteries.com/toshiba/pa3384u-1bas.htm toshiba pa3384u-1bas battery
http://www.toplaptopbatteries.com/toshiba/satellite-a60.htm toshiba satellite a60 battery
http://www.toplaptopbatteries.com/toshiba/satellite-a65.htm toshiba satellite a65 battery
http://www.toplaptopbatteries.com/toshiba/satellite-pro-a60.htm toshiba satellite pro a60 battery
http://www.toplaptopbatteries.com/acer/as07b51.htm acer as07b51 battery
http://www.toplaptopbatteries.com/acer/as07b71.htm acer as07b71 battery
http://www.toplaptopbatteries.com/hp/nx6120.htm hp nx6120 battery
http://www.toplaptopbatteries.com/hp/nc6100.htm hp nc6100 battery
26 Oct.
Aucun noma écrit :

Hi,Do you need digital signages, advertising displays, digital sign, advertisement displays and advertising players? Please go Here:www.amberdigital.com.hk(Amberdigital).we have explored and developed the international market with professionalism. We have built a widespread marketing network, and set up a capable management team dedicated to provide beyond-expectation services to our customers.

amberdigital Contact Us

website:www.amberdigital.com.hk
alibaba:amberdigital.en.alibaba.com[gdbbdeebjhjfb]

23 Oct.
Aucun noma écrit :

Hi,Do you need digital signage, digital sign, ad players and ad displays? Please go Here:www.amberdigital.com.hk(Amberdigital).we have explored and developed the international market with professionalism. We have built a widespread marketing network, and set up a capable management team dedicated to provide beyond-expectation services to our customers.

amberdigital Contact Us

website:www.amberdigital.com.hk
alibaba:amberdigital.en.alibaba.com[gjicaechgacahb]

26 Sept.

Rétroliens

L'URL de rétrolien de ce billet est :
http://denzilpinto.spaces.live.com/blog/cns!A2256C53CD2EC18E!193.trak
Blogs Web qui font référence à ce billet
  • Aucune