Thursday, February 19, 2015

IsGeneratedAck="true" in X12 999(X12_5010_999).  


This property appeared in my 999 XML from the EDISend port IsGeneratedAck="true"

I had a SOAP message that contained a EDI 270.  In the orchestration when I sent it out I got a 999 that I needed to put back in the SOAP message to return to sender.  This property appeared on the XML root node.


<ns0:X12_999_Root IsGeneratedAck="true">
<ns0:ST>
 <ST01>999</ST01>
 <ST02>0065</ST02>
 <ST03>005010X231A1</ST03>
 </ns0:ST>
<AK1>
 
<>

Hey some days you gotta cheat.  I converted the 999 XML to a string and removed the property that was giving us grief.


String2 = MQXMLRec.OuterXml;
String2 = String2.Replace("IsGeneratedAck=\"true\"","");

MQXMLRec3 = new System.Xml.XmlDocument();

MQXMLRec3.LoadXml(String2);

the IsGeneratedAck="true" Was not in any schema I could find.

This solved the problem and the XML loaded to X12_5010_999 without an issue.

Good Coding
Kent

Tuesday, December 30, 2014

BizTalk Pipeline Components with code projects 

Examples

Rename files

Archive Files

Zip files


To download use the link below each project.
Code my be less than pretty

Recently I have been writing some BizTalk pipeline components.  One I modified some other person's code.  I will try to make them Zipped files that you can download.

1.  KNTrename - This component will rename files.  It works on send and receive locations.  It has a filter to rename files that match the filter.  The filter can be ignored.  The project has a lot of macros and you can add your own.  KNT stands for "Kent Named This".

https://sites.google.com/site/biztalkcsharpandsql/KNT.BizTalk.Pipelines.Components.Rename.zip?attredirects=0&d=1

2. SAB - This is the archiving software from codeplex, I did not write it.  However I fixed the dates to include the zero in from the month and day "01" instead of  "1".

https://sites.google.com/site/biztalkcsharpandsql/SAB1.zip?attredirects=0&d=1

3. Stm.ZipEncoder - this will ZIP large files - I rewrote this component to use ZipArchive in .NetFramework 4.5.  It must be compiled in Visual Studio 2013, I did not try it in 2012, I know it does not work in VS 2010 because you cannot use 4.5 in 2010.  On this one be sure to add the reference to WindowsBase located at "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\WindowsBase.dll"

https://sites.google.com/site/biztalkcsharpandsql/Stm.ZipEncoder.zip?attredirects=0&d=1

 Documentation:

https://sites.google.com/site/biztalkcsharpandsql/KNTrenamePipelineDocumentation.docx?attredirects=0&d=1
 
 https://sites.google.com/site/biztalkcsharpandsql/StmZipEncoder.docx?attredirects=0&d=1

I hope someone finds this useful.  Let me know at val1329@gmail.com

Thursday, January 30, 2014

Shareing BizTalk Applications artifacts.  Especially pipeline.  When I go to redeploy I get the following error.

   

The DELETE statement conflicted with the REFERENCE constraint
"adm_ReceiveLocation_fk_Pipeline". The conflict occurred in database
"BizTalkMgmtDb", table "dbo.adm_ReceiveLocation", column
'ReceivePipelineId'.
The statement has been terminated."

To fix this you can delete and the associated BizTalk applications.  Load the MSI and then reload the other applications.   I will copy the needed artifacts , in the other application and give them a different name.















Friday, December 14, 2012

C# expand(Resize) array for a class

Imagine you had one class connected after another.  This one happens to be the EDI 271...

Difficult to read, however lets continue:


