Pages

Showing posts with label Issues. Show all posts
Showing posts with label Issues. Show all posts

Biz Talk Q&A : Register Correct version of ASP.NET in IIS

Friday, April 25, 2014
Q:
Getting the below error while browsing the website running on ASP.NET 4 application pool.
Server Error in '/myVDir' Application. 
-------------------------------------------------------------------------------- Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.TypeLoadException: Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
  1. Re-register the .NET 4 framework of ASP.NET with IIS
  1. Force this module to be loaded only inside a 2.0 application pool by changing the configuration manually
  1. Remove this 2.0 version Module from the list of modules if you are planning to run only ASP.NET 4 application pools.

You will run into this problem only if you install the .NET 3.5.1 WCF HTTP Activation feature after the installation of .NET 4 framework on your server.
Cause
Installation of .NET 3.5.1 WCF HTTP activation feature adds a global module for the 3.0 framework’s 'System.ServiceModel’ assembly for the type 'System.ServiceModel.Activation.HttpModule'. Since the application pool’s runtime version is v4.0, this assembly is tried to be loaded from the .NET 4 assemblies folder. Since, the definition of the 'System.ServiceModel.Activation.HttpModule’ is now moved to the “System.ServiceModel.Activation” assembly, it fails.
This problem doesn’t occur if you run your application pool under classic mode. You can resolve the problem by following any of the following:
Answer #1
To re-register the ASP.NET 4 assemblies with IIS, open a command prompt (as an admin), and navigate to the .NET 4 framework folder (%windir%\Microsoft.NET\Framework\v4.0.30319). Type aspnet_regiis -iru, and press enter. This command will re-register the ASP.NET 4 framework with IIS which will modify the ‘ServiceModel’ configuration to be loaded only inside a .NET 2.0 application pools. For some reason, you choose not to re-register the ASP.NET 4 version assemblies with IIS, you can follow the resolution #2 explained below, which will do the same configuration change, but manually.
Answer #2
The worker process tries to load the assembly since it passes the pre-condition. Its pre-condition is just “managedHandler” which doesn’t specify the runtimeVersion information. By default it is loaded inside the application pools running with any version of .NET framework.
To resolve the problem, change the configuration of the module to be loaded only if the runtime version is 2.0, so that it doesn't interfere with .NET framework 4 application pool:
<add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler,runtimeVersionv2.0" />
AppCmd syntax:
appcmd.exe set config -section:system.webServer/modules /[name='ServiceModel'].preCondition:"managedHandler,runtimeVersionv2.0" /commit:apphost
Answer #3
Alternatively, you can uninstall the .NET 3.5.1 WCF HTTP activation if you are not planning to use this feature. This would simply remove the module ‘ServiceModel’ from the list of modules. Remember, this is going to affect all the application pools, so if you have any application pool which might use this module, then do not proceed with the uninstallation. Alternatively, you can remove it from the global modules list, and add it specifically to the application needing it.
You can also simply remove the module from the modules list. Below is the appcmd to remove the module from the global list.
AppCmd to remove the module:
appcmd.exe set config -section:system.webServer/modules /-"[name='ServiceModel']" /commit:apphost
Below is the AppCmd to add the module to the application needing it.
appcmd.exe set config "Default Web Site" -section:system.webServer/modules /+"[name='ServiceModel',type='System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089',preCondition='managedHandler,runtimeVersionv2.0']"
Read more ...

BizTalk Host Inflight Message Throttling Resource Based Throttling Settings

Friday, September 9, 2011
Q:

Hi there,
I am stress testing our future production environment based on BizTalk Server 2010, and I am getting this error BizTalk host throttled because InflightMessageCount exceeded the configured throttling limit
Does any one know about what parameter affects the inflightMessageCount, or at least what does this parameter mean?
Regards,

Sol:
See the description of Inflight message here
Specify the reaction time of throttling when the value for In-process messages exceeds the threshold. This is specified in percentage value and this parameter sets the severity of a throttling condition caused when the value for In-process messages threshold is exceeded.

Read more ...

AS2 Party Biztalk Encryption on Dynamic Ports using Certificates

Tuesday, September 6, 2011

Q:
Please consider this scenario:
Local (BT)Remote As2 Server (mendelson)
FromTo
Party_AParty_B
  1. Many AS2 relationships.
  2. same account for all of the hosts.
  3. Certificates on this account:
  • Current User\Personal and Trusted root certificates
  • keypair_A
  • Local computer \Other People and Trusted root certificates
  • public_key_B

No certificates have been configured to override the group, nor at the port level (dynamic port). No host has an encryption certificate attached to it.

Test 1: Send a Message from party_B  to Party_A (encrypted and signed). No certificate set for the BizTalk group.
Error: "The Signing Certificate has not been configured for AS2 party.  AS2-From: B AS2-To: A "

