<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>WCF (Indigo)</title>
        <link>http://geekswithblogs.net/cicorias/category/6809.aspx</link>
        <description>WCF (Indigo)</description>
        <language>en-US</language>
        <copyright>Shawn Cicoria</copyright>
        <managingEditor>shawn@cicoria.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>Consuming WCF Services from COM using C++</title>
            <link>http://geekswithblogs.net/cicorias/archive/2007/08/28/Consuming-WCF-Services-from-COM-using-C.aspx</link>
            <description>&lt;p&gt;A little while back Martin sent me a question on some of the examples in Chapter 10 of our book (&lt;a href="http://www.apress.com/book/bookDisplay.html?bID=10185" target="_blank"&gt;Pro WCF&lt;/a&gt;).  The point of the question was how to dynamically consume a WCF services (late bind) from C++ using COM.&lt;/p&gt; &lt;p&gt;The root of the capability lies in the moniker implementation, which is provided for inside of System.ServiceModel.ComIntegration.  There's a series of types, attribute type as well, that the ServiceModel framework will build up the COM client along with the interfaces based upon a "GetObject" call from VB or even C++.&lt;/p&gt; &lt;p&gt;The thing with VB is it makes things so much easier.  So, I finally got around to fiddling with it.  I did end up with an issue, but the jist is easy to follow.  &lt;/p&gt; &lt;p&gt;The &lt;a href="http://www.cicoria.com/downloads/ComInteropCPP/CallingWcf.zip" target="_blank"&gt;source code link here&lt;/a&gt; has a couple of samples that dynamically call a COM interface - one using the "script" moniker which is for Windows Scripting Host Components (built a whole site based upon that years ago) and WCF.&lt;/p&gt; &lt;p&gt;Let's take a look at calling a Scripting Component using C++ COM.  Note that the CoGetObject is a call that combines 3 distinct calls into 1 convenient method.  Take a look at the attached sample wsc file to see the inners of the component.&lt;/p&gt; &lt;p&gt;The script moniker is the key.  Just as we'll see in a bit the service moniker.  Both are defined in the registy under HKCR\script and HKCR\service as to which COM component implements the moniker (IMoniker) interface.&lt;/p&gt; &lt;p&gt;The main steps are: 1) Initialize COM, 2) GetObject, 3) Get Dispatch Interface for method, 4) Invoke interface&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.cicoria.com/downloads/ComInteropCPP/CallingWcf.zip" target="_blank"&gt;Sample Solution&lt;/a&gt;&lt;/p&gt; &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;    1&lt;/span&gt; &lt;span style="color: blue"&gt;int&lt;/span&gt; CallWscComponent()&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;    2&lt;/span&gt; {&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;    3&lt;/span&gt;     HRESULT hr;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;    4&lt;/span&gt;     IDispatch* objWsc;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;    5&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;    6&lt;/span&gt;     hr = CoGetObject(L&lt;span style="color: #a31515"&gt;"script:D:\\Data\\Projects\\CallingWcf\\test.wsc"&lt;/span&gt;,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;    7&lt;/span&gt;         NULL,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;    8&lt;/span&gt;         IID_IDispatch,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;    9&lt;/span&gt;         (&lt;span style="color: blue"&gt;void&lt;/span&gt;**)&amp;amp;objWsc);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   10&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   11&lt;/span&gt;     &lt;span style="color: blue"&gt;if&lt;/span&gt; (FAILED(hr))&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   12&lt;/span&gt;     {&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   13&lt;/span&gt;         Message(TEXT(&lt;span style="color: #a31515"&gt;"Client: CoGetObject"&lt;/span&gt;), hr);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   14&lt;/span&gt;         &lt;span style="color: blue"&gt;return&lt;/span&gt;(hr);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   15&lt;/span&gt;     }&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   16&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   17&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   18&lt;/span&gt;     DISPID dispid;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   19&lt;/span&gt;     CString strFxName = &lt;span style="color: #a31515"&gt;"methodname"&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   20&lt;/span&gt;     OLECHAR * szMember2 = strFxName.AllocSysString();&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   21&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   22&lt;/span&gt;     hr = objWsc-&amp;gt;GetIDsOfNames(&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   23&lt;/span&gt;         IID_NULL,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   24&lt;/span&gt;         &amp;amp;szMember2,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   25&lt;/span&gt;         1,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   26&lt;/span&gt;         LOCALE_SYSTEM_DEFAULT,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   27&lt;/span&gt;         &amp;amp;dispid);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   28&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   29&lt;/span&gt;     &lt;span style="color: blue"&gt;if&lt;/span&gt; (FAILED(hr))&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   30&lt;/span&gt;     {&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   31&lt;/span&gt;         Message(TEXT(&lt;span style="color: #a31515"&gt;"Client: GetIDsOfNames"&lt;/span&gt;), hr);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   32&lt;/span&gt;         &lt;span style="color: blue"&gt;return&lt;/span&gt;(hr);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   33&lt;/span&gt;     }&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   34&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   35&lt;/span&gt;     DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   36&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   37&lt;/span&gt;     hr = objWsc-&amp;gt;Invoke(&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   38&lt;/span&gt;         dispid,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   39&lt;/span&gt;         IID_NULL,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   40&lt;/span&gt;         LOCALE_USER_DEFAULT,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   41&lt;/span&gt;         DISPATCH_METHOD,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   42&lt;/span&gt;         &amp;amp;dispparamsNoArgs, NULL, NULL, NULL);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   43&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   44&lt;/span&gt;     &lt;span style="color: blue"&gt;if&lt;/span&gt; (FAILED(hr))&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   45&lt;/span&gt;     {&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   46&lt;/span&gt;         Message(TEXT(&lt;span style="color: #a31515"&gt;"Client: Invoke"&lt;/span&gt;), hr);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   47&lt;/span&gt;         &lt;span style="color: blue"&gt;return&lt;/span&gt;(hr);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   48&lt;/span&gt;     }&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   49&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   50&lt;/span&gt; }&lt;/p&gt;&lt;/div&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Now, here's an example of using an untyped proxy and Mex discovery.&lt;/p&gt; &lt;p&gt;The first thing is to do is build the moniker:&lt;/p&gt; &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt; &lt;p style="margin: 0px"&gt;LPTSTR moniker = L&lt;span style="color: #a31515"&gt;"service:mexAddress=\"http://localhost:8899/WebService/Service.svc/mex\",\&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;                  address=\"http://localhost:8899/WebService/Service.svc\",\&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;                  contract=IMyService, \&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;                  contractNamespace=http://tempuri.org/,binding=BasicHttpBinding_IMyService, \&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #a31515"&gt;                  bindingNamespace=http://tempuri.org/"&lt;/span&gt;;&lt;/p&gt;&lt;/div&gt; &lt;p&gt;Now, here's a quick walk-through of calling WCF through COM. &lt;/p&gt; &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;    1&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; CallWcf()&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;    2&lt;/span&gt; {&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;    3&lt;/span&gt;     HRESULT hr;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;    4&lt;/span&gt;     IDispatch* objWsc;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;    5&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;    6&lt;/span&gt;     hr = CoGetObject(moniker,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;    7&lt;/span&gt;         NULL,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;    8&lt;/span&gt;         IID_IDispatch,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;    9&lt;/span&gt;         (&lt;span style="color: blue"&gt;void&lt;/span&gt;**)&amp;amp;objWsc);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   10&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   11&lt;/span&gt;     &lt;span style="color: blue"&gt;if&lt;/span&gt; (FAILED(hr))&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   12&lt;/span&gt;     {&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   13&lt;/span&gt;         Message(TEXT(&lt;span style="color: #a31515"&gt;"Client: CoGetObject"&lt;/span&gt;), hr);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   14&lt;/span&gt;         &lt;span style="color: blue"&gt;return&lt;/span&gt;(hr);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   15&lt;/span&gt;     }&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   16&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   17&lt;/span&gt;     DISPID dispid;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   18&lt;/span&gt;     CString strFxName = &lt;span style="color: #a31515"&gt;"MyOperation3"&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   19&lt;/span&gt;     OLECHAR * szMember2 = strFxName.AllocSysString();&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   20&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   21&lt;/span&gt;     hr = objWsc-&amp;gt;GetIDsOfNames(&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   22&lt;/span&gt;         IID_NULL,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   23&lt;/span&gt;         &amp;amp;szMember2,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   24&lt;/span&gt;         1,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   25&lt;/span&gt;         GetUserDefaultLCID(),&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   26&lt;/span&gt;         &amp;amp;dispid);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   27&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   28&lt;/span&gt;     &lt;span style="color: blue"&gt;if&lt;/span&gt; (FAILED(hr))&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   29&lt;/span&gt;     {&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   30&lt;/span&gt;         Message(TEXT(&lt;span style="color: #a31515"&gt;"Client: GetIDsOfNames"&lt;/span&gt;), hr);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   31&lt;/span&gt;         &lt;span style="color: blue"&gt;return&lt;/span&gt;(hr);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   32&lt;/span&gt;     }&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   33&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   34&lt;/span&gt;     DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   35&lt;/span&gt;     EXCEPINFO pExcepInfo;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   36&lt;/span&gt;     memset(&amp;amp;pExcepInfo, 0, &lt;span style="color: blue"&gt;sizeof&lt;/span&gt;(EXCEPINFO));&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   37&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   38&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   39&lt;/span&gt;     hr = objWsc-&amp;gt;Invoke(&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   40&lt;/span&gt;         dispid,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   41&lt;/span&gt;         IID_NULL,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   42&lt;/span&gt;         GetUserDefaultLCID(),&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   43&lt;/span&gt;         DISPATCH_METHOD,&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   44&lt;/span&gt;         &amp;amp;dispparamsNoArgs, NULL, NULL, NULL);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   45&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   46&lt;/span&gt;     &lt;span style="color: blue"&gt;if&lt;/span&gt; (FAILED(hr))&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   47&lt;/span&gt;     {&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   48&lt;/span&gt;         Message(TEXT(&lt;span style="color: #a31515"&gt;"Client: Invoke"&lt;/span&gt;), hr);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   49&lt;/span&gt;         &lt;span style="color: blue"&gt;return&lt;/span&gt;(hr);&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   50&lt;/span&gt;     }&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   51&lt;/span&gt; &lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;   52&lt;/span&gt; }&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115039"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115039" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/cicorias/aggbug/115039.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Shawn Cicoria</dc:creator>
            <guid>http://geekswithblogs.net/cicorias/archive/2007/08/28/Consuming-WCF-Services-from-COM-using-C.aspx</guid>
            <pubDate>Wed, 29 Aug 2007 01:28:50 GMT</pubDate>
            <comments>http://geekswithblogs.net/cicorias/archive/2007/08/28/Consuming-WCF-Services-from-COM-using-C.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/cicorias/comments/commentRss/115039.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/cicorias/services/trackbacks/115039.aspx</trackback:ping>
        </item>
        <item>
            <title>Additional Stuff on Integrating WCF Services with COM+</title>
            <link>http://geekswithblogs.net/cicorias/archive/2007/08/27/Additional-Stuff-on-Integrating-WCF-Services-with-COM.aspx</link>
            <description>&lt;p&gt;In my (along with Chris Peiris) MSDN article (&lt;a href="http://msdn2.microsoft.com/en-us/library/bb735856.aspx" target="_blank"&gt;Integrating WCF Services with COM+&lt;/a&gt;), there were a few things I wanted to change, but given the edit review cycle, I decided to wait until it was published and just blog about some additional concepts.  What follows are just a couple of extra pictures that give a view of how WCF ServiceModel.ComIntegration works in regards to calling COM+ Components from WCF Clients.&lt;/p&gt; &lt;p&gt;Let's take a little step back to COM+ and COM+ Applications.  There are 2 types of COM Applications - Library and Server.  The former is an inprocess hosting of your COM component; the latter is hosted in a server process, generally DllHost, which hosts your library along with controlling activation, recycling, etc.&lt;/p&gt; &lt;p&gt;Based upon the Application type, you have a different choices for hosting the COM+ component.  The implications of each choice impact both performance (additional marshalling), manageability, and accessibility from legacy clients.&lt;/p&gt; &lt;h3&gt;COM+ Library Package WCF Integration&lt;/h3&gt; &lt;p&gt;The following is a quick view of what's happening with Library Packages and hosting of COM+ Applications.&lt;/p&gt; &lt;p&gt;&lt;img height="167" src="http://www.cicoria.com/downloads/images/IISHostedInProcess.jpg" width="455" /&gt; &lt;/p&gt; &lt;p&gt;When you're running the COM+ Integration Wizard from SvcConfigEditor you'll be presented with a single choice as shown below. This translates into a ComSvcConfig switch of /hosting:complus.&lt;/p&gt; &lt;p&gt;&lt;img height="357" alt="" src="http://www.cicoria.com/downloads/images/COMIntegrationWizLib.JPG" width="436" /&gt;&lt;/p&gt; &lt;p&gt;What are the implications of this model? Well, it's inprocess so marshalling across process doesn't happen.  Although, all the ComIntegration parts of the framework kick in.  You also have message based activation (it's hosted in IIS/WAS) so there's isn't necessarily a server process running continously.&lt;/p&gt; &lt;h3&gt;COM+ Server Package - COM+ Hosted&lt;/h3&gt; &lt;p&gt;When you get to Server Applications, you have a couple of options.  &lt;/p&gt; &lt;p&gt;&lt;img height="357" alt="" src="http://www.cicoria.com/downloads/images/COMIntegrationWizSrv.JPG" width="436" /&gt;&lt;/p&gt; &lt;p&gt;The first is COM+ hosted.  This provides simultaneous access from DCOM and WCF clients.  You then control process lifetime through the COM+ configuration settings - such as run as an NT Service, etc.  You lose message based activation - You think about the process lifetime.&lt;/p&gt; &lt;p&gt;&lt;img height="185" alt="" src="http://www.cicoria.com/downloads/images/COMHostedServerPackage.jpg" width="479" /&gt;&lt;/p&gt; &lt;h3&gt;COM+ Server Package - IIS/WAS Hosted&lt;/h3&gt; &lt;p&gt;The last option is IIS/WAS hosted Server Application.  This is where you get both the advantage of DCOM &amp;amp; WCF access along with Message Based activation - but at the expense of making a cross process call between IIS/WAS and the Server Package process.&lt;/p&gt; &lt;p&gt;&lt;img height="179" alt="" src="http://www.cicoria.com/downloads/images/IISHostedServerPackage.jpg" width="467" /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115000"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115000" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/cicorias/aggbug/115000.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Shawn Cicoria</dc:creator>
            <guid>http://geekswithblogs.net/cicorias/archive/2007/08/27/Additional-Stuff-on-Integrating-WCF-Services-with-COM.aspx</guid>
            <pubDate>Mon, 27 Aug 2007 22:05:48 GMT</pubDate>
            <comments>http://geekswithblogs.net/cicorias/archive/2007/08/27/Additional-Stuff-on-Integrating-WCF-Services-with-COM.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/cicorias/comments/commentRss/115000.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/cicorias/services/trackbacks/115000.aspx</trackback:ping>
        </item>
        <item>
            <title>MSDN Article Finally Out - Integrating WCF Services with COM+</title>
            <link>http://geekswithblogs.net/cicorias/archive/2007/08/17/MSDN-Article-Finally-Out---Integrating-WCF-Services-with-COM.aspx</link>
            <description>&lt;p&gt;Well, an article, whose content was mostly taken from the &lt;a href="http://www.apress.com/book/bookDisplay.html?bID=10185" target="_blank"&gt;WCF Book&lt;/a&gt;, is finally published on MSDN.  It took quite a long time from "acceptance" to appearance.  I believe it was back in February 2007 that it was finalized from a content perspective.  Since then, I haven't heard much till today.&lt;/p&gt; &lt;p&gt;There were lots of updates that given the editing and review process, I held off on so it wouldn't be delayed.  I'll now take the time and publish up on my blog - mostly more information on the different hosting models, perspectives and some issues.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb735856.aspx" target="_blank"&gt;Integrating WCF Services with COM+&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114738"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114738" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/cicorias/aggbug/114738.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Shawn Cicoria</dc:creator>
            <guid>http://geekswithblogs.net/cicorias/archive/2007/08/17/MSDN-Article-Finally-Out---Integrating-WCF-Services-with-COM.aspx</guid>
            <pubDate>Fri, 17 Aug 2007 11:26:20 GMT</pubDate>
            <comments>http://geekswithblogs.net/cicorias/archive/2007/08/17/MSDN-Article-Finally-Out---Integrating-WCF-Services-with-COM.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/cicorias/comments/commentRss/114738.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/cicorias/services/trackbacks/114738.aspx</trackback:ping>
        </item>
        <item>
            <title>WCF LOB Adapter SDK - WCFLOBASDK - Lot's of words, but lot's of help...</title>
            <link>http://geekswithblogs.net/cicorias/archive/2007/08/13/WCF-LOB-Adapter-SDK---WCFLOBASDK---Lots-of-words.aspx</link>
            <description>&lt;p&gt;The BizTalk server team has released the &lt;a href="http://go.microsoft.com/fwlink/?LinkID=96184" target="_blank"&gt;aforementioned tool&lt;/a&gt; to facilitate the development of "Adapters" (not just BTS, but general WCF) for creation of WCF extensions to consume existing service interfaces.   Mostly, it facilities building well structured classes that meet the WCF extensions requirements.  Clearly, you still need to code up the actual interfaces, connection code handling, etc.&lt;/p&gt; &lt;p&gt;This SDK is usable &lt;strong&gt;without&lt;/strong&gt; BizTalk and can be used to create interfaces to existing systems.  Then, expose and consume these WCF bindings in your applications once they've been "installed".  &lt;/p&gt; &lt;p&gt;Get the bits here: &lt;a href="http://go.microsoft.com/fwlink/?LinkID=96184"&gt;http://go.microsoft.com/fwlink/?LinkID=96184&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;After you install you get a couple of Wizards and templates (CSharp Only).  The 1st Wizard is available as "WCF LOB Adapter".  This creates the based project that becomes the adapter that is then consumed (or referenced) later by choosing "Add Adapter Service Reference..." from the Project context menu.  &lt;/p&gt; &lt;p&gt;&lt;img height="502" src="http://www.cicoria.com/downloads/images/WCFLOBASDK_AddProject.jpg" width="794" /&gt; &lt;/p&gt; &lt;p&gt;Best bet is to walk through some of the samples.  The samples make use of an installer that both installs your adapter in the GAC along with making changes to the machine.config in order to surface your custom adapter to the Add Adapter Reference tool as a WCF (system.serviceModel section) extension.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Minor issues&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Note, that under Vista, some issues when running the MSI (installer).  Ensure to elevate to Administrator (by running a cmd shell and Runas Administrator) then execute the MSI and no issues.  I've seen this on 2 distinct machines.&lt;/p&gt; &lt;p&gt;There is a stand-alone help file (chm) that if you want to take a look at the capabilities, reference, etc., you can peruse it.  To get it just unpack the Zip file that's at the link and browse to the &lt;strong&gt;&lt;em&gt;WCFLOBASDK\Program Files\WCF LOB Adapter SDK\Documents&lt;/em&gt;&lt;/strong&gt; directory.&lt;/p&gt; &lt;p&gt;After installation the Help integration also gives you a quite distinct TOC entry - it ends up being the help collection identifier:&lt;/p&gt; &lt;p&gt;&lt;img src="http://www.cicoria.com/downloads/images/WCFLOBASDK_HelpIssue.jpg" /&gt; &lt;/p&gt; &lt;p&gt;There are a few limitations, one notably at this point is no support for IDuplexChannel and FaultContracts (the latter a limitation of the WSDL builder tool that's part of the SDK).  So, the work-around is hand-coding.&lt;/p&gt; &lt;p&gt;You still get both Synchronous and Asynchronous wizard code generation for the Retrieval, Browse, and Search interfaces.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114611"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114611" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/cicorias/aggbug/114611.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Shawn Cicoria</dc:creator>
            <guid>http://geekswithblogs.net/cicorias/archive/2007/08/13/WCF-LOB-Adapter-SDK---WCFLOBASDK---Lots-of-words.aspx</guid>
            <pubDate>Mon, 13 Aug 2007 14:00:26 GMT</pubDate>
            <comments>http://geekswithblogs.net/cicorias/archive/2007/08/13/WCF-LOB-Adapter-SDK---WCFLOBASDK---Lots-of-words.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/cicorias/comments/commentRss/114611.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/cicorias/services/trackbacks/114611.aspx</trackback:ping>
        </item>
    </channel>
</rss>