Gokul's Blog


Leave a comment

Dynamic Adapter aliases

Adapter Registered Alias
WCF-NetMsmq net.msmq://
FTP ftp://
WCF-BasicHttp http://
FILE file://
SQL sql://
SOAP soap://
WCF-NetTCP net.tcp://
SMTP mailto://
MSMQT Direct=
WCF-Custom wcf://
MQSeries MQS://
Windows SharePoint Services WSS://
MSMQ MSMQ://
WCF-NetNamedPipes net.pipe://
wcf:// wcf://
HTTP http://
WCF-WSHttp http://

 

Article source: http://www.quicklearn.com/blog/post/Dynamic-Adapter-Aliases.aspx

Advertisements


Leave a comment

Tabless design (HTML)

Here is an example of using tables. This is the output from photoshop after slicing up an image. Below it will be the same thing after I converted to tableless design.

Code:

<table id="Table_01" width="248" height="355" border="0" cellpadding="0" cellspacing="0">
   <tr>
      <td colspan="6">
         <img src="images/calcTables_01.jpg" width="248" height="22" alt=""></td>
   </tr>
   <tr>
      <td>
         <img src="images/calcTables_02.jpg" width="20" height="50" alt=""></td>
      <td colspan="4">
         <img src="images/calcTables_03.jpg" width="205" height="50" alt=""></td>
      <td>
         <img src="images/calcTables_04.jpg" width="23" height="50" alt=""></td>
   </tr>
   <tr>
      <td colspan="6">
         <img src="images/calcTables_05.jpg" width="248" height="22" alt=""></td>
   </tr>
   <tr>
      <td colspan="2">
         <img src="images/calcTables_06.jpg" width="30" height="68" alt=""></td>
      <td>
         <img src="images/calcTables_07.jpg" width="184" height="68" alt=""></td>
      <td>
         <img src="images/calcTables_08.jpg" width="1" height="68" alt=""></td>
      <td colspan="2">
         <img src="images/calcTables_09.jpg" width="33" height="68" alt=""></td>
   </tr>
   <tr>
      <td colspan="2">
         <img src="images/calcTables_10.jpg" width="30" height="64" alt=""></td>
      <td colspan="2">
         <img src="images/calcTables_11.jpg" width="185" height="64" alt=""></td>
      <td colspan="2">
         <img src="images/calcTables_12.jpg" width="33" height="64" alt=""></td>
   </tr>
   <tr>
      <td colspan="2">
         <img src="images/calcTables_13.jpg" width="30" height="74" alt=""></td>
      <td colspan="2">
         <img src="images/calcTables_14.jpg" width="185" height="74" alt=""></td>
      <td colspan="2">
         <img src="images/calcTables_15.jpg" width="33" height="74" alt=""></td>
   </tr>
   <tr>
      <td colspan="6">
         <img src="images/calcTables_16.jpg" width="248" height="54" alt=""></td>
   </tr>
   <tr>
      <td>
         <img src="images/spacer.gif" width="20" height="1" alt=""></td>
      <td>
         <img src="images/spacer.gif" width="10" height="1" alt=""></td>
      <td>
         <img src="images/spacer.gif" width="184" height="1" alt=""></td>
      <td>
         <img src="images/spacer.gif" width="1" height="1" alt=""></td>
      <td>
         <img src="images/spacer.gif" width="10" height="1" alt=""></td>
      <td>
         <img src="images/spacer.gif" width="23" height="1" alt=""></td>
   </tr>
</table>

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

 

Going tableless means less code in your html. It is easier for text based browsers to understand and puts all the definitions in an external style sheet. This means removing the need to edit your html later on. Using this method allows you to edit your style sheet instead.

Code:

<div id="calculatorWrapper">
   <div id="calcTop"></div>
    <div id="calc02"></div><div id="calc03"></div><div id="calc04"></div>
    <div id="calc05"></div>
   <div class="calcBtn1"></div><div class="calcBtn2"></div><div class="calcBtn3"></div>
    <div class="calcBtn1"></div><div class="calcBtn2"></div><div class="calcBtn3"></div>
    <div class="calcBtn1"></div><div class="calcBtn2"></div><div class="calcBtn3"></div>
   <div id="calcBottom"></div>
</div>

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

Now isn’t that much nicer.

Here is the css required.

Code:

#calculatorWrapper {
   width:248px;
   height:319px;
   display:block;
   position:relative;
   margin-left:auto;
   margin-right:auto;
   }
#calcTop {
   background-image:url(../images/calculator_01.jpg);
   width:248px;
   height:22px;
   }
#calc02 {
   background-image:url(../images/calculator_02.jpg);
   width:20px;
   height:50px;
   float:left;
   }
