<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>WCF: Building an HTTP User Agent Message Inspector</title><link>http://msmvps.com/blogs/paulomorgado/archive/2007/04/27/wcf-building-an-http-user-agent-message-inspector.aspx</link><description>Yesterday I had to build a custom message encoder to be able to call a legacy POX service with iso-8859-1 encoding. It turned out that the service had another surprise to me: it needs an HTTP user-agent header. It&amp;#39;s something quite simple to accomplish</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>re: WCF: Building an HTTP User Agent Message Inspector</title><link>http://msmvps.com/blogs/paulomorgado/archive/2007/04/27/wcf-building-an-http-user-agent-message-inspector.aspx#1672772</link><pubDate>Tue, 17 Feb 2009 23:02:32 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1672772</guid><dc:creator>Paulo Morgado</dc:creator><description>&lt;p&gt;Always glad to help.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1672772" width="1" height="1"&gt;</description></item><item><title>re: WCF: Building an HTTP User Agent Message Inspector</title><link>http://msmvps.com/blogs/paulomorgado/archive/2007/04/27/wcf-building-an-http-user-agent-message-inspector.aspx#1672767</link><pubDate>Tue, 17 Feb 2009 21:55:55 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1672767</guid><dc:creator>Sergey Kostrukov</dc:creator><description>&lt;p&gt;Thank you for your post. It works!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1672767" width="1" height="1"&gt;</description></item><item><title>re: WCF: Building an HTTP User Agent Message Inspector</title><link>http://msmvps.com/blogs/paulomorgado/archive/2007/04/27/wcf-building-an-http-user-agent-message-inspector.aspx#1655711</link><pubDate>Thu, 04 Dec 2008 00:48:43 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1655711</guid><dc:creator>Paulo Morgado</dc:creator><description>&lt;p&gt;Hi Chris,&lt;/p&gt;
&lt;p&gt;It has been some time since I plyed with this and I made it from a sample.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t really know what is the instance creation ratio and if there are threading issues.&lt;/p&gt;
&lt;p&gt;Have you tried it?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1655711" width="1" height="1"&gt;</description></item><item><title>re: WCF: Building an HTTP User Agent Message Inspector</title><link>http://msmvps.com/blogs/paulomorgado/archive/2007/04/27/wcf-building-an-http-user-agent-message-inspector.aspx#1655651</link><pubDate>Wed, 03 Dec 2008 15:55:24 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1655651</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;I know this post is a bit old, but I wanted to point something out. &amp;nbsp;One thing that I keep seeing with message inspectors. &amp;nbsp;Using the setup you described you end up having to create multiple classes in order to do one thing. &amp;nbsp;Only one of those classes derives from a base, the rest simply implement interfaces. &amp;nbsp;So why don&amp;#39;t you just do the following?&lt;/p&gt;
&lt;p&gt;HttpUserAgentEndpointBehavior : BehaviorExtensionElement, IEndpointBehavior, IClientMessageInspector&lt;/p&gt;
&lt;p&gt;Then you can have 1 class that performs all the tasks that you need.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1655651" width="1" height="1"&gt;</description></item><item><title>re: WCF: Building an HTTP User Agent Message Inspector</title><link>http://msmvps.com/blogs/paulomorgado/archive/2007/04/27/wcf-building-an-http-user-agent-message-inspector.aspx#1642247</link><pubDate>Sat, 26 Jul 2008 17:22:45 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1642247</guid><dc:creator>Paulo Morgado</dc:creator><description>&lt;p&gt;@saudamini&lt;/p&gt;
&lt;p&gt;What exactly do you want to validate? Have looked at the Validation Application Block in the Entreprise Library? There&amp;#39;s an implementation to validate data contracts.&lt;/p&gt;
&lt;p&gt;One way to test this is having a proxy like Fiddler and look at the HTTP payload.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1642247" width="1" height="1"&gt;</description></item><item><title>re: WCF: Building an HTTP User Agent Message Inspector</title><link>http://msmvps.com/blogs/paulomorgado/archive/2007/04/27/wcf-building-an-http-user-agent-message-inspector.aspx#1642124</link><pubDate>Fri, 25 Jul 2008 15:27:26 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1642124</guid><dc:creator>saudamini</dc:creator><description>&lt;p&gt;How do i test this?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1642124" width="1" height="1"&gt;</description></item><item><title>re: WCF: Building an HTTP User Agent Message Inspector</title><link>http://msmvps.com/blogs/paulomorgado/archive/2007/04/27/wcf-building-an-http-user-agent-message-inspector.aspx#1642123</link><pubDate>Fri, 25 Jul 2008 15:22:59 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1642123</guid><dc:creator>saudamini</dc:creator><description>&lt;p&gt;what i need to do is, valid the input against the data contract i have. Do you think this will be useful? &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1642123" width="1" height="1"&gt;</description></item><item><title>re: WCF: Building an HTTP User Agent Message Inspector</title><link>http://msmvps.com/blogs/paulomorgado/archive/2007/04/27/wcf-building-an-http-user-agent-message-inspector.aspx#1202912</link><pubDate>Mon, 17 Sep 2007 22:15:25 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1202912</guid><dc:creator>Paulo Morgado</dc:creator><description>&lt;p&gt;Hi Rama,&lt;/p&gt;
&lt;p&gt;There must be something else there.&lt;/p&gt;
&lt;p&gt;If the body of the HTTP request gets to the server, the HTTP headers must get ther first.&lt;/p&gt;
&lt;p&gt;Have you tried to use something like the Fiddler tool to see what's going on the wire?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1202912" width="1" height="1"&gt;</description></item><item><title>re: WCF: Building an HTTP User Agent Message Inspector</title><link>http://msmvps.com/blogs/paulomorgado/archive/2007/04/27/wcf-building-an-http-user-agent-message-inspector.aspx#1201756</link><pubDate>Mon, 17 Sep 2007 04:44:15 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1201756</guid><dc:creator>Rama </dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I used the same method as you specified in this post, to add some custom HTTP headers. But there seems to be some kind of timing issue in the headers reaching the server. The headers don&amp;#39;t reach the server on time always. So my program works when I run it in a debugger but does not work otherwise.&lt;/p&gt;
&lt;p&gt;Do you have any ideas on how I could fix this?&lt;/p&gt;
&lt;p&gt;Thanks &lt;/p&gt;
&lt;p&gt;-Rama&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1201756" width="1" height="1"&gt;</description></item></channel></rss>