<?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: ASP.NET Web Services and STA COM Objects</title>
	<atom:link href="http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/</link>
	<description></description>
	<lastBuildDate>Sat, 06 Feb 2010 00:43:17 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Sam</title>
		<link>http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/comment-page-1/#comment-33021</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Wed, 27 Aug 2008 21:40:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/#comment-33021</guid>
		<description>ahhh - made a mistake above ... can just use Context.Request.Path to get the actual virtual path ... do no rigmarole of stripping the querystring</description>
		<content:encoded><![CDATA[<p>ahhh &#8211; made a mistake above &#8230; can just use Context.Request.Path to get the actual virtual path &#8230; do no rigmarole of stripping the querystring</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/comment-page-1/#comment-33020</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Wed, 27 Aug 2008 21:35:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/#comment-33020</guid>
		<description>When I upgraded my site to 2008, I had to change the code as it gave a ... is not a valid virtual path error.

The solution I found was to strip the querystring from the raw url:

override protected void OnInit(EventArgs e)
{
   string virtualPath = Context.Request.RawUrl;
   // strip the querystring off
   if (virtualPath.IndexOf(&#039;?&#039;) &gt; 0)
   {
      virtualPath = virtualPath.Substring(0, virtualPath.IndexOf(&#039;?&#039;));
   }

   //Get the real handler and ask it to process the request
   IHttpHandler Handler = defaultFactory.GetHandler(
      Context
      ,Context.Request.HttpMethod
      , virtualPath
      ,Context.Request.PhysicalPath);
   
   if (Handler!=null)
      Handler.ProcessRequest(Context); 

}</description>
		<content:encoded><![CDATA[<p>When I upgraded my site to 2008, I had to change the code as it gave a &#8230; is not a valid virtual path error.</p>
<p>The solution I found was to strip the querystring from the raw url:</p>
<p>override protected void OnInit(EventArgs e)<br />
{<br />
   string virtualPath = Context.Request.RawUrl;<br />
   // strip the querystring off<br />
   if (virtualPath.IndexOf(&#8217;?') &gt; 0)<br />
   {<br />
      virtualPath = virtualPath.Substring(0, virtualPath.IndexOf(&#8217;?'));<br />
   }</p>
<p>   //Get the real handler and ask it to process the request<br />
   IHttpHandler Handler = defaultFactory.GetHandler(<br />
      Context<br />
      ,Context.Request.HttpMethod<br />
      , virtualPath<br />
      ,Context.Request.PhysicalPath);</p>
<p>   if (Handler!=null)<br />
      Handler.ProcessRequest(Context); </p>
<p>}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: roncansan</title>
		<link>http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/comment-page-1/#comment-32001</link>
		<dc:creator>roncansan</dc:creator>
		<pubDate>Wed, 23 Jul 2008 19:39:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/#comment-32001</guid>
		<description>I integrate this code to a project and it works fine when I&#039;m debugging it under Visual studio development server, but when I move the code to a real IIS server 6.0, which by the way is in the same machine, I can not attach the ocx,  myocx.attach() return -1. I know this a very general explanation, but I don&#039;t know where to start. Any insight on this.</description>
		<content:encoded><![CDATA[<p>I integrate this code to a project and it works fine when I&#8217;m debugging it under Visual studio development server, but when I move the code to a real IIS server 6.0, which by the way is in the same machine, I can not attach the ocx,  myocx.attach() return -1. I know this a very general explanation, but I don&#8217;t know where to start. Any insight on this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny</title>
		<link>http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/comment-page-1/#comment-26281</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Mon, 14 Apr 2008 14:25:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/#comment-26281</guid>
		<description>I found that I had to manually assign an arbitrary page id in the OnInit method, otherwise I got the following exception in EndProcessRequest:

Multiple controls with the same ID &#039;__Page&#039; were found. Trace requires that controls have unique IDs. 

[HttpException (0x80004005): Multiple controls with the same ID &#039;__Page&#039; were found. Trace requires that controls have unique IDs.]
   System.Web.TraceContext.AddNewControl(String id, String parentId, String type, Int32 viewStateSize, Int32 controlStateSize) +475
   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean calcViewState) +359
   System.Web.UI.Page.BuildPageProfileTree(Boolean enableViewState) +39
   
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6341</description>
		<content:encoded><![CDATA[<p>I found that I had to manually assign an arbitrary page id in the OnInit method, otherwise I got the following exception in EndProcessRequest:</p>
<p>Multiple controls with the same ID &#8216;__Page&#8217; were found. Trace requires that controls have unique IDs. </p>
<p>[HttpException (0x80004005): Multiple controls with the same ID '__Page' were found. Trace requires that controls have unique IDs.]<br />
   System.Web.TraceContext.AddNewControl(String id, String parentId, String type, Int32 viewStateSize, Int32 controlStateSize) +475<br />
   System.Web.UI.Control.BuildProfileTree(String parentId, Boolean calcViewState) +359<br />
   System.Web.UI.Page.BuildPageProfileTree(Boolean enableViewState) +39</p>
<p>System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6341</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prafull Patil</title>
		<link>http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/comment-page-1/#comment-13862</link>
		<dc:creator>Prafull Patil</dc:creator>
		<pubDate>Thu, 11 Oct 2007 22:38:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/#comment-13862</guid>
		<description>Gr8. This idea is lifesaver although speed is not good but it is not bad too. Thank you very much.</description>
		<content:encoded><![CDATA[<p>Gr8. This idea is lifesaver although speed is not good but it is not bad too. Thank you very much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/comment-page-1/#comment-8628</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Wed, 13 Jun 2007 06:23:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/#comment-8628</guid>
		<description>I&#039;ve implemented this handler, and have found that execution disappears into the COM call and doesn&#039;t reappear for a very long time (long enough to cause the requesting app to give up with a webservice timeout). The COM object it&#039;s calling is reasonably performant. Any ideas on what could be causing this?</description>
		<content:encoded><![CDATA[<p>I&#8217;ve implemented this handler, and have found that execution disappears into the COM call and doesn&#8217;t reappear for a very long time (long enough to cause the requesting app to give up with a webservice timeout). The COM object it&#8217;s calling is reasonably performant. Any ideas on what could be causing this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eyal Post</title>
		<link>http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/comment-page-1/#comment-8416</link>
		<dc:creator>Eyal Post</dc:creator>
		<pubDate>Wed, 30 May 2007 11:57:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/#comment-8416</guid>
		<description>Fixed. Thanks.</description>
		<content:encoded><![CDATA[<p>Fixed. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/comment-page-1/#comment-8415</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Wed, 30 May 2007 11:43:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/#comment-8415</guid>
		<description>Got this working, but there is a typo:

The web services handler should be named WSHFactory instead of defaultFactory

Good work. Thanks</description>
		<content:encoded><![CDATA[<p>Got this working, but there is a typo:</p>
<p>The web services handler should be named WSHFactory instead of defaultFactory</p>
<p>Good work. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ati Rosselet</title>
		<link>http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/comment-page-1/#comment-6884</link>
		<dc:creator>Ati Rosselet</dc:creator>
		<pubDate>Mon, 05 Mar 2007 15:16:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/#comment-6884</guid>
		<description>Hi, don&#039;t know if you can help, but I&#039;m dying with a certain STA component that requires AspCompat=true (in an aspx page).  The whole webserver just blocks until the call completes.. and I can&#039;t find a way around it. Specifically this is MS DRM-s WMRMObjs.Reheader object and within that, the Dowload  function.  Any ideas of how to circumvent this, or get it to unblock? Even if I cancel the download, I&#039;m left with about 30s of deadtime until it finishes something internally :(( This is a real project killer at the moment :(  
My email is uramisten at hotmail dot com

Cheers</description>
		<content:encoded><![CDATA[<p>Hi, don&#8217;t know if you can help, but I&#8217;m dying with a certain STA component that requires AspCompat=true (in an aspx page).  The whole webserver just blocks until the call completes.. and I can&#8217;t find a way around it. Specifically this is MS DRM-s WMRMObjs.Reheader object and within that, the Dowload  function.  Any ideas of how to circumvent this, or get it to unblock? Even if I cancel the download, I&#8217;m left with about 30s of deadtime until it finishes something internally <img src='http://www.epocalipse.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> ( This is a real project killer at the moment <img src='http://www.epocalipse.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /><br />
My email is uramisten at hotmail dot com</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PR</title>
		<link>http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/comment-page-1/#comment-1386</link>
		<dc:creator>PR</dc:creator>
		<pubDate>Fri, 20 Oct 2006 00:06:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.epocalipse.com/blog/2006/03/04/aspnet-web-services-and-sta-com-objects/#comment-1386</guid>
		<description>Never mind..I found it..
You can also use this with remoting.. You need to host your remoting server in IIS and instead of using WebServiceHandlerFactory, use RemotingHandlerFactory..
You can speicify this handler for .soap extensions in  your web.config within  section..</description>
		<content:encoded><![CDATA[<p>Never mind..I found it..<br />
You can also use this with remoting.. You need to host your remoting server in IIS and instead of using WebServiceHandlerFactory, use RemotingHandlerFactory..<br />
You can speicify this handler for .soap extensions in  your web.config within  section..</p>
]]></content:encoded>
	</item>
</channel>
</rss>
