Here is the components that need to be enabled for UDDI to run properly

Task 3: Install Internet Information Services When installing IIS on Windows Server 2008 R2, you must enable following IIS features:
  • ASP.NET
  • Basic Authentication
  • Windows Authentication
  • IIS 6 Metabase Compatibility

You simply create a batch file with the following command:

start /w pkgmgr /iu:IIS-ASPNET;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-IIS6ManagementCompatibility;IIS-Metabase
 

If you are going to install the WFC adapters for SQL, SAP, and Oracle, there is not a way that the install can be complete during a silent install.

The adapters don’t show up in the management console without having to manually add them.

Until now…

All you need to do is run this AddAdapter.vbs (BizTalk 2010)

AddAdapter "WCF-SQL", "WCF-SQL adapter", "{59b35d03-6a06-4734-a249-ef561254ecf7}"
AddAdapter "WCF-SAP", "WCF-SAP adapter", "{a5f15999-8879-472d-8c62-3b5ea9406504}"
AddAdapter "WCF-OracleDB", "WCF-OracleDB adapter", "{d7127586-e851-412e-8a8a-2428aeddc219}"
AddAdapter "WCF-OracleEBS", "WCF-OracleEBS adapter", "{f452bb15-7a0d-495d-9395-c630d3fd29cd}"

Sub AddAdapter(strAdapterName, strAdapterComment, strAdapterMgmtCLSID)
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objService = objLocator.ConnectServer(".", "root/MicrosoftBizTalkServer")
Set objAdapterClass = objService.Get("MSBTS_AdapterSetting")

On Error Resume Next
Set objAdapterInstance = objService.Get("MSBTS_AdapterSetting.Name='" & strAdapterName & "'")
If (objAdapterInstance is Nothing) Then
On Error Goto 0
Set objAdapterInstance = objAdapterClass.SpawnInstance_
Else
On Error Goto 0
End If

objAdapterInstance.Name = strAdapterName
objAdapterInstance.Comment = strAdapterComment
objAdapterInstance.MgmtCLSID = strAdapterMgmtCLSID

On Error Resume Next
objAdapterInstance.Put_(0)
If (Err.Number <> 0) Then
Else
End If
End Sub

So this is what the batch file looks like:

"\\BizTalk Server 2010 Enterprise\WCF-LOB-Adapter-SDK-2010-x86\AdapterFramework.msi" /quiet MUOPTIN="Yes"
"\\BizTalk Server 2010 Enterprise\WCF-LOB-Adapter-SDK-2010-x64\AdapterFramework64.msi" /quiet MUOPTIN="Yes"
msiexec /i "\\BizTalk Server 2010 Enterprise\BizTalk Server\AdapterPack_x86\AdaptersSetup.msi" /qn ADDLOCAL=ALL
msiexec /i "\\BizTalk Server 2010 Enterprise\BizTalk Server\AdapterPack_x64\AdaptersSetup64.msi" /qn ADDLOCAL=ALL
cscript.exe "\\BizTalk Server 2010 Enterprise\BizTalk Server\AddAdapter.vbs"

And you get something that looks like this:

image

 

Error: 1 (Field level error)
SegmentID: CLM
Position in TS: 22
Data Element ID: CLM02__TotalClaimChargeAmount
Position in Segment: 2
Data Value: 8888.99
6: Invalid character in data element

This can be resolved by changing the party definition to allow leading and trailing spaces and zeros.

image

and

image

 

I deal quite a lot with AS2 and BizTalk.  I sometimes lose track of the different types of files when dealing with the certificates.  I found a nice description of all the file types and a nice little converter online.

Here is the good description:

PEM Format
The PEM format is the most common format that Certificate Authorities issue certificates in. PEM certificates usually have extentions such as .pem, .crt, .cer, and .key. They are Base64 encoded ASCII files and contain “—–BEGIN CERTIFICATE—–” and “—–END CERTIFICATE—–” statements. Server certificates, intermediate certificates, and private keys can all be put into the PEM format.

Apache and other similar servers use PEM format certificates. Several PEM certificates, and even the private key, can be included in one file, one below the other, but most platforms, such as Apache, expect the certificates and private key to be in separate files.

DER Format
The DER format is simply a binary form of a certificate instead of the ASCII PEM format. It sometimes has a file extension of .der but it often has a file extension of .cer so the only way to tell the difference between a DER .cer file and a PEM .cer file is to open it in a text editor and look for the BEGIN/END statements. All types of certificates and private keys can be encoded in DER format. DER is typically used with Java platforms. The SSL Converter can only convert certificates to DER format. If you need to convert a private key to DER, please use the OpenSSL commands on this page.

PKCS#7/P7B Format
The PKCS#7 or P7B format is usually stored in Base64 ASCII format and has a file extention of .p7b or .p7c. P7B certificates contain “—–BEGIN PKCS7—–” and “—–END PKCS7—–” statements. A P7B file only contains certificates and chain certificates, not the private key. Several platforms support P7B files including Microsoft Windows and Java Tomcat.