Test 2: Same as Test 1, but configuring a certificate for the BizTalk group.
Success. 
But this is a problem, because I need to used other signatures for other relationships! (Say Party_C/Party_D)

Test 3: Send a Message from party_A  to Party_B. Certificate set for the BizTalk group.
Error: "The Encryption Certificate has not been configured for AS2 party.  AS2-From: A AS2-To: B "

Test 4: Same as Test 3, but configuring the public certificate for the Party_B party (not for the profile/signature)
Error: "The Encryption Certificate has not been configured for AS2 party.  AS2-From: A AS2-To: B"
So it doesn't make a difference to setup the certificate at the party level.

Test 5: Same as Test 4, except that the certificate thumbprint was configured at the send port level.
Success
But this shows a high limitation in BizTalk, since a port should be reused by many relationships/parties. I am using a dynamic port, why would I attach an encryption certificate to it while it makes more sense to attach the certificate to the party/relationship? Since the only way to specify the encryption certificate is at the port level, then I would be forced to give up using a dynamic port and instead I'd have to use as many static ports as as2 relationships are in my system. And there can be a lot. This is a maintenance burden.
Up to here this could be enough if I didn’t need to configure other AS2 relationships, and some of them require us to use different signatures. Basically we need to give each partner a brand new signature and ecryption certificate (key pair) that represents us, while we receive their public .cer file.
I also wanted to test the signing certificate override feature:
Test 6: Same as Test 1. Send a Message from party_B  to Party_A (encrypted and signed). No certificate set for the BizTalk group, but instead configured in the party`s profile AS2 settings
Error: "The Signing Certificate has not been configured for AS2 party.  AS2-From: B AS2-To: A "
This means that the overriding did not occur!. OK then, now lets configure a different signature certificate at the biztalk group, perhaps that will make BT happy and let the overriding occur:
Test 7: Same as Test 6. but configuring a different signature, expecting BT to take the one at the As2 properties level of the party (the correct one)
Error: Success on BizTalk side but the AS2 mendelson server complains about the MDN having a signature error, meaning: Verification of digital signature failed (Verification failed)
This means that BizTalk refuses to use the certificate that I want to use (the one at the As2 porperties level) but instead keeps using the one defined at the group level.

So to summarize I am having two issues:
Biztalk forces to use encryption  certificate on the port level, which defeats the purpose of providing the good functionality of dynamic ports. Can encryption certificates be configured dynamically for dynamic ports? (other than programmatically  setting BTS.EncryptionCert which doesnt work)
As for the signatures, I am not able to have Biztalk use signature per party/relationship and keeps using the one defined at the group level. If no certificate defined at the group level then it doesnt matter other configurations, there'd be an error. If the certificate is set, then it can use only that one certificate for signature, regardless of overriding settings.
Any ideas are much appreciated,

Thanks!


Sol:

For the issue of dynamic ports and certificates I got the following from Microsoft:
"Dynamic send ports in BizTalk allow one to specify the destination URL at runtime rather than at design time. Everything else needs to be configured statically. When it comes to picking the appropriate certificate at runtime, dynamic ports can’t help. As for your scenario, we do understand that it is important to minimize the overhead in terms of number of pipelines/ports to be managed. Ideally the dynamic ports  should have been somewhat  flexible in terms of which settings do they allow to be provided dynamically at runtime (currently it is possible for only send URL and everything else must be configured statically). However, there is no such functionality that BizTalk provides as of now. I would suggest you to raise this as a new feature request which will have to go through the SE route (mostly as a DCR – design change request). "
Alright, I went back to the static approach.
Still pending the second issue (BizTalk forces using one single signature certificate for all outbound transmissions, regardless of overriding settings).


For the signatures-per-party issue, it is finally working.

If BT has two parties configured (A=Local, B=Remote), and an agreement( A->B, B->A) the problem was that the signature certificate was being configured on the A->B one way agreement.

When B sent an As2 to A, it was expecting an MDN signed by A, so the tab A->B was the obvious place to set the certificate the A uses to sign. Also, according to http://msdn.microsoft.com/en-us/library/ff629741(BTS.70).aspx, "

Select the Override group signing certificate check box to use the certificate provided in this page for signing outgoing AS2 messages and MDN.

", meaning, the certificate is for outgoing messages from A to B. When set on the oposite tab (B->A) it started working fine.
Ended up using the same signing certificate on both tabs of the agreement. Note that in a multiserver environment changes are not taken immediately. Need to restart the entire server for changes to really be there.



 

Read more ...

Generating Serialized Classes From Xsd.exe with XSD Schema Imports

Thursday, September 1, 2011
Q:

Hi  Guys I'm Facing problem generating Serialized classes from schema which has multiple imports in my canonical schema

It worked previously when i generated for a individual schema without any imports ?.
can you help me on this Im getting Error : Error Generating Classes for xxx.schema

Sol:

Hi there,

You need to add the Import Schema's along with  the Schema for which you are generating Serialized Classes You need to Add the import Schemas/Referenced Schemas Also while generating the serialized Classes


Below is an example:
Generating Serialized Classes Using XSD.EXE
C:\Program Files (x86)\Microsoft Visual Studio 8\VC>
xsd  C:\AOP\ISIS\Common\Schemas\ISIS.Common.Schemas.AdditionalInfo\AdditionalInfo.xsd C:\AOP\ISIS\Common\Schemas\ISIS.Common.Schemas.MessageHeader\MessageHeader.xsd C:\AOP\ISIS\Common\Schemas\ISIS.Common.Schemas.TransactionResult\TransactionResult.xsd C:\AOP\CIS\Common\Schemas\CIS.Common.Schemas.ActivateParkedDevice\ActivateParkedDeviceResponse.xs
d /l:cs /n:CIS.Common.Schemas.ActivateParkedDevice.Helper /outputdir:C:\AOP\CIS\
Common\Schemas\CIS.Common.Schemas.ActivateParkedDevice.Helper /c
 
After Execute : Result:

Microsoft (R) Xml Schemas/DataTypes support utility[Microsoft (R) .NET Framework, Version 2.0.50727.42]
Copyright (C) Microsoft Corporation. All rights reserved.Writing file 'C:\AOP\CIS\Common\Schemas\CIS.Common.Schemas.ActivateParkedDevice.
Helper\ActivateParkedDeviceResponse.cs'.


Here
i was generating the generating the Serialized class for Activate Parked device response Schema which had XSD imports for Additional Info Schema and Transaction result Schema
 you need to add the reference as specified as Reference Schema's , Actual Schema , Generating Parameters.

Note: Sometimes if you are generating Multiple Schema's with the same imports under the same namespace  you will need to generate the Serialized classes the same way for both but the Generated Serialized Class may not be valid as there will be duplicate methods with in the same namespace
"You Need to remove the Redundant Classes Generated with same Name  or Generate Schema's under different Namespaces"
Read more ...

XSLT Custom Scripting Functoid - Dictionary Approach Repeating Record

Thursday, August 18, 2011
Q:

I have a Repeating record Where it contains id and description i need to select  based on  the value of description and pass on value of id and description both of them
sample xml :
<applicablerecords>
  <id>10</id>
  <description>3months</description>
  <id>12</id>
  <description>6months</description>
   <id>20</id>
  <description>24months</description>
   <id>35</id>
  <description>18months</description>
   <id>45</id>
  <description>24months</description>
</applicablerecords>

SOl:

Use the following Custom Xslt on a scripting functoid or you can also use c# script to createa dictionry and copy all the elements in to it and then search into it


xslt approach:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
         <xsl:for-each select="applicablerecords[description='24months']">
             <xsl:if test= "position()=1">
               <xsl:value-of select="id"/></td>
               <xsl:value-of select="description"/></td>
             <xsl:if>
           </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>





c# Approach:



public static string  populatevalues(string param1, string param2)
{
        system.collections.dictionary mydictionary = new system.collections.dictionary<String,string>;
        mydictionary.add(param1,param2);
}

use cumulative functoid to accumulate values thru records then

public static string  populatevalues(string param1, string param2)
{

        system.collections.dictionary mydictionary = new system.collections.dictionary<String,string>;
        if(mydictionary.containsvalue(param2))
               return mydictionary.id || mydictionary.description


}

Read more ...

POP 3 mail Get Recieve Date Time Stamp in BizTalk

Wednesday, August 17, 2011
Q:

HI
i Have a mail box from where i am receiving the mails using POP3. If the mail reached at 9 AM and biztalk is received at 10 AM . I need the mail box received date time that is 9 AM in biztalk to use in other logic.
Can you please help how to get the mail box mail received date time.
Ans:
  Try the Date field promoted by the POP3 adapter.

POP3 Adapter Property Schema and Properties

The following table lists the properties in the POP3 adapter property schema.
Namespace: http://schemas.microsoft.com/BizTalk/2003/pop3-properties
NameTypeDescription
Subject
xs:string
Specifies the content placed on the Subject header for the message
From
xs:string
Specifies the e-mail address placed on the From header field of the e-mail message.
To
xs:string
Specifies the e-mail address or addresses placed on the To header field of the e-mail message.
ReplyTo
xs:string
Specifies the e-mail address placed on the ReplyTo header field of the e-mail message.
CC
xs:string
Specifies the e-mail address or addresses placed on the CC header field of the e-mail message.
Date
xs:string
Specifies the content placed on the Date header field of the e-mail message.
DispositionNotificationTo
xs:string
Specifies the content placed on the DispositionNotificationTo header field of the e-mail message.
Headers
xs:string
Specifies the content of all of the header fields of the e-mail message.

Read more ...