<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>BTS Bits</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/brajens/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/brajens/feed.xml</link>
    <description>My name is Brajendra Singh. Check out for articles, code snippets and field experiences related to BizTalk. Emphasis is on those topics which are not well documented and tough to follow.</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:20:42 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Microsoft Customer Care Framework (CCF) - HAT Architecture</title>
      <link>https://docs.microsoft.com/archive/blogs/brajens/microsoft-customer-care-framework-ccf-hat-architecture</link>
      <pubDate>Sat, 05 Dec 2009 22:16:00 GMT</pubDate>
      <dc:creator><![CDATA[brajens]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brajens/2009/12/05/microsoft-customer-care-framework-ccf-hat-architecture/</guid>
      <description><![CDATA[Introduction
Microsoft Customer Care Framework (CCF) is used to integrate and automate line of...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 16pt; LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt"><FONT face=Calibri>Introduction<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Microsoft Customer Care Framework (CCF) is used to integrate and automate line of business (LOB) applications. CCF uses two modules “Application Integration Framework (AIF)” and “Hosted Application Toolkit (HAT)” for this purpose. <SPAN style="mso-spacerun: yes">&nbsp;</SPAN>AIF provides foundation and framework for application integration and automation, while HAT provides development toolkit for the same.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>HAT development toolkit comes with software factory that developers can use to integrate LOB applications easily. In this article, I am going to cover high-level architecture of HAT.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 16pt; LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt"><FONT face=Calibri>Architecture of HAT<o:p></o:p></FONT></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>HAT makes use of 5 components and these components play different roles in development -</FONT></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo1"><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>1.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>Line of Business Application </FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo1"><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>2.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>Automation</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo1"><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>3.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>Automation Manager</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo1"><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>4.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>Binding File (Init String)</FONT></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo1"><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>5.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>Data Driven Adapter (DDA)</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Kindly refer Figure1 in attached image&nbsp;to see </FONT><FONT face=Calibri size=3>logical architecture of HAT.[Sorry&nbsp;not&nbsp;able to insert image into body]&nbsp;</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt" mce_keep="true"><FONT size=3><FONT face=Calibri><B style="mso-bidi-font-weight: normal"><I style="mso-bidi-font-style: normal">Lines of Business Applications </I></B>are customer applications that developers want to integrate and automate for CCF implementation.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>CCF follows “No Rip and Replace” methodology and it <SPAN style="mso-spacerun: yes">&nbsp;</SPAN>does not require any changes in applications.</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT size=3><FONT face=Calibri><B style="mso-bidi-font-weight: normal"><I style="mso-bidi-font-style: normal">Automation </I></B>is business logic or user activities which developers want to automate. The automation primarily consists of following tasks –</FONT></FONT></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo2"><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>1.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>Navigation between pages</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo2"><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>2.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>Read some data value from screen or page</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo2"><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>3.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>Set some data in a control on screen or page</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo2"><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>4.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>Click on button, check boxes, radio buttons, links, menu etc.</FONT></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo2"><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>5.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>Call Web Services and other APIs etc.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Kindly refer figure 2 of attached image to see sample automation.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Developers use windows workflow foundation 3.0 or above within Visual Studio to develop business logic in HAT.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT size=3><FONT face=Calibri><B style="mso-bidi-font-weight: normal">Automation Manager</B> is runtime of AIF. It is extension of windows workflow runtime. Automation manager uses binding file and automation business logic to perform automation of LOB application at runtime.</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT size=3><FONT face=Calibri><B style="mso-bidi-font-weight: normal">Binding File or Init String </B>is used to store application information and control definition of LOB application. Binding file typically holds following information –</FONT></FONT></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo3"><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>1.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>Application URL or URI</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo3"><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>2.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>Command line parameters (in case of windows application; if any)</FONT></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo3"><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>3.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>Control definitions. As part of automation, we automate user activities on application controls. Binding file stores definitions of controls involved in automation.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Kindly refer figure&nbsp;3 of attached image to see&nbsp; sample-binding file.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Developers can use HAT software factory in Visual Studio to build binding file. One binding file is created per customer application.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT size=3><FONT face=Calibri><B style="mso-bidi-font-weight: normal">Data Drive Adapters (DDAs) </B>come out of box with CCF framework. DDAs are responsible for executing automation on line of business applications. CCF comes with three out of box adapters –</FONT></FONT></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4"><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><B style="mso-bidi-font-weight: normal"><FONT face=Calibri size=3>Windows DDA</FONT></B></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4"><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><B style="mso-bidi-font-weight: normal"><FONT face=Calibri size=3>Web DDA</FONT></B></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l3 level1 lfo4"><SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><B style="mso-bidi-font-weight: normal"><FONT face=Calibri size=3>Java DDA</FONT></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>As you can see, there is one DDA per application type. All windows smart client applications can be automated using single Windows DDA. Similarly, all web or java applications can be automated using their respective DDAs.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>DDA is quite extensible and developers can easily extend or create new DDA for automation. Creating DDA for mainframe applications, DOS applications etc. are common practice in CCF world of development.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 16pt; LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt"><FONT face=Calibri>How Things Work?<o:p></o:p></FONT></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Automation in CCF works as following -</FONT></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo5"><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>1.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>Business logic is built in windows workflow (WF) using CCF specific activities. One CCF activity performs a single step such as execute control, get control value or set control value etc.</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><o:p><FONT face=Calibri size=3>&nbsp;</FONT></o:p></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo5"><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>2.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT size=3><FONT face=Calibri><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>CCF specific activities are placed in sequential workflow library to build business logic.</FONT></FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><o:p><FONT face=Calibri size=3>&nbsp;</FONT></o:p></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo5"><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>3.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>CCF Automation manager runs WF based business logic. CCF automation manager is extension of windows workflow runtime.</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo5"><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>4.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>Automation manager reads automation instruction from WF based business logic and makes use of application binding file and appropriate DDA to perform automation.</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><o:p><FONT face=Calibri size=3>&nbsp;</FONT></o:p></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo5"><SPAN style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><SPAN style="mso-list: Ignore"><FONT face=Calibri size=3>5.</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><FONT face=Calibri size=3>On one hand, Automation manager refers binding file to learn control definition where it has to perform automation, on the other hand automation manager instructs DDA to perform actual automation by passing relevant information – control definition, automation instruction etc.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 16pt; LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt"><FONT face=Calibri>Summary<o:p></o:p></FONT></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri><FONT size=3>You can see that HAT is quite extensible and decoupled component to perform automation on LOB applications. In coming article, I will write more about HAT components, their extensibility and usage</FONT><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 16pt; LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt">.</SPAN></B></FONT></P>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/93/30/89/Figure1-2-3.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-09-93-30-89/Figure1_2D00_2_2D00_3.jpg">Figure1-2-3.jpg</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Generating Schema in BizTalk using existing XDR or XML file (error resolution)</title>
      <link>https://docs.microsoft.com/archive/blogs/brajens/generating-schema-in-biztalk-using-existing-xdr-or-xml-file-error-resolution</link>
      <pubDate>Mon, 21 Jul 2008 11:47:00 GMT</pubDate>
      <dc:creator><![CDATA[brajens]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brajens/2008/07/21/generating-schema-in-biztalk-using-existing-xdr-or-xml-file-error-resolution/</guid>
      <description><![CDATA[Many times you don’t create message schema from scratch. Instead you try to generate schema using...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Many times you don’t create message schema from scratch. Instead you try to generate schema using some existing DTD, XDR or even sample XML file. Recently, I was trying to generate schema using XDR and sample XML file and ran into small irritating problems. This encouraged me to share solution for them with you.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I right clicked on project to select “Add Generated Item” menu. Then I selected “Generate Schema” option on next screen and start using it. First message I got that I need to run “InstallWFX.vbs” script file (located in InstallDir:\Program Files\Microsoft BizTalk Server 2006\sdk\Utilities\Schema Generator” folder) to install necessary prerequisite to use this tool. This was informative message and I did the same. Just for information, you need to run “InstallDTD.vbs” script file to install necessary prerequisite to generate schema using DTD file.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">After running “installWFX.vbs” script, I was expecting smooth sailing but I was bugged with an error message. Something like - <B style="mso-bidi-font-weight: normal">“Could not find file or assembly Microsoft.BizTalk.TOM … “. </B>It was little weird to see this error because this dll was already present in machine.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I looked for similar error on net and even in BizTalk documentation but could not find one. I was making hit and try. And finally; following steps made schema generation tool run –<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l0 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I searched for “Microsoft.BizTalk.TOM .dll” assembly on machine.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l0 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Used “gacutil” to register this assembly in GAC<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l0 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Finally executed “InstallWFX.vbs” script again.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Sometime small issues create big hurdle in development and especially when you don’t find remedy for them anywhere. Hope you find this useful.<o:p></o:p></SPAN></P>]]></content:encoded>
    </item>
    <item>
      <title>Receive or Pull Data from CRM using BizTalk</title>
      <link>https://docs.microsoft.com/archive/blogs/brajens/receive-or-pull-data-from-crm-using-biztalk</link>
      <pubDate>Mon, 03 Mar 2008 02:44:00 GMT</pubDate>
      <dc:creator><![CDATA[brajens]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brajens/2008/03/03/receive-or-pull-data-from-crm-using-biztalk/</guid>
      <description><![CDATA[(Article works with CRM Dynamics 3.0 and BizTalk Server 2004 onwards)
BizTalk CRM adapter can be...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">(Article works with CRM Dynamics 3.0 and BizTalk Server 2004 onwards)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">BizTalk CRM adapter can be used to send or push data to CRM system from any other application system. For example, account data can be pushed to CRM server from commerce server. But when it comes to receiving or pulling data out of CRM, Adapter is not the way because it comes with send adapter only. Well, one can design to run a scheduled orchestration which pools CRM server to fetch required data using SOAP adapter and CRM web service. But pooling is not a smart way. Ideally, any scalable design should pull incremental data when any data change happens. You can call this event (data change/addition) driven incremental data receive.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Understanding Fundamentals<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">To design event driven incremental data receive, you have to use some of the in-house features of CRM. These features are – “Workflow” and “BizTalk Logic Extension” or “Callout”. Let’s talk little about these.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Microsoft CRM provides an event driven workflow framework on which developers can write custom logic. You can write a .net component and make it work under a workflow rule definition. Workflow rules can be bound to the following events that can be performed on an entity instance –<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l1 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Create<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l1 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Assign<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 1in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l1 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Change Status<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">For example, if you create a workflow which has a rule which is bound to run on create event for “contact” entity instance, then whenever an instance of “contact” entity is created, it will trigger workflow rule and rule will in reverse call .net component. You can learn more about CRM workflow @ <A href="https://msdn2.microsoft.com/en-us/library/aa685987.aspx" mce_href="https://msdn2.microsoft.com/en-us/library/aa685987.aspx">https://msdn2.microsoft.com/en-us/library/aa685987.aspx</A> . <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">“Business Logic Extensions” or “Callout” is another event driven framework in CRM. Callouts can be configured to run (a .net component) upon occurrence of some event. Callouts support following event for CRM entities –<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l4 level1 lfo2"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Create<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l4 level1 lfo2"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Update<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l4 level1 lfo2"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Delete<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l4 level1 lfo2"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Assign<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l4 level1 lfo2"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Status Change<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l4 level1 lfo2"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Merge<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 1in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l4 level1 lfo2"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Send Mail<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Callouts can be two types of –<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 1in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l0 level1 lfo3"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Pre Callout – executes before occurrence of event<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 1in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l0 level1 lfo3"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Post Callout – executes after occurrence of event<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">For example, if you configure a post callout on create event of “contact” entity, then whenever an instance of “contact” entity is created, it will trigger configured post callout and callout will in reverse call .net component. You can learn more about CRM callout @ <A href="https://msdn2.microsoft.com/en-us/library/aa680495.aspx" mce_href="https://msdn2.microsoft.com/en-us/library/aa680495.aspx">https://msdn2.microsoft.com/en-us/library/aa680495.aspx</A>. <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Both of these features are simple, configurable, require .net based coding and are very powerful. You are not required to be a CRM expert to use or implement them.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Designing Event Driven Incremental Data Import<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">There are few things which make “workflow” and “callout” a great instrument to design event based data pull –<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l5 level1 lfo4"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Both run when events like create, update, delete etc. occurs on CRM entities. Since these events occur when changes happen to entity instances; you can put logic in workflow or callout to read entity instance data just change and play with it. In other world, you can fetch incremental data change.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l5 level1 lfo4"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Both are configurable<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l5 level1 lfo4"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">As an event action, both can run .net components.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Let’s take a scenario and see how these things work together to give desired design.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><U><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Scenario:</SPAN></U></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"> </SPAN></B><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Contoso is an online retail company. It has an e-commerce site with commerce server at back end. And its customer care offices run CRM. Customers can call Contoso customer care center agents to update their profile, credit card and demographic information. Agents use CRM web client to perform job. Customers can also do the same job using self care portal which in reverse uses CRM web service to update information in CRM system. In both of these cases, customer contact information is updated in CRM system. <B style="mso-bidi-font-weight: normal"><I style="mso-bidi-font-style: normal">Requirement is that “as soon as customer contact information is updated in CRM system; it should get synchronized to commerce server”.<o:p></o:p></I></B></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">In this overall requirement, underline statement requires customer contact data to be pulled from CRM system and get pushed into commerce system. You want to do incremental data update and want pull to happen only when any customer contact information is changed. Let’s see a simple possible solution for this -<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><U><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Solution:</SPAN></U></B><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"> here are step by step things I will like to do to implement this solution.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo5"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I am assuming that customer accounts are implemented as “contact” entity in CRM system.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo5"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">First you create a BizTalk project. You add a schema having those fields or properties which we need to synchronize between CRM and Commerce. <o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo5"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Then you add an orchestration. Orchestration will use a “Request-Response” port to read messages of schema type defined above. Once message is read, orchestration uses this message and commerce profile send adapter to send contact information into commerce system. Off course, there will some logic and data mapping between your schema and commerce profile schema. Well, I am sure smart implementation will have more decoupled and scalable orchestration design.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo5"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">When orchestration logic is complete, expose orchestration as web service and perform necessary port binding in BizTalk administrator.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo5"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">You are done with orchestration which can carry data between CRM and Commerce system. Now, we need to hook this orchestration with CRM in such a way that whenever contact entity instance is updated in CRM; it should trigger orchestration and pass required contact data from CRM to Commerce system.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo5"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">To perform required clip, create a workflow or post callout in CRM on “contact” entry and subscribe it to “update” event. As an action, workflow or callout will call a .net component and pass contact instance information to it.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo5"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">.Net component will call BizTalk web service exposed above and will use contact instance information to populate fields of schema in web service and finally call web service.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo5"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">And it works. Whenever, a contact entity instance is updated in CRM, configured workflow or callout will get triggered. Workflow or callout will fire .net component execution. Component will call web service passing contact instance information. Web service will pass data to orchestration and orchestration will push data into commerce system using adapters.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo5"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">That’s it. Solution triggers data synchronization only when any data change happens. Only incremental data is passed between systems.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo5"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Well web service is one way. You can also used file, ftp or any other channel based integration.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Choosing between workflow and business logic extension (callout)<SPAN style="DISPLAY: none; mso-hide: all special"><o:p></o:p></SPAN></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN></SPAN></B><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">You saw that we can use both callout and workflow to implement pull solutions. Question is when to use workflow and when callout? You can use following guidelines –<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l3 level1 lfo6"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Callout supports more events than workflow.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l3 level1 lfo6"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Workflows run asynchronous while callouts work synchronous.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l3 level1 lfo6"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Callouts support all entities in CRM but workflow has reservations for few.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l3 level1 lfo6"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Workflow can be run manually but callout cannot be.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l3 level1 lfo6"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Callouts can be managed using automated deployment but workflow is not. One has to use workflow manager for workflow deployment.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Conclusion<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Workflow and callout are two wonderful features in CRM which can be leveraged by BizTalk to write a smart pull operation. You just need to use their potential and fit in design. Hope you find this article useful.<o:p></o:p></SPAN></P>]]></content:encoded>
    </item>
    <item>
      <title>Using Microsoft BizTalk Dynamics CRM Adapter – Part 5</title>
      <link>https://docs.microsoft.com/archive/blogs/brajens/using-microsoft-biztalk-dynamics-crm-adapter-part-5</link>
      <pubDate>Mon, 30 Jul 2007 05:38:00 GMT</pubDate>
      <dc:creator><![CDATA[brajens]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brajens/2007/07/30/using-microsoft-biztalk-dynamics-crm-adapter-part-5/</guid>
      <description><![CDATA[Welcome to last article of this series. Today, we are going to talk about using some CRM specific...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Welcome to last article of this series. Today, we are going to talk about using some CRM specific field types such as “Lookup” and “Picklist”. We will also have little talk about using custom entities/attributes.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">“Lookup” field is used to link two entities together. For example, when we create an account, we link account entity instance to a contact entity instance where contact is primary contact person for account. In this case, “lookup” type field is used to link account and contact entities. When you see account entity details and screen, you will find “Primary Contact” field as “Lookup” type.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">“Picklist” is similar to options/combo control where user can select a value from existing set of values. For example, “Address Type” field of account entity is “Picklist” type with option values as “Bill To”, “Ship To”, “Primary” and “Other”. Picklist type fields can be displayed as combo box or radio buttons on entity form.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I strongly suggest checking my previous articles for complete context as I am keeping this article very short and to the point.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Using “Picklist” and “Lookup” fields in .net code (calling CRM web service)<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I am going to create an account instance and would use both “Lookup” and “Picklist” type fields in code. <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Procedure is the same; I added CRM web service as web reference and named it “CRMServer”. Following is code to update contact instance in CRM system.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">CrmServer.CrmService service = new CrmServer.CrmService();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">CRMServer.account myaccount = new CRMServer.account();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">myaccount.name = "my account";<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">//Handling Lookup type field<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">CRMServer.Lookup primaryContactLookup = new CRMServer.Lookup();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">primaryContactLookup.Value = new Guid("23e923d8-5cc6-4574-bd34-f1c43130a4bb");<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">primaryContactLookup.type = CRMServer.EntityName.contact.ToString();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">myaccount.primarycontactid = primaryContactLookup;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>//Handling picklist type field<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">CRMServer.Picklist addressTypePicklist = new CRMServer.Picklist();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">addressTypePicklist.name = "address1_addresstypecode";<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">addressTypePicklist.Value = 2;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">myaccount.address1_addresstypecode = addressTypePicklist;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">System.Guid newAccountId = service.Create(myaccount);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I first created an instance of CRM web service client.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">CrmServer.CrmService service = new CrmServer.CrmService();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Then I created instance of account entity and supplied name field which is required.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">CRMServer.account myaccount = new CRMServer.account();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">myaccount.name = "my account";<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Next I am handling “Lookup” type field and linking account and contact entity instances. First, create a new instance of lookup type then assign value to “Value” and “Type” fields. <BR>“Value” field is assigned value of “contactid” (primary key GUID) for contact to be linked. In your implementation, you can run query over contacts using “Fetch” or “Retrieve” method to get required contact and its internal id field “contactid” (primary key value). In “Type” field, we assign name of the entity we are linking to account entity. In our example, it is “contact” entity. You can use “EntityName” enumeration class to get contact entity name or can hard code to “contact” string value. However, first method is preferred. When lookup data is ready, we assign it to appropriate field in account entity.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">//Handling Lookup type field<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">CRMServer.Lookup primaryContactLookup = new CRMServer.Lookup();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">primaryContactLookup.Value = new Guid("23e923d8-5cc6-4574-bd34-f1c43130a4bb");<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">primaryContactLookup.type = CRMServer.EntityName.contact.ToString();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">myaccount.primarycontactid = primaryContactLookup;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Now “Picklist” type. Coding is similar to lookup type field. Create an instance of “Picklist” type and then assign values for “name” and “value” fields. Each option provided by pick list has a numeric value assigned to it. For example in our case of “Address Type” field; following are numeric values assigned to text options - “Bill To” = 1, “Ship To” = 2, “Primary” = 3 and “Other” = 4. <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">In my sample, I selected option number 2 (text value “Ship To”). Name field contains schema name of “Address Type” field which in our case is "address1_addresstypecode”. Finally when pick list is populated; assign it to appropriate field in account entity.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">//Handling picklist type field<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">CRMServer.Picklist addressTypePicklist = new CRMServer.Picklist();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">addressTypePicklist.name = "address1_addresstypecode";<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">addressTypePicklist.Value = 2;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">myaccount.address1_addresstypecode = addressTypePicklist;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Good, now time to call create method to create a new account.</SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"> <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">System.Guid newAccountId = service.Create(myaccount);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Job Done.</SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"> <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Using “Picklist” and “Lookup” fields in BizTalk Orchestration (CRM Adapter)<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Process is the same as we did in previous articles. Create BizTalk project and generate CRM entity schema using send port (CRM adapter based) and web service.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">When you generate account schema for “create” operation, it generates a schema named “account_Entities.xsd” which is used to create request message for create account operation.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">If you check “Primary Contact” (lookup type) and “Address Type” (pick list type) fields of account schema, it looks similar to what we did in .net code above.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">“Primary Contact” field looks like following – <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">primaryaccountid<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>|__ IsNull<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>|__ name<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>|__ type<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>|__ dsc<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">We assign value similar to .net code – <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Primaryaccountid ------------ assign value = </SPAN></I><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">"23e923d8-5cc6-4574-bd34-f1c43130a4bb" </SPAN><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">--- </SPAN></I><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>|__ IsNull<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>|__ name<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-tab-count: 1">&nbsp; </SPAN><o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>|__ type ---------------- assign value= “contact” ---<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>|__ dsc<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">“IsNull”, “name” and “dsc” fields are optional. Set “IsNull” field to true if lookup field is optional and you don’t want to populate this field. “Name” can hold schema name of lookup type field. And “dsc” can hold brief description about usage of this field. You can use some other message field or script functoid in map to assign these fields.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">When we check “Address Type” field, it looks like following – <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">address1_addresstypecode<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>|__ IsNull<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>|__ name<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Again, value assignment is similar to .net code -<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">address1_addresstypecode ------------ assign value = 2 </SPAN></I><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN></SPAN><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">-- </SPAN></I><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>|__ IsNull<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #0070c0; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>|__ name ---------------- assign value= “address1_addresstypecode” ---<o:p></o:p></SPAN></I></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">“name” and “IsNull” fields are optional. Set “IsNull” field to true if “Picklist” type field is optional and you don’t want to populate this field. “name” field is populated with schema name of the field.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Populate request message as directed above and you are all set to perform create account operation. Please refer previous articles to understand other required things as I have focused on populating “Lookup” and “Picklist” type fields only.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Using Custom Entities/Attributes<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Using custom entities/attributes are no different than CRM system entities and attributes. Thanks to metadata driven approach used by CRM system which gives CRM extensibility to a new dimension. Once you create and publish a custom entity or custom attribute, it is ready for use in CRM web service and CRM adapter.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">When using CRM adapter, you will see custom entities listed in schema generation process. Similarly, you will also find custom attributes listed in generated schema.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Similarly, when you use reference web service, you will find custom entities and attributes generate as part of proxy code. <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">In both of the scenarios mentioned above, it uses CRM metadata web service to fetch latest CRM schema and generate proxy code/schema based on that.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">If you have already created one application using CRM web service and then updating CRM schema with custom entities/attributes then you need to update web service reference in application to get hold of updated entities/attributes.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">On similar lines, if you already have a BizTalk application using CRM adapter and you make any change in CRM schema for custom entities and attributes, then you have to regenerate schema for consuming them.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Conclusion<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">You would have seen that “Lookup” and “Picklist” data types are little tricky but simple to use. Nice part is that custom entities/attributes do not make any difference to programming CRM. You just need to update web service reference or regenerate schema in case of BizTalk programming to get hold of changes. <o:p></o:p></SPAN></P>]]></content:encoded>
    </item>
    <item>
      <title>Using Microsoft BizTalk Dynamics CRM Adapter – Part 4</title>
      <link>https://docs.microsoft.com/archive/blogs/brajens/using-microsoft-biztalk-dynamics-crm-adapter-part-4</link>
      <pubDate>Sat, 30 Jun 2007 13:12:00 GMT</pubDate>
      <dc:creator><![CDATA[brajens]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brajens/2007/06/30/using-microsoft-biztalk-dynamics-crm-adapter-part-4/</guid>
      <description><![CDATA[We talked about create, delete, query and configuration details in previous articles. In current...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">We talked about create, delete, query and configuration details in previous articles. In current article, I am quickly going to summarize update operation with CRM system. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I suggest you refer my previous articles before reading current one. This will provide you complete context of things.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Next article in this series will be a final one in which I will talk about dealing with special attributes like (pick list, lookup etc.) and custom attributes/entities.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">How to perform “Update” operation with CRM System<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">“Update” operation is lot similar to “Create” operation. Only difference is that you supply internal primary key (GUID) of entity instance along with other attributes to be modified. Internal primary key is used to identify entity instance in CRM system.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">When updating an entity instance, keep in mind that you cannot provide blank or null values for a required attribute. Another point is that you just need to send values of those attributes only which you wish to update.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Perform “Update Contact Entity” instance using .net code (calling CRM web service)<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I am going to write a sample code which will update some of the attributes (in this case “lastname”) of an existing contact entity instance. <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I added CRM web service as web reference and named it “CRMServer”. Following is code to update contact instance in CRM system.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">CrmServer.CrmService service = new CrmServer.CrmService();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">CrmServer.contact contact = new CrmServer.contact();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">CrmServer.Key contactKey = new CrmServer.Key();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">contactKey.Value = new Guid("7e1120f8-2b15-4fc4-a347-59a702725c61");<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">contact.contactid = contactKey;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">contact.lastname = "Marks";<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">service.Update(contact);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I first created an instance of CRM web service client.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">CrmServer.CrmService service = new CrmServer.CrmService();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Then I created instance of contact entity and supplied internal primary key value (GUID) for “contactid” attribute. “contactid” attribute of contact entity holds primary key value of entity instance.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">CrmServer.contact contact = new CrmServer.contact();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">CrmServer.Key contactKey = new CrmServer.Key();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">contactKey.Value = new Guid("7e1120f8-2b15-4fc4-a347-59a702725c61");<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">contact.contactid = contactKey;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Then I am supplying value for attributes which I wish to update. In this case, it is “lastname”.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">contact.lastname = "Marks";<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Finally, I called update method, passing contact object into it.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">service.Update(contact);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Perform “Update Contact Entity” instance using BizTalk orchestration (using Dynamics CRM Adapter)<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">It is time to perform the same operation using BizTalk CRM adapter. I will quickly summarize things because reader’s who have read my previous articles have enough background about other details. I will primarily talk about entity, action to be selected and schemas to be used for messaging with CRM system.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l1 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">To update a contact, we need a solicit-response send port (say “CRMSendPort”) which can talk to CRM system using BizTalk CRM adapter. <o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l1 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Create a BizTalk project.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l1 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">We have to generate schema for update operation. When you generate schema, select action as “Update” and entity as “contact”.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l1 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">It generates lots of schemas and one BizTalk orchestration file in project. Open orchestration file and delete all port types and multi-part message types generated by default. These are useful but I am asking to clean them so that you can create and understand things from scratch.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l1 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">We are interested in two schemas only – one request schema (to send details of contact to be updated) and one response schema.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l1 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">“contact_Entities.xsd” serves purpose of request schema. In our example, we need to set following fields/elements –<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l1 level2 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"><SPAN style="mso-list: Ignore">o<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">“contactid” – it holds primary internal id (GUID) of contact to be updated<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l1 level2 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"><SPAN style="mso-list: Ignore">o<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">“lastname” – supply updated last name value for contact<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l1 level2 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"><SPAN style="mso-list: Ignore">o<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">“crm_action” – we can keep it blank because we have already supplied value of primary key and this instructs adapter to search for contact entity instance and perform update operation. But it is always good practice to provide action name. In this case, we supply “update” as “crm_action” value.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l1 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Response is handled by “Respond.xsd” schema which can be found @ “C:\Program Files\BizTalkAdapter\Schemas” depending upon adapter installation location. You have to include this Response.xsd in project.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l1 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">We are now all set to implement logic. Create two messages of type request and response schemas. Hook these messages to a static solicit-response send logical port using send and receive shape. Use map (with transform shape) or message assignment shapes to create request xml and send it via solicit-response port. When response comes consume it as per requirement. <o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l0 level1 lfo2"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">When you are done with coding, compile project and deploy it. After deployment, bind solicit-response orchestration ports with physical solicit-response port (“CRMSendPort”) created in above steps. Enlist and start orchestration. Finally trigger orchestration to test update operation.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l0 level1 lfo2"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">That’s it.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Conclusion<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">You must have realized that “create” and “update” are very similar. Only difference is that for create, we don’t supply primary key value while it is must to provide in case of update operation. We are close to our journey. In next article, I will talk about special attributes and custom entities/attributes. Thanks for reading.<o:p></o:p></SPAN></P>]]></content:encoded>
    </item>
    <item>
      <title>Using Microsoft BizTalk Dynamics CRM Adapter – Part 3</title>
      <link>https://docs.microsoft.com/archive/blogs/brajens/using-microsoft-biztalk-dynamics-crm-adapter-part-3</link>
      <pubDate>Fri, 29 Jun 2007 10:33:00 GMT</pubDate>
      <dc:creator><![CDATA[brajens]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brajens/2007/06/29/using-microsoft-biztalk-dynamics-crm-adapter-part-3/</guid>
      <description><![CDATA[In previous articles, we talked about –
·&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">In previous articles, we talked about –<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l0 level1 lfo3"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Installing and configuring BizTalk CRM Adapter<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l0 level1 lfo3"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Basics of CRM System<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l0 level1 lfo3"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">How to perform query operation using BizTalk adapter<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l0 level1 lfo3"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">How to perform create operation using BizTalk adapter<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I suggest you refer my previous articles before reading current one –<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Part1:<SPAN style="mso-tab-count: 1"> </SPAN><A href="https://blogs.msdn.com/brajens/archive/2007/05/27/using-microsoft-biztalk-dynamics-crm-adapter-part-1.aspx" mce_href="https://blogs.msdn.com/brajens/archive/2007/05/27/using-microsoft-biztalk-dynamics-crm-adapter-part-1.aspx">https://blogs.msdn.com/brajens/archive/2007/05/27/using-microsoft-biztalk-dynamics-crm-adapter-part-1.aspx</A><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Part2:<SPAN style="mso-tab-count: 1"> </SPAN><A href="https://blogs.msdn.com/brajens/archive/2007/05/30/using-microsoft-biztalk-dynamics-crm-adapter-part-2.aspx" mce_href="https://blogs.msdn.com/brajens/archive/2007/05/30/using-microsoft-biztalk-dynamics-crm-adapter-part-2.aspx">https://blogs.msdn.com/brajens/archive/2007/05/30/using-microsoft-biztalk-dynamics-crm-adapter-part-2.aspx</A> <SPAN style="mso-spacerun: yes">&nbsp;</SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I am going to cover delete operation in current article. The very next article will talk about update operation.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">How to perform Delete operation with CRM Adapter<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">As I mentioned earlier, you can consider a CRM system as sub-systems having information captured in entities. When performing delete operation, we actually delete instance of one the entity.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Since entities are related to each other, it is always good idea to check dependent entities and come up with logic to handle them when performing delete operation.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Perform “Delete Contact Entity” instance using .net code (calling CRM web service)<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Let’s talk through an example. I am going to write.net code to delete one instance of entity “contact”.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I added CRM web service as web reference and named it “CRMServer”. Following is code to delete contact instance in CRM system.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">CrmServer.CrmService service = new CrmServer.CrmService();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">service.Delete(CrmServer.EntityName.contact.ToString(), new Guid("737ddf30-b7f7-4cff-a559-70ce250ee19b"));<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Code is two liners. I first created an instance of CRM web service client.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">CrmServer.CrmService service = new CrmServer.CrmService();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">And then I called delete method. It takes two parameters – name of the entity whose instance it to be deleted and internal unique id (GUID) of the instance. <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">service.Delete(CrmServer.EntityName.contact.ToString(), new Guid("737ddf30-b7f7-4cff-a559-70ce250ee19b"));<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Every entity instance has a unique primary key value (GUID) inside CRM system. You just need to pass this guid and entity name.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Perform “Delete Contact Entity” instance using BizTalk orchestration (using Dynamics CRM Adapter)<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I am going to perform same delete operation using BizTalk CRM adapter. I am not going to take things in very detail because reader’s who have read my previous articles have enough background about it. I will primarily talk about entity, action to be selected and schemas to be used for messaging with CRM system.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo1; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">To delete a contact, we need a solicit-response send port (say “CRMSendPort”) which can talk to CRM system using BizTalk CRM adapter. <o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo1; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Create a BizTalk project.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo1; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">We have to generate schema for delete operation. When you generate schema, select action as “Delete” and entity as “contact”.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo1; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">It generates lots of schemas and one BizTalk orchestration file. Open orchestration file and delete all port types and multi-part message types generated by default. These are useful but I am asking to clean them so that you can create and understand things from scratch.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo1; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Out of generated schemas, we are interested in two schemas only – one request schema (to send details of contact to be deleted) and one response schema.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo1; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">“contact_Entities.xsd” serves purpose of request schema. There are two nodes/fields which are required to set – one is “contactid” and other is “crm_action”. Supply internal primary key value (GUID) to “contactid” element (same way we did in .net code above). Then supply “delete” as value for “crm_action” field.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Note: </SPAN></B><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Whenever, you want to delete instance of any entity, it generates a schema with name “<I style="mso-bidi-font-style: normal">&lt;entity_name&gt;</I>_Entities.xsd”. And this schema is used to form request message.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo1; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Response is handled by “Respond.xsd” schema which can be found @ “C:\Program Files\BizTalkAdapter\Schemas” depending upon adapter installation location. You have to include this Response.xsd in project.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo1; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">We are now all set to implement logic. Create two messages of type request and response schemas. Hook these messages to a static solicit-response send logical port using send and receive shape. Use map (with transform shape) or message assignment shapes to create request xml and send it via solicit-response port. When response comes consume it as per requirement. <o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level1 lfo2; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">When you are done with coding, compile project and deploy it. After deployment, bind solicit-response orchestration ports with physical solicit-response port (“CRMSendPort”) created in above steps. Enlist and start orchestration. Finally trigger orchestration to test&nbsp;delete operation.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level1 lfo2; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">That’s it.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Conclusion<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">We have quickly seen delete operation. I am writing these small segregated articles to check one operation at a time. Update operation is lot similar to create operation and we will go through it in very next article.<o:p></o:p></SPAN></P>]]></content:encoded>
    </item>
    <item>
      <title>Using Microsoft BizTalk Dynamics CRM Adapter – Part 2</title>
      <link>https://docs.microsoft.com/archive/blogs/brajens/using-microsoft-biztalk-dynamics-crm-adapter-part-2</link>
      <pubDate>Wed, 30 May 2007 10:59:00 GMT</pubDate>
      <dc:creator><![CDATA[brajens]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brajens/2007/05/30/using-microsoft-biztalk-dynamics-crm-adapter-part-2/</guid>
      <description><![CDATA[In previous part of the article, we had initial talks about integration between BizTalk and CRM...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">In previous part of the article, we had initial talks about integration between BizTalk and CRM using Dynamics CRM Adapter. We discussed –<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l0 level1 lfo4"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Installing and configuring BizTalk CRM Adapter<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l0 level1 lfo4"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Basics of CRM System<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l0 level1 lfo4"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">How to perform query operation using BizTalk adapter<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">In this part of article of the article, I am going to take next baby step and talk about another operation “Create Data” in CRM System.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">To take absolute advantage and context of this article, I suggest readers to go through previous part of the article @ <A href="https://blogs.msdn.com/brajens/archive/2007/05/27/using-microsoft-biztalk-dynamics-crm-adapter-part-1.aspx" mce_href="https://blogs.msdn.com/brajens/archive/2007/05/27/using-microsoft-biztalk-dynamics-crm-adapter-part-1.aspx">https://blogs.msdn.com/brajens/archive/2007/05/27/using-microsoft-biztalk-dynamics-crm-adapter-part-1.aspx</A><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">How to perform Create Data with CRM Adapter<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Using BizTalk CRM adapter, developers can create any entity (like account, contact, case, product etc.) inside CRM System. Before creating any entity, it is suggested to get following information about entity for CRM implementation at client site –<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l6 level1 lfo5"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">1.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">What attributes of the entity are supported? (you have to populate data for those attributes)<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l6 level1 lfo5"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">2.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">What attributes of the entity are required? Like “Title” is required field for entity “incident” or “case”. (you just cannot afford to miss populating data for these attributes; it will give error otherwise)<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l6 level1 lfo5"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">3.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">How many attributes of the entity are Pick List types (take options as value)? For example, “Priority” field of “incident” entity is Pick List type and it accepts Low, Normal and High as values. (there is a special way to populate Pick List type attributes)<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l6 level1 lfo5"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">4.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Is this entity linked (has relationship) with other entities? If yes then what are the linking attributes? These fields are called “Lookup” fields. For example, “incident” is linked to “account” entity where “account” has parent entity role. An incident cannot be created unless linked to an account. “Incident” entity has a field as “Customer” where is shows parent account name information. Now, when you create an incident, it is must to provide parent account information because account-incident entities are linked as Parent-Child relationship.(there is a special way to populate Lookup type attributes)<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l6 level1 lfo5"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">5.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Is this a custom entity? (there is a special way to populate custom entities)<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l6 level1 lfo5"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">6.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">What attributes of the entity are custom created? (there is a special way to populate custom attributes)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">In this article, I will talk about out of box entities and their attributes. To reduce complexity, I will leave Pick List type attributes, Lookup type attributes, custom entities and custom attributes. But I promise to address this specifically in very next parts of the article.<o:p></o:p></SPAN></P>
<P class=MsoListParagraph style="MARGIN: 0in 0in 10pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l5 level1 lfo6"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">1.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Example Scenario<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I am taking very simple scenario where I am creating new “contact” entity instance in CRM system. I have tried to keep it simple. The “contact” entity lies under “Service” sub module. Following are answers to my questions above –<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l7 level1 lfo7"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">1.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">What attributes of the entity are supported? <o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; COLOR: #17365d; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themeshade: 191">For this article, I am assuming that client CRM implementation supports following attributes of “contact” entity – “Last Name”, “First Name”, “Salutation”, “Job Title”, “Business Phone” and “Email”.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l7 level1 lfo7"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">2.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">What attributes of the entity are required?<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; COLOR: #17365d; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themeshade: 191">“Last Name” is only required attribute.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l7 level1 lfo7"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">3.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">How many attributes of the entity are Pick List types?<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; COLOR: #17365d; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themeshade: 191">“contact” entity has Pick List type attributes (like “Address Type”) but I am leaving it for next part of article.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l7 level1 lfo7"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">4.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Is this entity linked (has relationship) with other entities?<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; COLOR: #17365d; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themeshade: 191">“contact” entity is linked to “account” entity and has a Lookup type attribute ( “Parent Customer”) but I am leaving it for next part of the article.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l7 level1 lfo7"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">5.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Is this a custom entity?<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; COLOR: #17365d; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themeshade: 191">No, this entity is out of box provided by CRM System.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l7 level1 lfo7"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">6.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">What attributes of the entity are custom created? <o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; COLOR: #17365d; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themeshade: 191">None so far. We will cover it in next part of article.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></B></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></B></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">It’s coding time again.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></B></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l5 level1 lfo6"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">2.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Perform “Create Contact Entity” instance using .net code (calling CRM web service)<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I added CRM web service as web reference and named it “CRMServer”. Following is code to create contact instance in CRM system.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>CRMServer.CrmService service = new CRMWSTest.CRMServer.CrmService();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>service.Credentials = System.Net.CredentialCache.DefaultCredentials;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">CRMServer.contact contact = new CRMServer.contact();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">contact.firstname = "Brajendra";<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">contact.lastname = "Singh";<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">contact.salutation = "Mr.";<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">contact.jobtitle = "Consultant";<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">contact.telephone1 = "111-111-1111";<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">contact.emailaddress1 = "test@microsoft.com";<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">Guid newContactId = service.Create(contact);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Code is fairly simple. I first created an instance of CRM web service client.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">CRMServer.contact contact = new CRMServer.contact();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">contact.firstname = "Brajendra";<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">contact.lastname = "Singh";<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">contact.salutation = "Mr.";<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">contact.jobtitle = "Consultant";<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">contact.telephone1 = "111-111-1111";<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">contact.emailaddress1 = "test@microsoft.com";<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Then I created an instance of “contact” class and set values for attributes. Few things need attention here –<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo8"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">You will get error if you don’t populate “lastname” property because it is a required field for “contact” entity.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo8"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">If you see scenario above, we talked about “Business Phone” and “Email” attributes. But here I am populating “telephone1” and “emailaddress1” properties. This mean, In CRM system, for contact entity, “Business Phone” is display name for schema name “telephone1” and “Email” is display name for “emailaddress1”. You can check all these details on customization section of CRM application and please refer part-1 of article for more information on it.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">Guid newContactId = service.Create(contact);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Finally, you call create method for service. “Create” method is service takes “BusinessEntity” type as parameter. All entities in CRM system inherits from “BusinessEntity” class. This makes “Create” a generic method to create all entities inside CRM system.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">When you create an entity; you get a GUID as return value and it contains internal id (primary key) of that entity instance inside CRM system. Guid returned in this example is internal id of created new contact in CRM system and it is hold by “contactid” attribute of contact entity.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">So far so good, let’s implement the same code in BizTalk using BizTalk adapter.<o:p></o:p></SPAN></P>
<P class=MsoListParagraph style="MARGIN: 0in 0in 10pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l8 level1 lfo1"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">1.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Perform “Create Contact Entity” instance using BizTalk orchestration (using Dynamics CRM Adapter)<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Following are the steps to perform same create contact operation in orchestration using BizTalk Dynamics CRM adapter.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l3 level1 lfo2"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">To create a new contact, we send contact information in XML message and get response XML back containing internal id (primary key) of created contact. We need solicit-response send port for this purpose. Create a new static solicit-response send port in BizTalk Administration Console. Give a name to it (say “CRMSendPort”) and select type as “Microsoft Dynamics CRM” to make it use CRM adapter. Go to “Configure” and put “Web Service URL” as </SPAN><SPAN style="mso-field-code: HYPERLINK"><SPAN class=MsoHyperlink><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><U><FONT color=#0000ff>https://&lt;CRM-Server&gt;/mscrmservices/2006</FONT></U></SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">. <o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">In send handler, select send handler created as per CRM specific host. Configure “Send Pipeline” as “Xml Transmit” and “Receive Pipeline” as “Xml Receive”. Save and close things.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l3 level1 lfo2"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Create a BizTalk project and assign a strong name key to it.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l3 level1 lfo2"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">We have to generate schema for create operation. Right click Project Name &gt;&gt; Select Add Menu &gt;&gt; Select Add Generated Items Menu&gt;&gt; Select Add Adapter Metadata Option&gt;&gt; Press Add Button &gt;&gt; Select Microsoft Dynamics CRM Option&gt;&gt; Select Port (same port created in above steps say “CRMSendPort”) &gt;&gt; Press Next Button. “Microsoft Dynamics CRM User Credentials” screen opens up. Enter user name and password for CRM system. Remember this user name and password should have adequate access to fetch entity and their schema information from CRM system. Press Ok button after entering credentials. <o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l3 level1 lfo2"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">“Microsoft Dynamics CRM Actions and Entities” screen opens up. As we already discussed, CRM sub-systems are made of entities. At this point we select entity which we want to deal with and action which we want to perform on selected entity. Since we want to create an instance of contact, select “Create” as action and “contact” as entity. If required, in some implementation, you can also select multiple actions and multiple entities. When selection is done, press next button. It would take few seconds to generate all schemas related to fetch operation in BizTalk project.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l3 level1 lfo2"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">In generated artifacts, it has lots of schemas and one BizTalk orchestration file. Open orchestration file and delete all port types and multi-part message types generated by default. Well, these are useful but I am asking to clean them so that we can create and understand things from scratch.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l3 level1 lfo2"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">It generates quite a number of schemas in project. These schemas contain type definition and are included in each other. We are interested in two schemas only – one request schema (to send contact details) and one response schema (containing internal id or primary key of created contact).<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l3 level1 lfo2"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">“contact_Entities.xsd” serves purpose of request schema. You expand to see details of this schema; it contains all supported properties of contact entity and “crm_action” attribute.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Note: </SPAN></B><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Whenever, you want to create instance of any entity, it generates a schema with name “<I style="mso-bidi-font-style: normal">&lt;entity_name&gt;</I>_Entities.xsd”. And this schema is used to form request message.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l3 level1 lfo2"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Response is tricky again. Developers think that “Create_CreateResponse.xsd” is response schema but it is NOT. Every response using CRM adapter follows a fix and common schema and this schema is not generated. You can find this schema @ “C:\Program Files\BizTalkAdapter\Schemas\Response.xsd” depending upon adapter installation location. You have to include this Response.xsd in project.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l3 level1 lfo2"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">We are now all set to implement logic. Create two messages of type request and response schemas. Hook these messages to a static solicit-response send logical port using send and receive shape. Use map (with transform shape) or message assignment shapes to create request xml and send it via solicit-response port. When response comes consume it as per requirement. I am leaving this logic development part to readers. If you face any issue, please refer sample application attached with this article or feel free to message me.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l3 level1 lfo2"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">When creating xml request (using map or message assignment), take care of following things. Set “crm_action” attribute value to “create”. We are doing this because we are performing create operation on CRM system. Set values for all the contact attributes discussed above. Please do not forget to set value for “lastname” attribute because it is required attribute. In attached sample, I have used another XML schema in map to prepare request XML. This same XML schema based message is copied at a file based receive location to kick start sample orchestration. I have implemented in crude way to keep things simple but you can have implementation as per your requirement.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Note: </SPAN></B><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Few words about setting “crm_action” attribute. When performing create operation, it is always safe and good to provide “create” as value in “crm_action” attribute. However, if “crm_action” value is not provided then it uses following logic to take decision –<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt 1.25in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; TEXT-ALIGN: justify; mso-list: l4 level1 lfo9"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"><SPAN style="mso-list: Ignore">o<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">If the primary key node of the entity (in this case contactid) is not present in the XML or if the node has an empty value, the adapter assumes this is a “create” action.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt 1.25in; LINE-HEIGHT: normal; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt 1.25in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; TEXT-ALIGN: justify; mso-list: l4 level1 lfo9"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Courier New'"><SPAN style="mso-list: Ignore">o<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">If the primary key node of the entity has a correct GUID value, the adapter assumes the action to be “update”.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l1 level1 lfo3"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">When you are done with coding, compile project and deploy it. After deployment, bind solicit-response orchestration ports with physical solicit-response port (“CRMSendPort”) created in above steps. Enlist and start orchestration. Finally trigger orchestration to test query operation.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l1 level1 lfo3"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">You will find that response message comes in following format –<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">&lt;?xml version="1.0" encoding="utf-8" ?&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">&lt;ns0:Response xmlns:ns0="https://schemas.microsoft.com/crm/BizTalkAdapter/Response"&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">&lt;Header&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&lt;ReturnCode&gt;1&lt;/ReturnCode&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&lt;ErrorCode /&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&lt;ErrorString /&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&lt;Retryable /&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">&lt;/Header&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">&lt;Body&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&lt;Message&gt;&lt;prefix:CreateResponse xmlns:prefix="https://localhost/schemas.microsoft.com/crm/2006/CreateResponse"&gt;&lt;id&gt;84bc5a78-22c6-4cc9-88e6-3043c558bf37&lt;/id&gt;&lt;/prefix:CreateResponse&gt;&lt;/Message&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">&lt;/Body&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">&lt;/ns0:Response&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">“Message” element contains response (xml format) and it follows schema type “Create_CreateResponse.xsd”. You will find that response XML contains internal id (primary key) of created contact entity instance. You need to employ some parsing technique to fetch id out of response xml.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Rest of the return message contains error handling mechanism which can be used as required.<o:p></o:p></SPAN></P>
<P class=MsoListParagraph style="MARGIN: 0in 0in 10pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-add-space: auto; mso-list: l1 level1 lfo3"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">That’s it.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Conclusion<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">We have seen query and create operation in part 1 and 2 of the article. I am going to take complex scenario of create operation in next article. If required, please download sample project attached with article for further reference. If you face any issue please feel free to ping me on this article. Hope article was useful to you and your comments are always welcome.<o:p></o:p></SPAN></P>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/02/98/92/63/CreateContactOrch.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-02-98-92-63/CreateContactOrch.zip">CreateContactOrch.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Using Microsoft BizTalk Dynamics CRM Adapter – Part 1</title>
      <link>https://docs.microsoft.com/archive/blogs/brajens/using-microsoft-biztalk-dynamics-crm-adapter-part-1</link>
      <pubDate>Sun, 27 May 2007 08:14:00 GMT</pubDate>
      <dc:creator><![CDATA[brajens]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brajens/2007/05/27/using-microsoft-biztalk-dynamics-crm-adapter-part-1/</guid>
      <description><![CDATA[Recently, I have been working on an integration project where few exiting systems were getting...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Recently, I have been working on an integration project where few exiting systems were getting integrated with Microsoft CRM System 3.0. We architected to use BizTalk CRM adapter to synchronize and integrate data with CRM system. We could not locate a good documentation about adapter usage. We had to do lots of research, hit-&amp;-try POCs to understand CRM adapter usage. And this encouraged me to come up with set of articles which can facilities developers to understand and use adapter easy and fast.<BR>I am thinking to cover some basic operations with BizTalk CRM adapter such Query Data, Create Data, Update Data, Delete Data, Execute Operations, Retrieve Data etc. I will also cover dealing with complex data types (Pick List, Lookup) and custom entities/attributes.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I am expecting reader to have basic understanding of schemas, maps, orchestration, ports and adapters.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">How to Install BizTalk CRM Adapter<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Adapter installation is simple. You can download installation bits and usage guide from </SPAN><A href="https://www.microsoft.com/downloads/details.aspx?FamilyID=4628fca6-388d-45bc-a154-453b920dbcb8&amp;displaylang=en" mce_href="https://www.microsoft.com/downloads/details.aspx?FamilyID=4628fca6-388d-45bc-a154-453b920dbcb8&amp;displaylang=en"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">https://www.microsoft.com/downloads/details.aspx?FamilyID=4628fca6-388d-45bc-a154-453b920dbcb8&amp;displaylang=en</SPAN></A><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Following are key points of installation and usage guide –<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">1.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Installation is simple and setup based.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">2.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">CRM system uses AD based security schema. BizTalk uses send or solicit-response ports with CRM adapter to talk to CRM system. BizTalk ports run under host. If your BizTalk host service account does not have adequate access on CRM system then you are required to create another host with account which has sufficient access permission on CRM system. And then you construct a new CRM send handler which runs under new host and then configure CRM related ports to run new CRM send handler.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">3.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Installation guide also talks about creating port and generating schema which I will also cover in coming sections.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">4.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I recommend readers to install CRM SDK which holds good quantity of code samples and information. You can find SDK @ </SPAN><A href="https://www.microsoft.com/downloads/details.aspx?familyid=9C178B68-3A06-4898-BC83-BD14B74308C5&amp;displaylang=en" mce_href="https://www.microsoft.com/downloads/details.aspx?familyid=9C178B68-3A06-4898-BC83-BD14B74308C5&amp;displaylang=en"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">https://www.microsoft.com/downloads/details.aspx?familyid=9C178B68-3A06-4898-BC83-BD14B74308C5&amp;displaylang=en</SPAN></A><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">. <o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l2 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">5.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">It is useful to take look at overall installation and usage document. Especially known issues section.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Basics of CRM System<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Before we chat about using CRM adapter, we will cover some nuts and bolts which are essential for any BizTalk developer to work with CRM. CRM application can be access using following URL (though it depends on configuration of CRM site) - </SPAN><SPAN style="mso-field-code: HYPERLINK"><SPAN class=MsoHyperlink><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><U><FONT color=#0000ff>https://&lt;CRM-Sever&gt;/loader.aspx</FONT></U></SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">You will find that CRM system is divided into multiple sub-systems such Sales, Marketing, Service etc. With extension of CRM GP, accounting sub-systems also come in picture. Each of these sub-systems maintains a range of information like “Service” sub-system maintains Cases (customer escalations), Accounts, Contacts, Products etc. <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">In technical vocabulary, information is hold by various entities like we have one entity each for case, account, contact etc. These entities generally hold association/relationship among themselves. For example one account can have multiple contacts, one contact can have more than one case, there is many-to-many relationship between accounts and products etc.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Each of these entities follows a schema. Schema defines attributes hold by these entities and their type information. For example contact has Last Name (string), First Name (string), Gender (Pick List) etc as attributes. If you require then you can also create new custom entities or new custom attributes. When working with CRM system, we generally deal with these entities and their attributes. We create, update or delete instances of these entities.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Before we start integration with CRM system we need to understand entities, their schema, relationship with other entities etc. You can go to <B style="mso-bidi-font-weight: normal">“Settings &gt;&gt; Customization &gt;&gt; Customize Entities”</B> to see list of entities available in CRM system. List shows name, schema name, type and description. Here you will find option to create new custom entity or modify existing entity. <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">If you open (double-click) any existing entity, it will show you details of it. You will see details of attributes, forms/views to populate these entities in CRM system, relationship with other entities etc. When you check “Attributes” of entity, you will see attribute schema name, display name, type and description. Attribute schema name and type is very important information because BizTalk CRM adapter generates schema based on schema name and type information inside CRM system. You will also find provision to create new custom attributes.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">CRM sub systems, forms, entities, schemas and customization are self explanatory. I suggest readers to spend some time with it; play around and get comfort.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">It is time to get into coding now.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">How to perform Query Data with CRM Adapter<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Dynamics CRM provides a web service which can be used by developers to do operations against CRM system. CRM Adapter internally uses this web service for operations. Generally, you will find web service URL as – <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="mso-field-code: HYPERLINK"><SPAN class=MsoHyperlink><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><U><FONT color=#0000ff>https://&lt;CRM-Server&gt;/MSCRMServices/2006/CrmService.asmx</FONT></U></SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">. <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Without documentation, it was hard for me to perform POCs with BizTalk CRM adapter. To make my job simpler, I played around with Dynamics CRM web service to manipulate entities. And this gave me adequate idea when dealing with generated CRM schemas in BizTalk. I am planning to follow same trick in these articles also - .Net code first and then BizTalk implementation.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">We are going to see how query can be performed against CRM system. I am going to query case details using case guid. Case is complaints or service requests registered by customers and it comes under “Service” sub-system.<o:p></o:p></SPAN></P>
<P class=MsoListParagraph style="MARGIN: 0in 0in 10pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l3 level1 lfo2; mso-add-space: auto"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">1.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Perform Query using .net code (calling CRM web service)<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I added CRM web service as web reference and named it “CRMServer”. Following is code to query case using case guid.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>CRMServer.CrmService service = new CRMWSTest.CRMServer.CrmService();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>service.Credentials = System.Net.CredentialCache.DefaultCredentials;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>string fetchXml = @"&lt;fetch mapping=""logical""&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>&lt;entity name=""incident""&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;attribute name=""ticketnumber""/&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;attribute name=""title""/&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;filter type=""and""&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;condition attribute=""incidentid"" operator=""eq"" value=""7c89ec34-6828-410b-9718-185b5a39a8ba""/&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>&lt;/filter&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/entity&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>&lt;/fetch&gt;";<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>string result = service.Fetch(fetchXml);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Code is easy to understand. I first created an instance of CRM web service client and then create query (fetch) XML. Fetch xml is straightforward to understand. <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&lt;entity name=""incident""&gt;<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Means entity which I wish to query is “incident”. Well, case is the display name and schema name for case is “incident”. You can find this in customization section as mentioned in previous section. <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">&lt;attribute name=""ticketnumber""/&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>&lt;attribute name=""title""/&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">I am querying “Case Number” and “Title” attributes of case. Schema name of these two attributes are “ticketnumber” and “title”. You can add more attributes as required.<BR style="mso-special-character: line-break"><BR style="mso-special-character: line-break"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>&lt;filter type=""and""&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;condition attribute=""incidentid"" operator=""eq"" value=""7c89ec34-6828-410b-9718-185b5a39a8ba""/&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">&lt;/filter&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">This is filter condition to query. Type is “and” as logical operator. It can also accept “or”. “attribute” is entity attribute which we are using for query. Again this is schema name not display name. “operator” is assignment operator and it can accept values as “lt” (less than), “gt” (greater than), “le” (less than or equal), “ge” (greater than or equal), “eq” (equal), “ne” (not equal), etc. Finally “value” holds value of attribute to be queried. If required, you can use more attributes with “and/or” options. I suggest readers to refer CRM SDK for more details about fetch xml.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Finally we call “Fetch” method passing “fetchXml” as parameter.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Query result comes in following format.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">&lt;resultset morerecords="0" paging-cookie="$1$$incident$incidentid$1$0$38${7C89EC34-6828-410B-9718-185B5A39A8BA}$!$incident$incidentid$1$0$38${7C89EC34-6828-410B-9718-185B5A39A8BA}$"&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&lt;result&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>&lt;ticketnumber&gt;CAS-01006-ZBEJ0W&lt;/ticketnumber&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>&lt;title&gt;This is test case1&lt;/title&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&lt;/result&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">&lt;/resultset&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Result is self illustrative. You can see ticket number and title returned for query.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraph style="MARGIN: 0in 0in 10pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l3 level1 lfo2; mso-add-space: auto"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: Verdana; mso-bidi-font-family: Verdana"><SPAN style="mso-list: Ignore">2.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Perform Query BizTalk code (using Dynamics CRM Adapter)<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Above was query implementation in .net code. Now we are going to implement same logic in BizTalk orchestration. Following are the steps to perform same query operation in orchestration using BizTalk Dynamics CRM adapter.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level1 lfo3; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">In query we send Fetch XML and return result. We need solicit-response send port for this purpose. Create a new static solicit-response send port in BizTalk Administration Console. Give a name to it (say “CRMSendPort”) and select type as “Microsoft Dynamics CRM”. Go to “Configure” and put “Web Service URL” as </SPAN><SPAN style="mso-field-code: HYPERLINK"><SPAN class=MsoHyperlink><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><U><FONT color=#0000ff>https://&lt;CRM-Server&gt;/mscrmservices/2006</FONT></U></SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">. <o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">In send handler, select send handler created as per CRM specific host in above section. Configure “Send Pipeline” as “Xml Transmit” and “Receive Pipeline” as “Xml Receive”. Save and close things.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><B style="mso-bidi-font-weight: normal"><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Note: </SPAN></I></B><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">One of the common mistakes committed by developers is to put complete web service URL (</SPAN></I><SPAN style="mso-field-code: HYPERLINK"><SPAN class=MsoHyperlink><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><U><FONT color=#0000ff>https://&lt;CRM-Server&gt;/MSCRMServices/2006/CrmService.asmx</FONT></U></SPAN></I></SPAN></SPAN><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">) in configuration. This generates error during schema generation. Reason is that CRM adapter uses “Metadata.asmx” to generate schema and it just need URL of CRM web service virtual directory.<o:p></o:p></SPAN></I></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level1 lfo3; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Create a BizTalk project and assign a strong name key to it.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level1 lfo3; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">We have to generate schema for query operation. Right click Project Name &gt;&gt; Select Add Menu &gt;&gt; Select Add Generated Items Menu&gt;&gt; Select Add Adapter Metadata Option&gt;&gt; Press Add Button &gt;&gt; Select Microsoft Dynamics CRM Option&gt;&gt; Select Port (same port created in above steps say “CRMSendPort”) &gt;&gt; Press Next Button. “Microsoft Dynamics CRM User Credentials” screen opens up. Enter user name and password for CRM system. Remember this user name and password should have adequate access to fetch entity and their schema information from CRM system. Press Ok button after entering credentials. <o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level1 lfo3; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">“Microsoft Dynamics CRM Actions and Entities” screen opens up. As we already discussed, CRM sub-systems are made of entities. At this point we select entity (account, contact, case etc.) which we want to deal with and action (add, update, delete, execute etc.) which we want to perform on selected entity. Since we want to perform query on cases (incidents), select “ExecuteFetch” as action and “Incident” as entity. If required, in some implementation, you can also select multiple actions and multiple entities. When selection is done, press next button. It would take few seconds to generate all schemas related to fetch operation in BizTalk project.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level1 lfo3; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">In generated artifacts, it generates lots of schema and one BizTalk orchestration file. Open orchestration file and delete all port types and multi-part message types generated by default. Well, these are useful but I am asking to clean them so that we can create and understand things from scratch.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level1 lfo3; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">It generates some 10 schemas in project. These schemas contain type definition and are included in each other. We are interested in two schemas only – one request schema which can send our query/fetch XML and one response schema which can pull result back.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level1 lfo3; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">“ExecuteFetch_ExecuteFetchRequest.xsd” serves purpose of request schema. You expand to see details of this schema. It has two important elements – “crm_action” and “FetchXml”. We will check these in details in few seconds.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level1 lfo3; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Now response is tricky part. Developers think that “ExecuteFetch_ExecuteFetchResponse.xsd” is response schema but it is NOT. Every response using CRM adapter follows a fix and common schema and this schema is not generated. You can find this schema @ “C:\Program Files\BizTalkAdapter\Schemas\Response.xsd” depending upon adapter installation location. You have to include this Response.xsd in project.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level1 lfo3; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">We are now all set to implement logic. Create two messages of type request and response schemas. Hook these messages to a static solicit-response send logical port using send and receive shape. Use map (with transform shape) or message assignment shapes to create request xml and send it via solicit-response port. When response comes consume as per requirement. I am leaving this logic development part to readers. If you face any issue, please refer sample application attached with this article or feel free to message me.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l1 level1 lfo3; mso-add-space: auto"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">When creating xml request (using map or message assignment), take care of following things. Set “crm_action” attribute value to “execute”. We are doing this because we are executing fetch operation on CRM system. Other possible values are “create”, “update” and “delete”. We will see use of this in coming articles. Set “FetchXml” element value to - </SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">"&lt;fetch mapping='logical'&gt;&lt;entity name='incident'&gt;&lt;attribute name='ticketnumber'/&gt;&lt;attribute name='title'/&gt;&lt;filter type='and'&gt;&lt;condition attribute='incidentid' operator='eq' value='7c89ec34-6828-410b-9718-185b5a39a8ba'/&gt;&lt;/filter&gt;&lt;/entity&gt;&lt;/fetch&gt;"<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Remember this is same format which we used in previous .net code sample. In attached sample, I used script functoids in map to prepare request XML. I have implemented in crude way to keep things simple but you can do better and smart job.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l0 level1 lfo4; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">When you are done with coding, compile project and deploy it. After deployment, bind solicit-response orchestration ports with physical solicit-response port (“CRMSendPort”) created in above steps. Enlist and start orchestration. Finally trigger orchestration to test query operation.<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-ALIGN: justify; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l0 level1 lfo4; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">You will find that response message comes in following format –<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">&lt;ns0:Response xmlns:ns0="https://schemas.microsoft.com/crm/BizTalkAdapter/Response"&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&lt;Header&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&lt;ReturnCode&gt;1&lt;/ReturnCode&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&lt;ErrorCode /&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&lt;ErrorString /&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&lt;Retryable /&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&lt;/Header&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">&lt;Body&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&lt;Message&gt;&lt;prefix:ExecuteFetchResponse xmlns:prefix="https://localhost/schemas.microsoft.com/crm/2006/ExecuteFetchResponse"&gt;&lt;FetchXmlResult&gt;&amp;lt;resultset morerecords='0' paging-cookie='$1$$incident$incidentid$1$0$38${7C89EC34-6828-410B-9718-185B5A39A8BA}$!$incident$incidentid$1$0$38${7C89EC34-6828-410B-9718-185B5A39A8BA}$'&amp;gt;&amp;lt;result&amp;gt;&amp;lt;ticketnumber&amp;gt;CAS-01006-ZBEJ0W&amp;lt;/ticketnumber&amp;gt;&amp;lt;title&amp;gt;This is test case1&amp;lt;/title&amp;gt;&amp;lt;/result&amp;gt;&amp;lt;/resultset&amp;gt;&lt;/FetchXmlResult&gt;&lt;/prefix:ExecuteFetchResponse&gt;&lt;/Message&gt; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">&lt;/Body&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><SPAN style="FONT-SIZE: 8pt; COLOR: #548dd4; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-themecolor: text2; mso-themetint: 153">&lt;/ns0:Response&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">“Message” element contains response (xml format) and it follows schema type ExecuteFetch_ExecuteFetchResponse.xsd. You need to employ some parsing technique to fetch information out of response xml.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Rest of the return message contains error handling mechanism which can be used as required.<o:p></o:p></SPAN></P>
<P class=MsoListParagraph style="MARGIN: 0in 0in 10pt 0.25in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l0 level1 lfo4; mso-add-space: auto"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"><SPAN style="mso-list: Ignore">·<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">That’s it. Make tweaks in request message and orchestration logic to explore query/fetch option thoroughly.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Conclusion<o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">This was a high level walk through and a sample to query CRM system for entities. If required, please download sample project attached with article for further reference. If you face any issue please feel free to ping me on this article. Hope article was useful to you and your comments are always welcome. <BR>Please wait for some time before we meet again with next part of it.</SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>Next Part URL - <A href="https://blogs.msdn.com/brajens/archive/2007/05/30/using-microsoft-biztalk-dynamics-crm-adapter-part-2.aspx">https://blogs.msdn.com/brajens/archive/2007/05/30/using-microsoft-biztalk-dynamics-crm-adapter-part-2.aspx</A></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p></o:p></SPAN>&nbsp;</P>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/02/91/78/70/QueryIncidentOrch.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-02-91-78-70/QueryIncidentOrch.zip">QueryIncidentOrch.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Accessing Description / Metadata (WSDL) of WCF Web Service</title>
      <link>https://docs.microsoft.com/archive/blogs/brajens/accessing-description-metadata-wsdl-of-wcf-web-service</link>
      <pubDate>Thu, 26 Apr 2007 07:02:00 GMT</pubDate>
      <dc:creator><![CDATA[brajens]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brajens/2007/04/26/accessing-description-metadata-wsdl-of-wcf-web-service/</guid>
      <description><![CDATA[WSDL or service metadata is the core for accessing or using any web service. In ASMX web service,...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">WSDL or service metadata is the core for accessing or using any web service. In ASMX web service, browsing WSDL is straight forward. You develop a web service, host inside IIS and then simply browse ASMX file to view WSDL. But things are not the same with WCF service. If you try to access WCF service endpoint it says – <B style="mso-bidi-font-weight: normal">“Metadata publishing for this service is currently disabled”.</B> This is a common issue encountered by most of the beginners in WCF development. This results into confusion that there is something wrong with coding of WCF service while it is not true in most of the cases. So what is the reason for this message?<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">As a part of WCF security schema, by default no web service is allowed to share their description or Metadata unless they are configured to do so. You develop your service, test it and finally publish to production. But publishing web service to production will not enable service to be accessible unless service is configured to exchange its metadata. This is default security configuration of WCF service which blocks WSDL to be shared with users/developers.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">How to make WSDL visible? This is very simple and can be achieved in following few steps.<o:p></o:p></SPAN></P>
<P class=MsoListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l0 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana"><SPAN style="mso-list: Ignore">1.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">WCF web service talks using end points. End point contains access address, binding and exposed contract. WCF provides out of box contract (<SPAN style="COLOR: blue">IMetadataExchange</SPAN>) and binding (<SPAN style="COLOR: blue">mexHttpBinding) </SPAN>to expose metadata of developed WCF web service. We just need to add this end point into service definition. Example: <SPAN style="mso-spacerun: yes">&nbsp;</SPAN><o:p></o:p></SPAN></P>
<DIV style="BORDER-RIGHT: #f0f0e0 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: #f0f0e0 1pt solid; PADDING-LEFT: 0in; BACKGROUND: #e5e5cc; PADDING-BOTTOM: 4pt; MARGIN-LEFT: 0.5in; BORDER-LEFT: #f0f0e0 1pt solid; MARGIN-RIGHT: 0in; PADDING-TOP: 4pt; BORDER-BOTTOM: #f0f0e0 1pt solid; mso-border-alt: solid #F0F0E0 .75pt; mso-element: para-border-div"><PRE style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; BACKGROUND: #e5e5cc; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-border-alt: solid #F0F0E0 .75pt; mso-padding-alt: 4.0pt 4.0pt 4.0pt 0in"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: darkred; FONT-FAMILY: 'Verdana','sans-serif'">service </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: 'Verdana','sans-serif'">name</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">=</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">"</SPAN><I><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">MyNamespace.MyServiceType</SPAN></I><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">"</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">&gt;<o:p></o:p></SPAN></PRE><PRE style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; BACKGROUND: #e5e5cc; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-border-alt: solid #F0F0E0 .75pt; mso-padding-alt: 4.0pt 4.0pt 4.0pt 0in"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>&lt;!-- Your service end points --&gt;<o:p></o:p></SPAN></PRE><PRE style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; BACKGROUND: #e5e5cc; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-border-alt: solid #F0F0E0 .75pt; mso-padding-alt: 4.0pt 4.0pt 4.0pt 0in"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: darkred; FONT-FAMILY: 'Verdana','sans-serif'">endpoint </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: 'Verdana','sans-serif'">contract</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">=</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">"</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">IMetadataExchange</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">" </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: 'Verdana','sans-serif'">binding</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">=</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">"</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">mexHttpBinding</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">" </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: 'Verdana','sans-serif'">address</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">=</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">"</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">mex</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">"</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">/&gt;<o:p></o:p></SPAN></PRE><PRE style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; BACKGROUND: #e5e5cc; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-border-alt: solid #F0F0E0 .75pt; mso-padding-alt: 4.0pt 4.0pt 4.0pt 0in"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">&lt;/</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: darkred; FONT-FAMILY: 'Verdana','sans-serif'">service</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">&gt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'"><o:p></o:p></SPAN></PRE></DIV>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify; mso-list: l0 level1 lfo1"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana"><SPAN style="mso-list: Ignore">2.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">WCF is a great example of decoupled extensibility. You can define services behavior separately then apply them to your services as required. Allowing metadata/WSDL exchange is one the service behavior (<SPAN style="COLOR: darkred">serviceMetadata)</SPAN> in WCF. We need to add this service behavior to services which further instructs or say allows services to expose their WSDL –<o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">First Add service behavior –<o:p></o:p></SPAN></P>
<DIV style="BORDER-RIGHT: #f0f0e0 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: #f0f0e0 1pt solid; PADDING-LEFT: 4pt; BACKGROUND: #e5e5cc; PADDING-BOTTOM: 4pt; MARGIN-LEFT: 0.5in; BORDER-LEFT: #f0f0e0 1pt solid; MARGIN-RIGHT: 0in; PADDING-TOP: 4pt; BORDER-BOTTOM: #f0f0e0 1pt solid; mso-border-alt: solid #F0F0E0 .75pt; mso-element: para-border-div"><PRE style="BACKGROUND: #e5e5cc; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: darkred; FONT-FAMILY: 'Verdana','sans-serif'">behaviors</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">&gt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'"><o:p></o:p></SPAN></PRE><PRE style="BACKGROUND: #e5e5cc; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: darkred; FONT-FAMILY: 'Verdana','sans-serif'">serviceBehaviors</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">&gt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'"><o:p></o:p></SPAN></PRE><PRE style="BACKGROUND: #e5e5cc; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: darkred; FONT-FAMILY: 'Verdana','sans-serif'">behavior </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: 'Verdana','sans-serif'">name</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">=</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">"</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">MyServiceTypeBehaviors</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">" </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">&gt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'"><o:p></o:p></SPAN></PRE><PRE style="BACKGROUND: #e5e5cc; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: darkred; FONT-FAMILY: 'Verdana','sans-serif'">serviceMetadata </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: 'Verdana','sans-serif'">httpGetEnabled</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">=</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">"</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">true</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">" </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">/&gt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'"><o:p></o:p></SPAN></PRE><PRE style="BACKGROUND: #e5e5cc; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: darkred; FONT-FAMILY: 'Verdana','sans-serif'">/behavior</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">&gt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'"><o:p></o:p></SPAN></PRE><PRE style="BACKGROUND: #e5e5cc; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: darkred; FONT-FAMILY: 'Verdana','sans-serif'">/serviceBehaviors</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">&gt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'"><o:p></o:p></SPAN></PRE><PRE style="BACKGROUND: #e5e5cc; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: darkred; FONT-FAMILY: 'Verdana','sans-serif'">/behaviors</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">&gt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'"><o:p></o:p></SPAN></PRE></DIV>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">If your service is exposed at https then you configure the same using “</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: red; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">httpsGetEnabled”.</SPAN><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p></o:p></SPAN></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Finally enable service behavior in configured service <o:p></o:p></SPAN></P>
<DIV style="BORDER-RIGHT: #f0f0e0 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: #f0f0e0 1pt solid; PADDING-LEFT: 0in; BACKGROUND: #e5e5cc; PADDING-BOTTOM: 4pt; MARGIN-LEFT: 0.5in; BORDER-LEFT: #f0f0e0 1pt solid; MARGIN-RIGHT: 0in; PADDING-TOP: 4pt; BORDER-BOTTOM: #f0f0e0 1pt solid; mso-border-alt: solid #F0F0E0 .75pt; mso-element: para-border-div"><PRE style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; BACKGROUND: #e5e5cc; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-border-alt: solid #F0F0E0 .75pt; mso-padding-alt: 4.0pt 4.0pt 4.0pt 0in"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: darkred; FONT-FAMILY: 'Verdana','sans-serif'">service </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: 'Verdana','sans-serif'">name</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">=</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">"</SPAN><I><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">MyNamespace.MyServiceType</SPAN></I><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">" </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: 'Verdana','sans-serif'">behaviorConfiguration</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">=</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">"</SPAN><I><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">MyServiceTypeBehaviors</SPAN></I><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">" </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">&gt;<o:p></o:p></SPAN></PRE><PRE style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; BACKGROUND: #e5e5cc; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-border-alt: solid #F0F0E0 .75pt; mso-padding-alt: 4.0pt 4.0pt 4.0pt 0in"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"> &lt;!-- Your service end points --&gt;<o:p></o:p></SPAN></PRE><PRE style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; BACKGROUND: #e5e5cc; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-border-alt: solid #F0F0E0 .75pt; mso-padding-alt: 4.0pt 4.0pt 4.0pt 0in"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: darkred; FONT-FAMILY: 'Verdana','sans-serif'">endpoint </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: 'Verdana','sans-serif'">contract</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">=</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">"</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">IMetadataExchange</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">" </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: 'Verdana','sans-serif'">binding</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">=</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">"</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">mexHttpBinding</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">" </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: 'Verdana','sans-serif'">address</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">=</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">"</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">mex</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'">"</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">/&gt;<o:p></o:p></SPAN></PRE><PRE style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; BACKGROUND: #e5e5cc; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-border-alt: solid #F0F0E0 .75pt; mso-padding-alt: 4.0pt 4.0pt 4.0pt 0in"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">&lt;/</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: darkred; FONT-FAMILY: 'Verdana','sans-serif'">service</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">&gt;<o:p></o:p></SPAN></PRE></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">That’s it. These simple steps enable your services to start exchanging their description. This also provides a handy way to take WSDL visibility offline as required. Thanks for reading!<o:p></o:p></SPAN></P>]]></content:encoded>
    </item>
    <item>
      <title>Exception Handling in WCF Web Service</title>
      <link>https://docs.microsoft.com/archive/blogs/brajens/exception-handling-in-wcf-web-service</link>
      <pubDate>Mon, 23 Apr 2007 06:04:00 GMT</pubDate>
      <dc:creator><![CDATA[brajens]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brajens/2007/04/23/exception-handling-in-wcf-web-service/</guid>
      <description><![CDATA[Exception handling in ASMX web services was a painful job. Information was getting lost over wire /...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">Exception handling in ASMX web services was a painful job. Information was getting lost over wire / serialization; it was tricky to get fault code back and having a strongly type mapping between service raised exception and client consumed exception was a cumbersome task.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">But things are not the same with windows communication foundation (WCF) service. In WCF, you can define a custom fault exception, get it populated and raised at service side as per error/exception and then nicely consume the same at client side. I am going to cover exception handling aspects of WCF service in this blog using an example.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">In WCF development, exception handling method is very simple and it uses concept of contract definition. Just like data and service contract, you can also define fault contract and add behavior to it in service behavior. Let’s start with following example,<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">First define a data contract which you want to use to capture service side fault/exception,<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">[<SPAN style="COLOR: teal">DataContract</SPAN>]<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">public</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">enum</SPAN> <SPAN style="COLOR: teal">FaultCode<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>[<SPAN style="COLOR: teal">EnumMember</SPAN>]<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>ERROR,<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>[<SPAN style="COLOR: teal">EnumMember</SPAN>]<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>INCORRECT_PARAMETER<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">[<SPAN style="COLOR: teal">DataContract</SPAN>]<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">public</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">class</SPAN> <SPAN style="COLOR: teal">SampleFaultException<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>[<SPAN style="COLOR: teal">DataMember</SPAN>]<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: teal">FaultCode</SPAN> errorcode;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>[<SPAN style="COLOR: teal">DataMember</SPAN>]<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: blue">string</SPAN> message;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>[<SPAN style="COLOR: teal">DataMember</SPAN>]<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: blue">string</SPAN> details;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">I have defined a data contract <SPAN style="COLOR: teal">SampleFaultException </SPAN>which contains three data members “errorcode”, “message” and “details”. “errorcode” is of type <SPAN style="COLOR: teal">FaultCode </SPAN>which is an enum containing<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>two members “ERROR” and “INCORRECT_PARAMEMERTS”.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">Now define a service contract. I am using a simple service contract with one method only,<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">[<SPAN style="COLOR: teal">ServiceContract</SPAN>]<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">public</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">interface</SPAN> <SPAN style="COLOR: teal">ISampleService<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>[<SPAN style="COLOR: teal">OperationContract</SPAN>]<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>[<SPAN style="COLOR: teal">FaultContract</SPAN>(<SPAN style="COLOR: blue">typeof</SPAN>(<SPAN style="COLOR: teal">SampleFaultException</SPAN>))]<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">int</SPAN> DevideNumber(<SPAN style="COLOR: blue">int</SPAN> x,<SPAN style="COLOR: blue">int</SPAN> y);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'">You can see that </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: teal; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">FaultContract </SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">of type<SPAN style="COLOR: teal"> SampleFaultException </SPAN>is annotated in operation contract details. This means “DevideNumber” will handle appropriate faults/exceptions using <SPAN style="COLOR: teal">SampleFaultException. </SPAN>If you expect more types of faults to occur then you can define more fault contracts and place them in operation contract.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">Contract definitions are over. Let’s implement a service over them,<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">public</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">class</SPAN> <SPAN style="COLOR: teal">SampleService</SPAN> : <SPAN style="COLOR: teal">ISampleService<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: blue">int</SPAN> DevideNumber(<SPAN style="COLOR: blue">int</SPAN> x, <SPAN style="COLOR: blue">int</SPAN> y)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">try<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;</SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">if</SPAN> (y &gt; x)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: teal">SampleFaultException</SPAN> error = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: teal">SampleFaultException</SPAN>();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>error.errorcode = <SPAN style="COLOR: teal">FaultCode</SPAN>.INCORRECT_PARAMETER;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>error.message = <SPAN style="COLOR: maroon">"value of y can not be greater than x"</SPAN>;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>error.details = <SPAN style="COLOR: maroon">"trying to devide with bigger value"</SPAN>;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">throw</SPAN> <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: teal">FaultException</SPAN>&lt;<SPAN style="COLOR: teal">SampleFaultException</SPAN>&gt;(error);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">return</SPAN> x / y;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">catch</SPAN> (<SPAN style="COLOR: teal">DivideByZeroException</SPAN> dex)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: teal">SampleFaultException</SPAN> error = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: teal">SampleFaultException</SPAN>();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>error.errorcode = <SPAN style="COLOR: teal">FaultCode</SPAN>.ERROR;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>error.message = <SPAN style="COLOR: maroon">"zero value passed for parameter y"</SPAN>;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>error.details = dex.StackTrace;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">throw</SPAN> <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: teal">FaultException</SPAN>&lt;<SPAN style="COLOR: teal">SampleFaultException</SPAN>&gt;(error);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">catch</SPAN> (<SPAN style="COLOR: teal">Exception</SPAN> ex)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">throw</SPAN> ex;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">Implemention is quite simple. I am returing x/y in main flow. As part of exception handling logic, in one scenario, I am raising exception in try block as per parameter values. In other, I am casting <SPAN style="COLOR: teal">DivideByZeroException </SPAN>exception into fault contract type<SPAN style="COLOR: teal"> SampleFaultException.<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">Service is ready. Let’s host them in IIS. You can also do selft hosting, windows service based hosting or WPAS (also called WAS) based hosting. I created a virtual directory; and placed a “.svc” file and web.config files.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">Add service name in host “.svc” file –<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">&lt;</SPAN><A href="mailto:%25@ServiceHost%20Debug=%22true%22%20Service=%22WCFExceptionHandling.SampleService%22%20%25"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><FONT color=#0000ff>%@ServiceHost Debug="true" Service="WCFExceptionHandling.SampleService" %</FONT></SPAN></A><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">Add service defintion in web.config file –<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: maroon; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">system.serviceModel</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: maroon; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">behaviors</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: maroon; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">serviceBehaviors</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: maroon; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">behavior</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"> </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: red; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">name</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">=</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">"<SPAN style="COLOR: blue">Default</SPAN>"<SPAN style="COLOR: blue">&gt;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: maroon; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">serviceDebug</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"> </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: red; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">includeExceptionDetailInFaults</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">=</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">"<SPAN style="COLOR: blue">true</SPAN>"<SPAN style="COLOR: blue">/&gt;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: maroon; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">serviceMetadata</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: red; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">httpGetEnabled</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">=</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">"<SPAN style="COLOR: blue">true</SPAN>"<SPAN style="COLOR: blue">/&gt;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: maroon; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">behavior</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>&lt;/</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: maroon; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">serviceBehaviors</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">&lt;/</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: maroon; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">behaviors</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: maroon; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">services</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: maroon; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">service</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"> </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: red; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">behaviorConfiguration</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">=</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">"<SPAN style="COLOR: blue">Default</SPAN>"<SPAN style="COLOR: blue"> </SPAN><SPAN style="COLOR: red">name</SPAN><SPAN style="COLOR: blue">=</SPAN>"<SPAN style="COLOR: blue">WCFExceptionHandling.SampleService</SPAN>"<SPAN style="COLOR: blue">&gt;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: maroon; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">endpoint</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"> </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: red; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">address</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">=</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">""<SPAN style="COLOR: blue"> </SPAN><SPAN style="COLOR: red">binding</SPAN><SPAN style="COLOR: blue">=</SPAN>"<SPAN style="COLOR: blue">basicHttpBinding</SPAN>"<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: red; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">contract</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">=</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">"<SPAN style="COLOR: blue">WCFExceptionHandling.ISampleService</SPAN>"<SPAN style="COLOR: blue"> /&gt;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: maroon; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">endpoint</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"> </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: red; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">address</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">=</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">"<SPAN style="COLOR: blue">mex</SPAN>"<SPAN style="COLOR: blue"> </SPAN><SPAN style="COLOR: red">binding</SPAN><SPAN style="COLOR: blue">=</SPAN>"<SPAN style="COLOR: blue">mexHttpBinding</SPAN>"<SPAN style="COLOR: blue"> </SPAN><SPAN style="COLOR: red">contract</SPAN><SPAN style="COLOR: blue">=</SPAN>"<SPAN style="COLOR: blue">IMetadataExchange</SPAN>"<SPAN style="COLOR: blue"> /&gt;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>&lt;/</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: maroon; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">service</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>&lt;/</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: maroon; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">services</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">&lt;/</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: maroon; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">system.serviceModel</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">&gt;</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"> <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">“WCFExceptionHandling” </SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">is the namespace of the service I created.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">Finally I created a “bin” folder under virtual directory and added dlls containing contracts and services. I accessed URL (some thing like “https://localhost/&lt;virtualditectory&gt;/&lt;Service host file name&gt;.svc”) of hosted service to check if it is showing contract defintions through WSDL.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">Things which need attention here are service behaviours. “<SPAN style="COLOR: red">includeExceptionDetailInFaults” </SPAN>is instructing services to include exception details in faults.<SPAN style="COLOR: red"> “httpGetEnabled” </SPAN>allows services to expose their contract definition through WSDL. You have to enable both of these service behaviours explicitely which are by default flagged off due to security reason. By default WCF service does not reveal its information unless instructed to do so as done above.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">It is time to consume this service. I created a windows projects and added service reference for service URL created above. When creating service reference, I added alias name as “WCFService”. Finally I wrote following client code –<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="COLOR: blue">try<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-INDENT: 0.5in; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">WCFService.<SPAN style="COLOR: teal">SampleServiceClient</SPAN> client = <SPAN style="COLOR: blue">new</SPAN> WCFService.<SPAN style="COLOR: teal">SampleServiceClient</SPAN>();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-INDENT: 0.5in; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">int</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"> returnValue = client.DevideNumber(4, 2);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">catch</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"> (<SPAN style="COLOR: teal">FaultException</SPAN>&lt;WCFService.SampleFaultException&gt; faultEx)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: teal">MessageBox</SPAN>.Show(faultEx.Detail.errorcode);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: teal">MessageBox</SPAN>.Show(faultEx.Detail.message);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: teal">MessageBox</SPAN>.Show(faultEx.Detail.details);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">catch</SPAN><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"> (<SPAN style="COLOR: teal">Exception</SPAN> ex)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: teal">MessageBox</SPAN>.Show(ex.Message);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>} <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">You can see that I am creating an instance of service client and then making call to “DevideNumber” method. Interesting part of code is how “SampleFaultException” is handled. “faultEx.Detail” provides every details you captured at service side. I tested this service with 4 and 2 as parameters and it returned 2 (nothing great). When I passed 4,0 as parameters, it raised fault exception with faultEx.Detail.message = <SPAN style="COLOR: maroon">"zero value passed for parameter y"</SPAN>. And when I passed 4,6, it again raised fault exception with message = “<SPAN style="COLOR: maroon">value of y can not be greater than x". </SPAN>Interesting because I am able to capture every thing exactly the same as service raised in exception.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-ALIGN: justify"><SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes">As illustrated through example, You can capture and consume every bit of your exception with simple and extensible approach provided by WCF services. Hope this articles was helpful to understand expection handling methodology in WCF services.</SPAN></P>]]></content:encoded>
    </item>
  </channel>
</rss>