PKCS#12/PFX Format
The PKCS#12 or PFX format is a binary format for storing the server certificate, any intermediate certificates, and the private key in one encryptable file. PFX files usually have extensions such as .pfx and .p12. PFX files are typically used on Windows machines to import and export certificates and private keys.

When converting a PFX file to PEM format, OpenSSL will put all the certificates and the private key into a single file. You will need to open the file in a text editor and copy each certificate and private key (including the BEGIN/END statments) to its own individual text file and save them as certificate.cer, CACert.cer, and privateKey.key respectively.

OpenSSL Commands to Convert SSL Certificates on Your Machine
It is highly recommended that you convert to and from .pfx files on your own machine using OpenSSL so you can keep the private key there. Use the following OpenSSL commands to convert SSL certificate to different formats on your own machine:

OpenSSL Convert PEM
Convert PEM to DER

openssl x509 -outform der -in certificate.pem -out certificate.der

Convert PEM to P7B

openssl crl2pkcs7 -nocrl -certfile certificate.cer -out certificate.p7b -certfile CACert.cer

Convert PEM to PFX

openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt

OpenSSL Convert DER
Convert DER to PEM

openssl x509 -inform der -in certificate.cer -out certificate.pem

OpenSSL Convert P7B
Convert P7B to PEM

openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer

Convert P7B to PFX

openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer

openssl pkcs12 -export -in certificate.cer -inkey privateKey.key -out certificate.pfx -certfile CACert.cer

OpenSSL Convert PFX
Convert PFX to PEM

openssl pkcs12 -in certificate.pfx -out certificate.cer –nodes

Here is their little certificate converter:

https://www.sslshopper.com/ssl-converter.html

 

I had a requirement to consume .PDFs and attach all of them that arrived within 30 minutes to an email with the PDFs as attachments.  I created a multi part message that I named msg_Email of type System.Xml.XmlDocument.  I created the message using a Construct Message shape.  I then loaded the body of the message using the .LoadXML() method.  I then used a helper class named EmailAttacher to attach the new messages needing to be attachments to the existing multi part email message.  Here is the helper class code.

