Wednesday, December 11, 2013

Dynamic Script to GAC

Project Name: XXX.CU.Portal.BizTalk.XXYY.Schemas.AAA


"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\GacUtil.exe" -i "$(TargetPath)"
xcopy "$(TargetPath)" "C:\Projects\runtime\XXX.YY.Portal.BizTalk.XXYY.Schemas.AAA\Bin\" /d /y

Monday, October 21, 2013

WCF Multiple endpoint configuration

<?xml version="1.0"?>
<configuration>

<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<protocolMapping>
<add scheme="net.tcp" binding="netTcpbinding"/>
</protocolMapping>
<bindings>
<wsHttpBinding>
<binding name="wsHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
<netNamedPipeBinding>
<binding name="netNamedPipeBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None"></security>
</binding>
</netNamedPipeBinding>
<netTcpBinding>
<binding name="netTcpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security mode="None"></security>
</binding>
</netTcpBinding>
</bindings>
<services>

<service name="MVKWCFService.ProductService" behaviorConfiguration="DefaultServiceBehavior">

<host>
<baseAddresses>
<add baseAddress="net.tcp://vishnu/MYNetTcpHost/"/>
<add baseAddress="http://vishnu/MYNetTcpHost/"/>
</baseAddresses>
</host>

<endpoint address="ProductService.svc" binding="wsHttpBinding"
  bindingConfiguration="wsHttpBinding" contract="MVKWCFService.IProductService"
  name="wsHttpBinding_IAuthenticationService" />

<endpoint address="ProductService.svc" binding="netTcpBinding"
  bindingConfiguration="netTcpBinding" contract="MVKWCFService.IProductService"
  name="netTcpBinding_IAuthenticationService" />
<!-- Service Endpoints -->
<endpoint address="httpmex" binding="mexHttpBinding" contract="IMetadataExchange" />

<endpoint address="tcpmex"                                                                
binding="mexTcpBinding"
contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="DefaultServiceBehavior">

<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="false"/>

<!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<!--<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />-->
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

</configuration>

Sunday, October 6, 2013

Microsoft WCF Test Client Issue Due To Oracle Dll installed in Biztalk Machine


About this Document
Purpose
This document shall address to resolve the Oracle.DataAccess.dll,version=2.111.7.0 not found while using Microsoft WCF Test Client.
Issue
When invoking a service from Microsoft WCF Test Client the below error appears as shown in below Figure


Fig 1.0 Issue
Reason
This Issue may arise if the box is installed with WCF LOB adapter after installation of Biztalk Server 2010.Because there is a conflict between Oracle.DataAccess.dll


Resolution
To Uninstall Microsoft Biztalk Adapter Pack




Uninstallation of Microsoft Biztalk Adapter Pack
For the Microsoft Biztalk Adapter Pack Uninstallation .The uninstallation steps are given as below order.


Start -> Control Panel -> Programs and features


Fig 2
Select “Programs and Features”










  • Right click on Microsoft Biztalk Adapter pack and Click “Uninstall




Fig 3




Fig 4


Select “Yes” 

Thursday, August 1, 2013

CLR Manged Module


A managed module is a standard 32-bit Microsoft Windows
portable executable (PE32) file or a standard 64-bit Windows portable executable (PE32+) file that
requires the CLR to execute. By the way, managed assemblies always take advantage of Data Execution
Prevention (DEP) and Address Space Layout Randomization (ASLR) in Windows; these two features
improve the security of your whole system.

Data Execution Prevention

Data Execution Prevention (DEP) is a security feature that can help prevent damage to your computer from viruses and other security threats.
Computer programs set aside a portion of your computer's memory for data, and another portion for instructions that your programs use. Hackers can try to trick programs into running (also known as executing) harmful data placed in your computer's memory as if it were instructions. This could allow a hacker to take control of your computer.
DEP can help protect your computer by monitoring your programs to make sure that they use computer memory safely. If DEP notices a program trying to run instructions from the portion of memory used for data, DEP closes the program and notifies you. 






Wednesday, July 17, 2013

Birth Certificate ( Baby Birth Certificate )

Dear,

How to get Birth Certificate Mandatory Certificate

After Birth of your babies….

Please go to your Municipality/Panchayath
Give your details

Under Name: You can mention just baby of and later you can add/update your name;

Mandatory Docs;
Your Ids, If you want to mention your current address.. Please take your Bank Statement. So update your Current address now only in your Banks.


Monday, July 8, 2013

WCF Endpoint and Binding by coding.


namespace ORS.SAMPLE.Base.Repository
{
    public class SAMPLEFactory : ISAMPLEServiceFactoryIDisposable
    {
        private bool _disposed;
        private ChannelFactory<ISAMPLESubject> factory;
        /// <summary>
        /// Constructor to initialize factory
        /// </summary>
        public SAMPLESubjectServiceFactory()
        {
          

Binding binding = null;
           
Uri address = null;
           

ProcessConfig.ResolveEndpoint("SAMPLESubjectServiceProxy.ISAMPLESubject"out address, out binding);
           

factory = new ChannelFactory<ISAMPLESubject>(binding, address.ToString());
        
   // Based on http://stackoverflow.com/questions/4812668/how-to-add-maxitemsinobjectgraph-programmatically-without-using-configuration-fi
 foreach (OperationDescription op in factory.Endpoint.Contract.Operations)
            {
                var dataContractBehavior = op.Behaviors.Find<DataContractSerializerOperationBehavior>();
                if (dataContractBehavior != null)
                {
                    dataContractBehavior.MaxItemsInObjectGraph = int.MaxValue;
                }
            }
        }
       


