Skip to main content

Posts

Showing posts from 2013

CSS - To fix Gridview Header Position

Following CSS can be used to fix the header position in gridview .fixedHeader {   font-weight:bold;   background-color: #006699;   position:relative ;   height: 25px;   top:expression(Sys.UI.DomElement.getBounds(document.getElementById("MainContent_dvGrid")).y-270);   z-index: 10; } MainContent_dvGrid  - is  div which contain the GridView. y- 270 => 270 value can be adjusted as per your requirement and alignment of Grid & Div. Use this CSS in HeaderStyle of your Grid,  <HeaderStyle CssClass=" fixedHeader " ForeColor="White" Height="10px" />                          

Microsoft.ServiceModel.Channels.Common.ConnectionException: Due to an Oracle Client limitation, the adapter failed to open a connection.

BizTalk Custom WCF Adapter Error : Microsoft.ServiceModel.Channels.Common.ConnectionException: Due to an Oracle Client limitation, the adapter failed to open a connection. This is because either (a) ambient transaction is present and the TNS alias is longer than 39 characters, or (b) ambient transaction is present and a non-TNS based URI was used. To resolve this, use a TNS alias to connect to Oracle and make sure it is not more than 39 characters. Solution : In the Send Port configuration adapter I used a WCF-Custom transport type and used oracleDBbinding as binding type. In the oracleDBbinding I changed the following propertys: "enableBizTalkCompatibilityMode" = True (For some reasons this i set to false per default) "useAmbientTransaction" = False Jumped to the Message tab and uncheck the "Use Transaction" box under Transactions.

BizTalk : Runtime assembly loading issue , Could not load file or assembly

BizTalk : Runtime assembly loading issue , Could not load file or assembly If you require a specific version of  assembly to be loaded at runtime when your BizTalk application run. This requirement could be implemented by adding a required assembly setting in BTSNTSvc.exe.config . In biztalk config file you need to specify the old and new version of assembly that need to be loaded at runtime. Following setting could be added in your BTSNTSvc.exe.config file with proper assembly details. Using this Binding Policy in config, we can load the any required assembly at runtime.. <runtime>                                 <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">                                                 <dependentAssembly>                 <assemblyIdentity name="BTSales.DataAccess" publicKeyToken="89b653f429c47342" culture="neutral" />       

BizTalk error : Attempted to access an unloaded AppDomain.

BizTalk error :  Reason: Attempted to access an unloaded AppDomain. While accessing WCf service in one of my BizTalk application, I received the following error. There was a failure executing the receive pipeline: "Unknown " Source: "Unknown " Receive Port: TwoWayLatencyService_RcvPort" URI: "/.svc" Reason: Attempted to access an unloaded AppDomain. Cause : This happens when there are several Web Services with the same Application Pool, and the first is inactive for a long period of time, all the others are inactive. Solution : after restarting the IIS server it worked.

WCF ERROR - An unsecured or incorrectly secured fault was received from the other party

Error  :  “ An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail ”.  We  got above security while accessing the WCF service deployed on our Development server Cause  : This type of error we normally receive because of a server time skew. The remote server and the client's system time must be within (typically) 5 minutes of each other. If they are not, security validation will fail and WCF service will throw security error. The Development serve and client time difference was 10mins and Hence the service was throwing an error related to security. Solution : We just   have updated the server time same as client machine and then it started working. Message security mechanism in WCF supports WS-SecurityConversation standard, which consists of establishing a session between client and server. A special request should be sent for a session to be established before any other calls

Preserve whitespace in BizTalk Transform

Preserving Whitespaces in BizTalk Transformation Following property need to be set             r_setting.IgnoreWhitespace = false; Full Sample code           XsltSettings set = new XsltSettings(true, true);         XmlReader reader;         XmlWriter writer;         string xmlPath_out = "D:/" + "testWhiteSpace.xml";         //StreamWriter writer = File.CreateText(xmlPath_out);         try         {             string xml_p = "testWhite_P.xml";             string xslt_p = "xsltWhiteSpace.xsl";             string xmlPath = Server.MapPath(xml_p);             string xslPath = Server.MapPath(xslt_p);             //Instantiate the XslTransform Class             XslCompiledTransform transform = new XslCompiledTransform();             XmlResolver secureResolver = new XmlSecureResolver(new XmlUrlResolver(), xmlPath);             XmlReaderSettings r_setting = new XmlReaderSettings();             transform.L

BizTalk SendPort file name support/macro

BizTalk Send Port with File Adapter supports the following formats (macros) for the file saved. %MessageID% %datetime% %SourceFileName% %time%

Difference between publishing schema and publishing an orchestration as a WCF Service

Difference between publishing schema and publishing an orchestration as a WCF Service Publishing Schema as Endpoint Publishing Orchestration as Endpoint Orchestration Completing not require - publishing Schema as service will enable your subscribers get your Data Contracts and they can begin their development. Your subscribers don’t have to wait till you complete your business logic. Orchestration should be completed - Publishing an orchestration requires you to get ready with the Orchestration development at first place or let your subscribers wait till you finish your orchestration development. Orchestration will be loosely coupled- you are free to update/add new orchestration subscribing to specified message contract Orchestration will be tightly coupled – After updating/changing orchestration need republish the Endpoint. During publishing wizard, we need to select the schema and need to specify the request/response message. During Publishing wizard, we don’

BizTalk : Custom XSLT to reomve empty node from XML request

Using XSLT to Remove Empty Node from request. ·          To implement this, we simply create one additional step in process/orchestration. ·          Add new map with Source schema same as destination schema. ·          Use the following custom XSLT code to scan the request and remove all empty node. Map with same schema as request and response. Use the following xslt file with your schema namespace. <? xml version ="1.0" ?> < xsl:stylesheet xmlns : xsl ="-- YOUR NAMESPACE --" version ="1.0" xmlns : ns0 ="http://www.w3.org/2001/XMLSchema-instance">     < xsl:output method ="xml" indent ="yes" />     < xsl:template match ="node()">         < xsl:if test ="count(descendant::text()[string-length(normalize-space(.))>0]|@*)">             < xsl:copy >                 < xsl:apply-templates select ="@*|node()"

Get the RegisteryKey value

Following sample code can be used to get RegisteryKey value based on keyPath and KeyName public static String GetRegistryValue( String regKeyPath, String regKeyName) { // Create value variable string regValue = null ; try { // Opening the registry key RegistryKey rk = Registry .LocalMachine; // Open a subKey as read-only RegistryKey regKey = rk.OpenSubKey(regKeyPath, RegistryKeyPermissionCheck .ReadSubTree, System.Security.AccessControl. RegistryRights .FullControl); // If the RegistrySubKey does exist if (regKey != null ) { // If the RegistryKey exists get its value or null is returned. regValue = ( string )regKey.GetValue(regKeyName.ToUpper()); } return regValue; } catch ( Exception ex) { throw ex; } }

Read PublicKey from Assembly using sn.exe

To get PublicKey for assembly we need to use sn.exe SKD provided by microsoft. Run a Visual Studio 2008/10 command prompt (Visual Studio Tool + Visual Studio 2008/10 Command Prompt from the “Start” menu). Enter the following command: sn -Tp "C:/myassembly.dll" Where “ myassembly .dll” is the name of the signed assembly. sn -Tp (assembly full path)

Regular Expression to remove non-printable character

Following simple regular expression can be used to reomve non-printable charcter from your string or data. Code Sample : string str = "342343\r\n24232234234234234" ;   Regex digitsOnly = new Regex ( @"[\x00-\x1F]" ); str= digitsOnly.Replace(str, "" ); ASCII code table