Wednesday, 6 January 2016

BizTalk WCF : BizTalk System.ServiceModel.AddressAccessDeniedException

BizTalk System.ServiceModel.AddressAccessDeniedException

You configure a self-hosted service at a BizTalk receive location using a localhost address, and when you try to enable the service (receive location) you get the above error with the details 'HTTP could not register URL http://+:80/Service.CreateService.FirstService.v1/. Your process does not have access rights to this namespace'

I was getting above error when trying to Enable WCF receive location.

To overcome this issue, you need to

Solution

1. Open the Visual studio command prompt (using the run as administrator option)

2. Type in the command netsh http add urlacl url=http://+:80/<the rest of the address that comes after localhost/> user=DOMAIN\username (So, if your full address ishttp://localhost/company.bookings.carbookingservice, you type inhttp://+:80/company.bookings.carbookingservice)

User Name should be same under which your host is running.


3. Enter to run the command
4. reset IIS - optional
5. Enable the receive location. It should start successfully now 



Orchestration :The xpath expression selected a node which is not valid for property or distinguished field retrieval

Error : Orchestration :The xpath expression selected a node which is not valid for property or distinguished field retrieval

Solution:
I got above error while setting message attribute value in orchestration using Xpath:
I was assigning value to response message attribute after the executing Map. the Map was not creating any node for that attribute and when I was trying to set values in orchestration it was throwing error.

1. Check if the transform is producing the node during the runtime. Please also test the field value by writing the map's output to event log
2. Make sure your Xpath is valid. You may use xpath tester tool to test xpath configured is correct. 

Monday, 12 October 2015

BizTalk Map incoming Message to Single Output field - XSLT template

BizTalk Transformation : Map Incoming XML Message  to Single output field as string

To map incoming message to single out field, we will use xstl template in map.

1. Drag and drop Custom Scripting Functoid on your Map
2.Select  Inline XSLT Call Template.
3. Copy and Paste the following xslt code in "Inline Script" Section

<xsl:template name="called-template">
  <xsl:param name="param1" />
  <xsl:element name="DestinationField" namespace="http://myschema.namespace.com/">
    <xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
    <xsl:call-template name="identity" />
    <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
  </xsl:element>
</xsl:template>

<xsl:template name="identity" match="@*|node()">
  <xsl:copy>
    <xsl:apply-templates select="@*|node()" />
  </xsl:copy>
</xsl:template>
4. Map your root node name of source schema and destination field to this scripting Functoid.
5. Validate and Test your Map.

Friday, 17 April 2015

BizTalk : Design Patterns in Orchestrations

Design Patterns in Orchestrations : BizTalk


A good article on BizTalk design pattern can be found on msdn link @  https://msdn.microsoft.com/en-us/library/aa561967.aspx


Source code related this article can be found in your local BizTalk installation folder
C:\Program Files (x86)\Microsoft BizTalk Server 2010\SDK\Samples

Thursday, 15 January 2015

Optimizing Pipeline Performance - Biztalk Pipeline

Optimizing Pipeline Performance - Biztalk Pipeline

A really helpful artical on improving BizTalk Pipeline component performance

http://msdn.microsoft.com/en-us/library/ee377071(v=bts.70).aspx

  1. What to use inside the pipelne component 
  2. Should we use XMLDocument or XMLReader in the pipeline component.
  3. working with Virtual Stream.
  4. Using AddResourceTracker 

pContext.ResourceTracker.AddResource(messageData);

http://msdn.microsoft.com/en-us/library/ee377071(v=bts.70).aspx


Wednesday, 1 October 2014

Overriding ConnectionString in Machine.config with web.config ConnectionString.


Overriding ConnectionString in Machine.config with web.config connectionstring.


If I have following connectionstring in my machine.config  (Machine level value)
<connectionStrings>
                 <add name="TestConfigConnection" connectionString="DATA SOURCE=machineCon;PERSIST SECURITY INFO=True;USER ID=usr;PASSWORD=pwd" />
 </connectionStrings>

Now for specific web application I want a different connection string value then we need to override the value in machine.config.
So we  need to add the required connectionstring value in web.config
<connectionStrings>
                 <add name="TestConfigConnection" connectionString="DATA SOURCE=webCon;PERSIST SECURITY INFO=True;USER ID=usr;PASSWORD=pwd" />
 </connectionStrings>


But with this, it will give an error in browser that
Parser Error Message: The entry 'TestConfigConnection' has already been added.

Means when you already have this key connectionstring in machine.config then why are you storing this value again in web.config file.

To overcome this error we need to remove the key in web.config and then need to add it again. So my Web.Config file will have following entry

<connectionStrings>
                 <remove name="TestConfigConnection"/>
<add name="TestConfigConnection" connectionString="DATA SOURCE=webCon;PERSIST SECURITY INFO=True;USER ID=usr;PASSWORD=pwd" />
 </connectionStrings>


This will work J

Sunday, 21 September 2014

Why can't we have send and receive within an atomic scope


Why can't we have send and receive within an atomic scope?


The atomic scope was designed to handle Atomicity, Consistency,
Isolation, and Durability (ACID) compliant operations that must either all succeed or
all fail as a group.

This is a classic database transaction style. It is designed to carry
an orchestration from one stable state to another. This is why you cannot both
send and receive from an atomic scope, because by design the message box is not
a lockable resource
.


To accomplish this atomicity, the orchestration engine persists
the entire orchestration state to the message box before the atomic scope begins; it
subsequently persists the orchestration again when the atomic scope completes.