<>
  XmlSerializer SerializerObj = new XmlSerializer(typeof(X12_00501_271));
            XmlNodeReader reader = new XmlNodeReader(this.Utilities.ReturnDocument);
            object obj = SerializerObj.Deserialize(reader);
            X12_00501_271 Cmyobj = (X12_00501_271)obj;
                     
            int lenTS271_2000A_Loop = Cmyobj.TS271_2000A_Loop.Length;
            for (int i = 0; i < lenTS271_2000A_Loop; i++)
            {
                int lenTS271_2000B_Loop = Cmyobj.TS271_2000A_Loop[i].TS271_2000B_Loop.Length;
                for (int j = 0; j < lenTS271_2000B_Loop; j++)
                {
                    int lenTS271_2000C_Loop = Cmyobj.TS271_2000A_Loop[i].TS271_2000B_Loop[j].TS271_2000C_Loop.Length;
                    for (int k = 0; k < lenTS271_2000C_Loop; k++)
                    {
                        int lenTS271_2110C_Loop = Cmyobj.TS271_2000A_Loop[i].TS271_2000B_Loop[j].TS271_2000C_Loop[k].TS271_2100C_Loop.TS271_2110C_Loop.Length;
                        // start
1)                        TS271_2110C_Loop[] TS271_2110C_Loop = Cmyobj.TS271_2000A_Loop[i].TS271_2000B_Loop[j].TS271_2000C_Loop[k].TS271_2100C_Loop.TS271_2110C_Loop;
 2)                       Array.Resize(ref TS271_2110C_Loop, TS271_2110C_Loop.Length + 1);
                        TS271_2110C_Loop[TS271_2110C_Loop.Length - 1] = new TS271_2110C_Loop();

                        3) Cmyobj.TS271_2000A_Loop[i].TS271_2000B_Loop[j].TS271_2000C_Loop[k].TS271_2100C_Loop.TS271_2110C_Loop = TS271_2110C_Loop;

    

<>

1.  Instantiate new copy of the class TS271_2110C_Loop.
2.  Use the resize command to expand the table. 
3.  Load the class  TS271_2110C_Loop back into the original oject:

 Cmyobj.TS271_2000A_Loop[i].TS271_2000B_Loop[j].TS271_2000C_Loop[k].TS271_2100C_Loop.TS271_2110C_Loop = TS271_2110C_Loop;

 

Tuesday, January 10, 2012

BizTalk 2010 Batch Configuration process in Agreement

Using Batching in agreement in BizTalk 2010. The batch logic seem clear enough.

1. The receive location and Receive port cannot have a orchestration in the middle. I could not get it to work.
2. I droped the debatched files to a folder.
3. The receive location read the folder with using the EdIReceive pipeline.
4. Nothing special about the Receive Port.
5. The Batch Configuration" tab was configured in the agreement, on the batch configuration tab. Give it a batch name, you can filter your send port with the batch name. select Start immediatly. To a proof of concept I selected maximium number of transactions. Interchange and 2.
6. On the filter I used:
BTS.ReceivePortName == BatchTest
This is the name of the receive port.
7. Pressing the "Start" button(about 5 lines down on the Batch configuration tab) lanches a orchestration that does the work. You can see the orchestration on the group hub.
8. Create a send port.
9. Do not put the send port in the send port tab of the agreement.
10 The send port will have a filter.

You could put many things in the filter but you need:

EDI.ToBeBatched == False

other filter items to restrict criteria as needed.

Three tricks here:
1. Use a receive and send port with nothing in the middle.
2. Do not put your send port name in the send port tabs of your agreement.
3. Use the EDI.ToBeBatched == False as one of the send port filters to transport your batched file.

Problems:

1. If the orchestration is not running and you drop files, it errors nicely in the group hub.
2. The batch process may pick up multiple EDI types like your 997 or 999 if you are not careful.

Good luck.

Friday, August 12, 2011

Biztalk and SSO reinstall

When you delete the SSO data base it will be removed from the SQL manager. But real data files (MDF I think) are still there. Go delete thos files and you SSO reinstall might work.


Good luck
Kent Seattle

C# dll in orchestration and corrupt data


BizTalk 2010 EDI
When you drop one transaction it looks good when you drop many the data is corrupt.
If you use c# and static variables or methods. It works fine with one transaction, but when you post many transactions the static variables occur once. The data is not isolated and you en up with a mess.

You need to write the DLL with one class and do not use static variables or Methods.

Been a while since I posted