<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Request/Response Service Layer: Exposing The Service Layer Through WCF</title> <atom:link href="http://davybrion.com/blog/2009/11/requestresponse-service-layer-exposing-the-service-layer-through-wcf/feed/" rel="self" type="application/rss+xml" /><link>http://davybrion.com/blog/2009/11/requestresponse-service-layer-exposing-the-service-layer-through-wcf/</link> <description>inquisitive: adjective. given to inquiry, research, or asking questions; eager for knowledge; intellectually curious</description> <lastBuildDate>Wed, 08 Feb 2012 11:42:42 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Eric Roth</title><link>http://davybrion.com/blog/2009/11/requestresponse-service-layer-exposing-the-service-layer-through-wcf/comment-page-1/#comment-99654</link> <dc:creator>Eric Roth</dc:creator> <pubDate>Tue, 14 Jun 2011 13:19:00 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1804#comment-99654</guid> <description>Have you come up with any way to elegantly handle generic requests, i.e Request. I am new to WCF and have recently found out that this type of thing is not supported, however we found that would would greatly decrease the code we would need to write in certain cenarios if generics would work?</description> <content:encoded><![CDATA[<p>Have you come up with any way to elegantly handle generic requests, i.e Request. I am new to WCF and have recently found out that this type of thing is not supported, however we found that would would greatly decrease the code we would need to write in certain cenarios if generics would work?</p> ]]></content:encoded> </item> <item><title>By: Scott McFadden</title><link>http://davybrion.com/blog/2009/11/requestresponse-service-layer-exposing-the-service-layer-through-wcf/comment-page-1/#comment-91553</link> <dc:creator>Scott McFadden</dc:creator> <pubDate>Fri, 14 Jan 2011 05:26:30 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1804#comment-91553</guid> <description>Update.  I just read from Bustamante&#039;s book where you can ditch the ServiceKnownType attribute altogether and just statically map the known types via config file:http://msdn.microsoft.com/en-us/library/system.runtime.serialization.configuration.datacontractserializersection.aspx</description> <content:encoded><![CDATA[<p>Update.  I just read from Bustamante&#8217;s book where you can ditch the ServiceKnownType attribute altogether and just statically map the known types via config file:</p><p><a
href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.configuration.datacontractserializersection.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.runtime.serialization.configuration.datacontractserializersection.aspx</a></p> ]]></content:encoded> </item> <item><title>By: scott mcfadden</title><link>http://davybrion.com/blog/2009/11/requestresponse-service-layer-exposing-the-service-layer-through-wcf/comment-page-1/#comment-91161</link> <dc:creator>scott mcfadden</dc:creator> <pubDate>Wed, 12 Jan 2011 20:06:44 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1804#comment-91161</guid> <description>Great article.  I modified your code to resolve the child types via IOC.  This better facilitates loose coupling between assemblies.   I had to write a custom attribute - RegisterKnownServiceType.  This attribute is used in conjunction with your KnownTypeProvider.  Here is an example of how you would use the modified version:[ServiceContract(Namespace = &quot;MyServices&quot;)]
public interface ICarService
{
[OperationContract]
//[ServiceKnownType(typeof(PriusCarInfo))]  --old / static way of providing type
//[ServiceKnownType(typeof(LexusCarInfo))]  --old / static way of providing type
[ServiceKnownType(&quot;GetKnownTypes&quot;, typeof(ServiceKnownTypeProvider))]  --factory will use IOC to resolve types for all discovered RegisterServiceKnownType attributes
[RegisterServiceKnownType(typeof(ICarInfo))] --custom attribute used by ServiceKnownTypeProvider to dynamically register types via IOC
ICarInfo GetCarInfo(int carId);
}</description> <content:encoded><![CDATA[<p>Great article.  I modified your code to resolve the child types via IOC.  This better facilitates loose coupling between assemblies.   I had to write a custom attribute &#8211; RegisterKnownServiceType.  This attribute is used in conjunction with your KnownTypeProvider.  Here is an example of how you would use the modified version:</p><p> [ServiceContract(Namespace = "MyServices")]<br
/> public interface ICarService<br
/> {<br
/> [OperationContract]<br
/> //[ServiceKnownType(typeof(PriusCarInfo))]  &#8211;old / static way of providing type<br
/> //[ServiceKnownType(typeof(LexusCarInfo))]  &#8211;old / static way of providing type<br
/> [ServiceKnownType("GetKnownTypes", typeof(ServiceKnownTypeProvider))]  &#8211;factory will use IOC to resolve types for all discovered RegisterServiceKnownType attributes<br
/> [RegisterServiceKnownType(typeof(ICarInfo))] &#8211;custom attribute used by ServiceKnownTypeProvider to dynamically register types via IOC<br
/> ICarInfo GetCarInfo(int carId);<br
/> }</p> ]]></content:encoded> </item> <item><title>By: Kushal</title><link>http://davybrion.com/blog/2009/11/requestresponse-service-layer-exposing-the-service-layer-through-wcf/comment-page-1/#comment-52722</link> <dc:creator>Kushal</dc:creator> <pubDate>Tue, 10 Aug 2010 14:18:46 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1804#comment-52722</guid> <description>@DavyThank for the reply. To be honest I am new to WCF and not have experience in developing web service and wcf service.
You mean to say I just have to create object with the details i want to send, then wcf will automatically serialize/deserialize it to xml.</description> <content:encoded><![CDATA[<p>@Davy</p><p>Thank for the reply. To be honest I am new to WCF and not have experience in developing web service and wcf service.<br
/> You mean to say I just have to create object with the details i want to send, then wcf will automatically serialize/deserialize it to xml.</p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2009/11/requestresponse-service-layer-exposing-the-service-layer-through-wcf/comment-page-1/#comment-52647</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Tue, 10 Aug 2010 08:09:11 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1804#comment-52647</guid> <description>@Kushalwhy would you send xml yourself?it&#039;s far easier to just define request/response types with the properties of the data that needs to be included in your calls... WCF will serialize/deserialize to xml (well, soap actually) automatically for you</description> <content:encoded><![CDATA[<p>@Kushal</p><p>why would you send xml yourself?</p><p>it&#8217;s far easier to just define request/response types with the properties of the data that needs to be included in your calls&#8230; WCF will serialize/deserialize to xml (well, soap actually) automatically for you</p> ]]></content:encoded> </item> <item><title>By: Kushal</title><link>http://davybrion.com/blog/2009/11/requestresponse-service-layer-exposing-the-service-layer-through-wcf/comment-page-1/#comment-52511</link> <dc:creator>Kushal</dc:creator> <pubDate>Mon, 09 Aug 2010 21:16:44 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1804#comment-52511</guid> <description>Hi,
I am learning WCF and read your series of articles.
i would like to create WCF service in which client can request with xml.
Server get that xml, parse it, validate it and then send them response.
In client xml there will be username,password and clientid that will differentiate the client with other client so server can easily recognize the client.
After that server send them back response in xml.
The server should be designed in a way that can handle multiple request and response to client.
How I can go about this by request/reply message.
Thanks</description> <content:encoded><![CDATA[<p>Hi,<br
/> I am learning WCF and read your series of articles.<br
/> i would like to create WCF service in which client can request with xml.<br
/> Server get that xml, parse it, validate it and then send them response.<br
/> In client xml there will be username,password and clientid that will differentiate the client with other client so server can easily recognize the client.<br
/> After that server send them back response in xml.<br
/> The server should be designed in a way that can handle multiple request and response to client.<br
/> How I can go about this by request/reply message.<br
/> Thanks</p> ]]></content:encoded> </item> <item><title>By: Chris</title><link>http://davybrion.com/blog/2009/11/requestresponse-service-layer-exposing-the-service-layer-through-wcf/comment-page-1/#comment-41619</link> <dc:creator>Chris</dc:creator> <pubDate>Thu, 10 Jun 2010 17:20:13 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1804#comment-41619</guid> <description>KnownTypeProvider.RegisterDerivedTypesOf(assembly);</description> <content:encoded><![CDATA[<p>KnownTypeProvider.RegisterDerivedTypesOf(assembly);</p> ]]></content:encoded> </item> <item><title>By: Chris</title><link>http://davybrion.com/blog/2009/11/requestresponse-service-layer-exposing-the-service-layer-through-wcf/comment-page-1/#comment-41617</link> <dc:creator>Chris</dc:creator> <pubDate>Thu, 10 Jun 2010 17:19:33 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1804#comment-41617</guid> <description>oops.. I meant&lt;code&gt;
KnownTypeProvider.RegisterDerivedTypesOf(assembly);
&lt;/code&gt;</description> <content:encoded><![CDATA[<p>oops.. I meant</p><p><code><br
/> KnownTypeProvider.RegisterDerivedTypesOf(assembly);<br
/> </code></p> ]]></content:encoded> </item> <item><title>By: Chris</title><link>http://davybrion.com/blog/2009/11/requestresponse-service-layer-exposing-the-service-layer-through-wcf/comment-page-1/#comment-41616</link> <dc:creator>Chris</dc:creator> <pubDate>Thu, 10 Jun 2010 17:18:38 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1804#comment-41616</guid> <description>Thanks for the great article, I found it very useful. Just an FYI I modified your KnownTypeProvider class in this way&lt;code&gt;
private static IEnumerable GetDerivedTypesOf(Type baseType, IEnumerable types)
{
//return types.Where(t =&gt; !t.IsAbstract &amp;&amp; t.IsSubclassOf(baseType)).ToList();
return types.Where(t =&gt; !t.IsAbstract &amp;&amp; baseType.IsAssignableFrom(t)).ToList();
}
&lt;/code&gt;
This way I can send do something like
&lt;code&gt;KnownTypeProvider(someAssembly);&lt;/code&gt;</description> <content:encoded><![CDATA[<p>Thanks for the great article, I found it very useful. Just an FYI I modified your KnownTypeProvider class in this way</p><p><code><br
/> private static IEnumerable GetDerivedTypesOf(Type baseType, IEnumerable types)<br
/> {<br
/> //return types.Where(t =&gt; !t.IsAbstract &amp;&amp; t.IsSubclassOf(baseType)).ToList();<br
/> return types.Where(t =&gt; !t.IsAbstract &amp;&amp; baseType.IsAssignableFrom(t)).ToList();<br
/> }<br
/> </code><br
/> This way I can send do something like<br
/> <code>KnownTypeProvider(someAssembly);</code></p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2009/11/requestresponse-service-layer-exposing-the-service-layer-through-wcf/comment-page-1/#comment-22948</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Fri, 13 Nov 2009 21:10:51 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1804#comment-22948</guid> <description>@ Lucit might be... i thought that registering the know types before the first service request is received was enough... it might be because i primarily use it with IIS and maybe it creates the service host as late as possible or something (as in: when the first requests is received)</description> <content:encoded><![CDATA[<p>@ Luc</p><p>it might be&#8230; i thought that registering the know types before the first service request is received was enough&#8230; it might be because i primarily use it with IIS and maybe it creates the service host as late as possible or something (as in: when the first requests is received)</p> ]]></content:encoded> </item> <item><title>By: Luc</title><link>http://davybrion.com/blog/2009/11/requestresponse-service-layer-exposing-the-service-layer-through-wcf/comment-page-1/#comment-22945</link> <dc:creator>Luc</dc:creator> <pubDate>Fri, 13 Nov 2009 16:47:15 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1804#comment-22945</guid> <description>If I&#039;m not mistaken, the known types must be registered before the ServiceHost is created because the GetKnownTypes is called from the CreateDescription method of the ServiceHost.If the assemblies containing the requests and responses are shared between the client and the server, using the NetDataContractSerializer can help since known types must not be declared for operations.
But you need to tweak the serialization in the fault channel since it keeps using the DataContractSerializer to serialize FaultException</description> <content:encoded><![CDATA[<p>If I&#8217;m not mistaken, the known types must be registered before the ServiceHost is created because the GetKnownTypes is called from the CreateDescription method of the ServiceHost.</p><p>If the assemblies containing the requests and responses are shared between the client and the server, using the NetDataContractSerializer can help since known types must not be declared for operations.<br
/> But you need to tweak the serialization in the fault channel since it keeps using the DataContractSerializer to serialize FaultException</p> ]]></content:encoded> </item> <item><title>By: Reflective Perspective - Chris Alcock &#187; The Morning Brew #475</title><link>http://davybrion.com/blog/2009/11/requestresponse-service-layer-exposing-the-service-layer-through-wcf/comment-page-1/#comment-22933</link> <dc:creator>Reflective Perspective - Chris Alcock &#187; The Morning Brew #475</dc:creator> <pubDate>Thu, 12 Nov 2009 08:27:26 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1804#comment-22933</guid> <description>[...] Request/Response Service Layer: Exposing The Service Layer Through WCF - Davy Brion continues his series on the Request Response Service Layer with a look at putting his service layer out there via WCF, with plenty of illustrating code [...]</description> <content:encoded><![CDATA[<p>[...] Request/Response Service Layer: Exposing The Service Layer Through WCF &#8211; Davy Brion continues his series on the Request Response Service Layer with a look at putting his service layer out there via WCF, with plenty of illustrating code [...]</p> ]]></content:encoded> </item> <item><title>By: Davy Brion</title><link>http://davybrion.com/blog/2009/11/requestresponse-service-layer-exposing-the-service-layer-through-wcf/comment-page-1/#comment-22930</link> <dc:creator>Davy Brion</dc:creator> <pubDate>Wed, 11 Nov 2009 22:09:21 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1804#comment-22930</guid> <description>@Aaronif that is the only place where it&#039;s used like that, then why would i? what would be the difference between doing it yourself, or having some other kind of infrastructural library doing it for you?if you were to do that all over the place, then yeah it would definitely bother me. But if it&#039;s only in one place, in a piece of infrastructural code that you never need to change, then i really don&#039;t think there&#039;s any _real_ problem there.</description> <content:encoded><![CDATA[<p>@Aaron</p><p>if that is the only place where it&#8217;s used like that, then why would i? what would be the difference between doing it yourself, or having some other kind of infrastructural library doing it for you?</p><p>if you were to do that all over the place, then yeah it would definitely bother me. But if it&#8217;s only in one place, in a piece of infrastructural code that you never need to change, then i really don&#8217;t think there&#8217;s any _real_ problem there.</p> ]]></content:encoded> </item> <item><title>By: Aaron  Fischer</title><link>http://davybrion.com/blog/2009/11/requestresponse-service-layer-exposing-the-service-layer-through-wcf/comment-page-1/#comment-22927</link> <dc:creator>Aaron  Fischer</dc:creator> <pubDate>Wed, 11 Nov 2009 17:38:54 +0000</pubDate> <guid
isPermaLink="false">http://davybrion.com/blog/?p=1804#comment-22927</guid> <description>So it doesn&#039;t bother you to use the container as a global service locator?</description> <content:encoded><![CDATA[<p>So it doesn&#8217;t bother you to use the container as a global service locator?</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 3/19 queries in 0.010 seconds using disk: basic
Object Caching 535/538 objects using disk: basic
Content Delivery Network via Amazon Web Services: CloudFront: d18sni7re4ly7f.cloudfront.net

Served from: davybrion.com @ 2012-02-09 03:56:39 -->