        /// <summary>
        /// Factory class
        /// </summary>
        /// <returns></returns>
        public ChannelFactory<IFuseSubject> Create()
        {
            return factory;
        }
       


        /// <summary>
        /// Close the factory
        /// </summary>
        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }
        

        protected virtual void Dispose(bool disposing)
        {
            if (!_disposed)
           {
                if (disposing)
                {
                    if (factory != null) factory.Close();
                }
                factory = null;
                _disposed = true;
            }
        }
    }
}

----------------------------------
----------------------------------

using System;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.ServiceModel.Configuration;

namespace ABIM.BusinessService.Home
{
    public static class ProcessConfig
    {
        private static System.ServiceModel.Configuration.BindingsSection GetBindingSection()
        {
            return ConfigurationManager.GetSection("system.serviceModel/bindings") as System.ServiceModel.Configuration.BindingsSection;
        }

        public static Binding ResolveBinding(string name)
        {
            System.ServiceModel.Configuration.BindingsSection section = GetBindingSection();

            foreach (var bindingCollection in section.BindingCollections)
            {
                for (int i = 0; i < bindingCollection.ConfiguredBindings.Count; i++)
                {
                    if (name.Equals(bindingCollection.ConfiguredBindings[i].Name, StringComparison.CurrentCultureIgnoreCase))
                    {
                        var bindingElement = bindingCollection.ConfiguredBindings[i];
                        var binding = (Binding)Activator.CreateInstance(bindingCollection.BindingType);
                        binding.Name = bindingElement.Name;
                        bindingElement.ApplyConfiguration(binding);
                        return binding;
                    }
                }
            }
            return null;
        }

        private static ClientSection GetClientSection()
        {
            return ConfigurationManager.GetSection("system.serviceModel/client") as ClientSection;
        }

        public static void ResolveEndpoint(string contract, out Uri host, out Binding binding)
        {
            host = null;
            binding = null;
            ClientSection clientSection = GetClientSection();
            ChannelEndpointElementCollection endpointCollection = clientSection.ElementInformation.Properties[string.Empty].Value as ChannelEndpointElementCollection;
            foreach (ChannelEndpointElement endpointElement in endpointCollection)
            {
                if (contract.Equals(endpointElement.Contract, StringComparison.CurrentCultureIgnoreCase))
                {
                    host = endpointElement.Address;
                    binding = ResolveBinding(endpointElement.BindingConfiguration);
                    return;
                }
            }
        }
    }

}









Tuesday, February 19, 2013

Concatenate fields in item template GRID

Grid


Concatenate  fields in item template

Text='<%# string.Concat(DataBinder.Eval(Container.DataItem, "ID"), " ", DataBinder.Eval(Container.DataItem, "InstanceID")," ", DataBinder.Eval(Container.DataItem,"TypeCode") %>'


Monday, February 11, 2013

Linq - Delegates , Anonymous functions




delegate in where condition


An anonymous function is an "inline" statement or expression that can be used wherever a delegate type is expected. You can use it to initialize a named delegate or pass it instead of a named delegate type as a method parameter.

var fu = productMemberResponse.ProductList.Where(delegate(ProductMemberDetails pmd)
                {
                    if (pmd.Type == "SEP")
                        return sepProduction;
                    else if (pmd.Type == "PIM")
                        return pimProduction;
                    else return true;
                }
                ) ;



A lambda expression is an anonymous function that you can use to create delegates or expression tree types. By using lambda expressions, you can write local functions that can be passed as arguments or returned as the value of function calls. Lambda expressions are particularly helpful for writing LINQ query expressions.


(input parameters) => expression

(input parameters) => {statement;}

Func<bool, int> del = x => x ? 10 : 5; 
    new ShoppingCart().Process(del);


Friday, February 1, 2013

Interview Questions On SQL

Update


1) How update works internally ?
----------------------------
--
-- Oops! SQL column swap or SQL column clobber?
--
create table #temp (PK int identity, c1 int, c2 int);

insert into #temp values (1,2);
insert into #temp values (3,2);
insert into #temp values (2,1);
insert into #temp values (5,2);
insert into #temp values (5,3);

select * from #temp order by PK;
--
-- Swap columns c1 and c2 on a
-- row-by-row basis if c1 > c2
--

update #temp
 set c1 = c2, c2 = c1
 where c1 > c2;

--
-- Will column c2 clobber column c1
-- BEFORE column c1 can replace column c2?
-- Do we need a temporary column
-- or variable to correct this?
--
select * from #temp order by PK;
--

drop table #temp;


2) 
-- #1 Table
CREATE TABLE GenderUpdate
(
ID SMALLINT IDENTITY,
Gender CHAR(1)
);

-- #2 Data
INSERT INTO GenderUpdate (Gender) 
VALUES ('M'), ('M'),('M'),('M'),('M'),('M'),('F'),('F'),('F'),('F'),('F'),('F'),('F'),('F'),('F'),('F')

-- #3 To check the data count gender wise
SELECT Gender, COUNT(gender) [COUNT] FROM GenderUpdate GROUP BY gender

-- #4 Final update with case statement
UPDATE GenderUpdate
 SET Gender = CASE WHEN GENDER = 'M' then 'F' ELSE 'M' END

 SELECT Gender, COUNT(gender) [COUNT] FROM GenderUpdate GROUP BY gender