<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : HttpContext in SaveInterceptor</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2012 : HttpContext in SaveInterceptor</description>
  <pubDate>Sat, 11 Apr 2026 02:39:27 -700</pubDate>
  <lastBuildDate>Sat, 23 Feb 2013 19:06:11 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=4003</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>HttpContext in SaveInterceptor : Thanks very much, works great.  Greg...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4003&amp;PID=15906#15906</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=579" rel="nofollow">gregweb</a><br /><strong>Subject:</strong> 4003<br /><strong>Posted:</strong> 23-Feb-2013 at 7:06pm<br /><br />Thanks very much, works great.<br /><br />Greg]]>
   </description>
   <pubDate>Sat, 23 Feb 2013 19:06:11 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4003&amp;PID=15906#15906</guid>
  </item> 
  <item>
   <title>HttpContext in SaveInterceptor :    The EntityServerSaveInterceptor...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4003&amp;PID=15905#15905</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 4003<br /><strong>Posted:</strong> 23-Feb-2013 at 5:51pm<br /><br /> The EntityServerSaveInterceptor is running within the context of an EntityServer WCF service, so to access the HttpContext you must set the aspNetCompatibilityEnabled flag in the web.config.&nbsp; <div>&nbsp;</div><div>&lt;system.serviceModel&gt;<br> &nbsp;&nbsp; &lt;serviceHostingEnvironment aspNetCompatibilityEnabled=<span style="color: rgb163, 21, 21;">"true"</span> /&gt;<br>&lt;/system.serviceModel&gt;</div><div>&nbsp;</div><div>If you do this, also be sure to set the targetFramework on the httpRuntime element:</div><div>&nbsp;</div><div>&lt;system.web&gt;<br>&nbsp;&lt;httpRuntime targetFramework="4.5"/&gt;<br>&lt;/system.web&gt;</div><div>&nbsp;</div><div>Alternately, you can grab the IP address directly from WCF, like this:</div><div>&nbsp;</div><div>var ctx = OperationContext.Current;<br>var endpoint = ctx.IncomingMessageProperties&#091;RemoteEndpointMessageProperty.Name&#093; as RemoteEndpointMessageProperty;<br>string ip = endpoint.Address;<br></div><div>&nbsp;</div><div>You'll need to add a reference to the System.ServiceModel assembly to use these types.</div><div><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas"><p>&nbsp;&nbsp;&nbsp; </font></font></font><p>&nbsp;</p><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas"></font></font></font></div>]]>
   </description>
   <pubDate>Sat, 23 Feb 2013 17:51:02 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4003&amp;PID=15905#15905</guid>
  </item> 
  <item>
   <title>HttpContext in SaveInterceptor : Is it possible to access the HttpContext.Current...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4003&amp;PID=15904#15904</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=579" rel="nofollow">gregweb</a><br /><strong>Subject:</strong> 4003<br /><strong>Posted:</strong> 23-Feb-2013 at 2:00pm<br /><br />Is it possible to access the HttpContext.Current from the SaveInterceptor?<br /><br />I have tried, but it is always null.<br /><br />What I am trying to do is get the IP address of the request so I can log it.<br /><br />No authentication is being used - it's just for logging web site analytics.<br /><br />Greg]]>
   </description>
   <pubDate>Sat, 23 Feb 2013 14:00:57 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4003&amp;PID=15904#15904</guid>
  </item> 
 </channel>
</rss>