#calc03 {
   background-image:url(../images/calculator_03.jpg);
   width:205px;
   height:50px;
   float:left;
   }
#calc04 {
   background-image:url(../images/calculator_04.jpg);
   width:23px;
   height:50px;
   float:left;
   }
#calc05 {
   clear:left;
   background-image:url(../images/calculator_05.jpg);
   width:248px;
   height:22px;
   }
.calcBtn1 {
   float:left;
   background-image:url(../images/calculator_10.jpg);
   width:30px;
   height:64px;
   }
.calcBtn2 {
   float:left;
   background-image:url(../images/calculator_11.jpg);
   width:185px;
   height:64px;
   }
.calcBtn3 {
   float:left;
   background-image:url(../images/calculator_12.jpg);
   width:33px;
   height:64px;
   }
#calcBottom {
   clear:left;
   background-image:url(../images/calculator_16.jpg);
   width:248px;
   height:54px;
   }

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

You can see this code live in action here. I’ve used it to for designing a form. And inserted form elements in between the div tags.

http://laweightlosssurgery.com/bmic.html

Article Source


Leave a comment

Storing Configuration values with BizTalk

There are many ways by which we can store configuration, cross-reference information in BizTalk. I will try to discuss some of the ways which I have used before.

1. Using BTSNTSvc.Config’s appSettings to store the configuration information. This is similar to App.config in .Net. One more way to isolate the storage of appSettings values is to store in a different file and set the file attribute in the appsettings TAG to an External Filename.

E.x (In BTSNTSvc.config File)
<appSettings file="BizTalkAppConfig.config">
</appSettings>

External File:
<appSettings>
  <add key="ConnectionString" value="Integrated Security=SSPI;Data Source=localhost;Initial Catalog=BizTalkMsgBoxDb" />
  <add key="DEBUG_Mode" value="true"/>
</appSettings>

2. Using SSO Configuration to store the information. Richard Seroter came up with a handy tool to store and retrieve values with SSOConfig db. The link I have added below has some added feature to it. http://geekswithblogs.net/paulp/archive/2008/05/16/122205.aspx

3. Incase if you are using a map, getting to these values or if the number of cross-reference values you store is more then the above design becomes a bit more complex option. Using the Xref set of tables and btsXrefimport option we can store configuration values and used by the MAP as well use the exposed API to get the application/common value. Link: xrefseed.zip
A good write up of some ways to store map data is here http://geekswithblogs.net/michaelstephenson/archive/2006/12/24/101995.aspx

There is a write up from Michael Stephenson regarding the same topic Click To View Entry

One more interesting article regarding storing custom configuration settings using Enterprise Library: http://geekswithblogs.net/paulp/archive/2008/06/11/122803.aspx


Leave a comment

Get My IP Simulation

http://gokul.i3software.in/samplecode/ipaddress.aspx

 

Code following Shortly.

 

Code to get the IP from Webpage to a Console App

try
  {
   // Use a web page that displays the IP of the request.  
   WebRequest myRequest = WebRequest.Create("http://Myurl");

   // Send request, get response, and parse out the IP address on the page.
   using(WebResponse res = myRequest.GetResponse())
   {
    using(Stream s = res.GetResponseStream())
    using(StreamReader sr = new StreamReader(s, Encoding.UTF8))
    {
     string html = sr.ReadToEnd();
     Regex regex = new Regex(@"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b");
     string ipString = regex.Match(html).Value;
     Console.WriteLine("Public IP: "+ipString);
    }
   }
  }
  catch(Exception ex)
  {
   Console.WriteLine("Error getting IP Address:\n"+ex.Message);
  }


Leave a comment

Missing Dll Error

Compiler Error Message: CS0006: Metadata file
C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll’
could not be found

To resolve the above error copy the files from C:\Windows\Microsoft.NET\Framework\v2.0.50727 to the above mentioned folder(C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a).

This happened when I was trying to run a asp.net page, I had vs 2008 installed as well.


Leave a comment

BizTalk Appsettings in a seperate file

Using BTSNTSvc.exe.config to store the AppSettings value for BizTalk is a common practice.

We can use a separate file to store these values.

This can be achieved by following the steps below

1. In the appSettings element set its file attribute to the filename which will contain the appSettings
<appSettings file="MyFileName.Config">
<add key="WriteToDebugView" value="true"/>
</appSettings>

2. Create the MyFileName.Config and store the content as follows
<appSettings>
  <!– Common settings for all applications –>
  <add key="ConnectionString" value="Integrated Security=SSPI;Data Source=MyDS;Initial Catalog=MsgBoxDb" />
    <!– Settings for My Orchestration  –>
  <add key="DEBUG_FLAG" value="true"/>
</appSettings>