namespace EmailAttacher
{
    public class MessageHelper
    {
        public static void AddAttachment(XLANGMessage destination, XLANGMessage attachment, string filename)
        {
            try
            {
                int count = destination.Count;
                destination.AddPart(attachment[0], string.Format(“Attachment_{0}”, count));
                destination[count].SetPartProperty(typeof(MIME.FileName), filename);
            }
            finally
            {
                //decrement reference count
                destination.Dispose();
                attachment.Dispose();
            }
        }

}

The message assignment shape has the following code to add the newest message to the existing message.

EmailAttacher.MessageHelper.AddAttachment(msg_Email, msg_ToAddAsAttachment,”NameOfAttachedFile”);

Don’t forget to add this, to ensure all message parts that aren’t the body are attachments.

msg_Email(SMTP.MessagePartsAttachments) = 2;

 

Every once in a while I need a little C# method to do some dirty work.  Here is an example of how to use Regular Expressions to match Windows style filemask matching.

private bool FitsMask(string fileName, string fileMask)
{
    string pattern =
         ‘^’ +
         System.Text.RegularExpressions.Regex.Escape(fileMask.Replace(“.”, “__DOT__”)
                         .Replace(“*”, “__STAR__”)
                         .Replace(“?”, “__QM__”))
             .Replace(“__DOT__”, “[.]“)
             .Replace(“__STAR__”, “.*”)
             .Replace(“__QM__”, “.”)
         + ‘$’;
    return new System.Text.RegularExpressions.Regex(pattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase).IsMatch(fileName);
}

Here is the pure C# method of doing the same thing.

/// <summary>
/// Filemask can be “*|[*]filenamepart[*].*|[*]extpart[*]”
/// </summary>
/// <param name=”fileName” ></param>
/// <param name=”fileMask” ></param>
/// <returns>Boolean</returns>
/// <remarks>
/// Handles positional start and/or ending wildcards.
/// </remarks>
private bool FileMatchesMask(string fileName, string fileMask)
{
   const string asterisk = “*”;
   string se = string.Empty;
   if (fileMask.Equals(“*.*”))
      return true;

   // first, get comparable filenames and extensions
   string fn = Path.GetFileNameWithoutExtension(fileName).ToLower();
   string ext = Path.GetExtension(fileName).Replace(“.”, se).ToLower();

   string maskName = Path.GetFileNameWithoutExtension(fileMask).ToLower();
   string maskExt = Path.GetExtension(fileMask).ToLower().Replace(“.”, se);
   string maskExtStripped = maskExt.ToLower().Replace(asterisk, se);
   string maskNameStripped = maskName.ToLower().Replace(asterisk, se);
   wcPos fnWCP = GetWildCardPosition(maskName);
   wcPos extWCP = GetWildCardPosition(maskExt);

   if (maskExt.Equals(asterisk))
   {
     // ext can be anything, but fn may be masked
     if (maskName.IndexOf(asterisk) > -1)
     {
      // fn masked, ck position of wildcard
      switch (fnWCP)
      {
          case wcPos.wrap:
          return IsValueMatch(fn, maskNameStripped, wcPos.wrap);
          case wcPos.start:
          return IsValueMatch(fn, maskNameStripped, wcPos.start);
          case wcPos.@end:
          return IsValueMatch(fn, maskNameStripped, wcPos.@end);
          default:
          return IsValueMatch(fn, maskNameStripped, wcPos.wrap);
      }
     }
     else
     {
      // need exact match on filename, any ext is ok
      if (maskName.Equals(fn))
          return true;
     }
   }
   else if (maskName.Equals(asterisk))
   {
     // fn can be anything, but ext may be masked
     if (maskExt.IndexOf(asterisk) > -1)
     {
      // ext masked, ck position of wildcard
      switch (extWCP)
      {
          case wcPos.wrap:
          return IsValueMatch(ext, maskExtStripped, wcPos.wrap);
          case wcPos.start:
          return IsValueMatch(ext, maskExtStripped, wcPos.start);
          case wcPos.@end:
          return IsValueMatch(ext, maskExtStripped, wcPos.@end);
          default:
          return IsValueMatch(ext, maskExtStripped, wcPos.wrap);
      }
     }
     else
     {
      // need exact match on ext, any filename is ok
      if (maskExt.Equals(ext))
          return true;
     }
   }
   else
   {
     // here neither fn or ext = asterisk so must ck for
          // existence of asterisk in either
     // b/c of position of * this will get hairy…
     if (extWCP != wcPos.none)
     {
      // ext is masked, ck for masking in fn
      if (maskName.IndexOf(asterisk) > -1)
      {
          // ext and fn are masked
          return IsValueMatch(fn, maskNameStripped, fnWCP) &
                         IsValueMatch(ext, maskExtStripped, extWCP);
      }
      else
      {
          // fn not masked, look for fn exact match and
                  // ext masked
          if (fn.Equals(maskName) &&
                     IsValueMatch(ext, maskExtStripped, extWCP))
            return true;
      }
     }
     else
     {
      // ext is not masked, requires exact ext
               // and ck for fn masking
      if (maskName.IndexOf(asterisk) > -1)
      {
          // fn masked
          if (IsValueMatch(fn, maskNameStripped, fnWCP) &&
                     ext.Equals(maskExtStripped))
            return true;
          else if (fn.Equals(maskName) &&
                           ext.Equals(maskExtStripped))
            return true;
      }
     }
   }
   return false;
}

 

When trying to build a BizTalk project I got this error.  Here is the solution:

1) Checking out a single XSD file does not result in the corresponding CS file being created

2) Excluding the XSD file from the project then re-including it does result in the CS file being created

3) Checking out just the BTPROJ file and the XSD file (expecting this perhaps to be similar to the exclude / re-include) does not result in the corresponding CS file being created

As detailed above, checking out every file in the solution prior to build addresses the problem.

 

A funny sight I saw today:

BTSOnMac

 

I think they would be proud!

BillNSteve

 

I had an XSLT style sheet that used a C# method to return a multi line string.  I wanted it to include the HTML <BR></BR> tag ad specific places within the string but not as literals.  After some searching around I found that instead of trying to get the <BR></BR> tag to not be literal, I could simply use the <pre></pre> tag within my HTML and it would force it to recognize the “/r/n” returned from the C# method.

 

I needed to find the total purchase order amount given the quantity and line item price on an X12 850 using XSLT and .NET to transform XML into HTML.

In my case:

PO102 = Quantity

PO104 = Price

Add the following to the stylesheet declaration:

xmlns:msxsl=”urn:schemas-microsoft-com:xslt”

for example:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://schemas.microsoft.com/BizTalk/EDI/X12/2006" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var userCSharp" xmlns:userCSharp="http://schemas.microsoft.com/BizTalk/2003/userCSharp>">

In your XSLT use the following code, modifying the referenced node and element within your XML

<xsl:variable name="tmpTotal"> <total_amount> <xsl:for-each select="ns0:PO1Loop1"> <item> <xsl:value-of select="ns0:PO1/PO102 * ns0:PO1/PO104"/> </item> </xsl:for-each> </total_amount> </xsl:variable> <total> <!--<xsl:variable name="myTotal" select="msxsl:node-set($tmpTotal)"/>--> <xsl:variable name="myTotal" select="$tmpTotal"/> <xsl:value-of select="sum(msxsl:node-set($myTotal)/total_amount/item)" /> </total>

© 2015 BizTalk Blog Suffusion theme by Sayontan Sinha