Welcome Guest Search | Active Topics | Sign In | Register

Using EO.WebBrowser 2014 For .NET in Web Services Options
WebDev
Posted: Sunday, July 13, 2014 2:58:21 PM
Rank: Newbie
Groups: Member

Joined: 7/13/2014
Posts: 3
Hi All --

Is it possible to use EO.WebBrowser 2014 For .NET in/behind

- ASP.NET Web Services (http://msdn.microsoft.com/en-us/library/t745kdsh(v=vs.90).aspx) and/or
- ASP.NET Web API Services (http://www.asp.net/web-api)

for web pages browsing automation tasks' implementation as e.g. PhantomJS used in this sample http://phantomjs.org/page-automation.html ?

Thank you.
eo_support
Posted: Sunday, July 13, 2014 4:54:12 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

You can use it in both cases as long as you have a UI thread that runs message pump. This is because each EO.WebView instance is associated to the thread in which it is created, and that thread must run a message pump in order for the WebView to function properly. If you do not have a message pump, you can use this class to run WebView:

http://www.essentialobjects.com/doc/6/eo.webbrowser.threadrunner.aspx

Each ThreadRunner will internally create a thread and run a message pump. You can then create a WebView with this method:

http://www.essentialobjects.com/doc/6/eo.webbrowser.threadrunner.createwebview.aspx

After you create the WebView, any calls to that WebView you must do it through the ThreadRunner class so that the actual call are run inside that thread. For example, instead of:

Code: C#
webView1.LoadUrl(url);


You need to do:

Code: C#
//Call LoadUrl inside the ThreadRunner's thread
threadRunner1.Post(() =>
{
    webView1.LoadUrl(url);
});


You can also call Send method instead of Post method. The difference is Send method does not return until the code it calls returns.

Hope this helps. Please feel free to let us know if you have any more question.

Thanks!
WebDev
Posted: Sunday, July 13, 2014 8:08:02 PM
Rank: Newbie
Groups: Member

Joined: 7/13/2014
Posts: 3
Thank you for your prompt advise. I have used it and I have got EO.WebView running first in a test .NET console application and then in an ASP.NET Web API local test Web Service. I haven't yet tested EO.WebView in a ASP.NET (SOAP) Web Service but I'd expect it should run well.

Note: it takes up to 20+ seconds for the first EO.WebView instance to "warm up", then the new instances seems to be created almost instantly.

I'd still need to implement quite a few EO.WebBrowser evaluation tests and I'd need to consult with my customer to decide would they use your software or not - I cannot find in the docs what is the EO.WebBrowser trial period duration? Is it possible to somehow setup the trial version of EO.WebBrowser.dll on an ASP.NET hosting web site?

Thank you.
eo_support
Posted: Sunday, July 13, 2014 10:16:30 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

I believe the trial version expires in 30 days. You can use EO.WebBrowser on an ASP.NET hosting web site only if your site runs with full trust. Your web site has to have full unmanaged permission in order to use EO.WebBrowser.

Thanks!
WebDev
Posted: Monday, July 14, 2014 4:27:58 AM
Rank: Newbie
Groups: Member

Joined: 7/13/2014
Posts: 3
Thank you for your remark on EO.WebBrowser trial period duration and on EO.WebBrowser requiring full trust security mode to run. I have set

<system.web>
<trust level="Medium"/>
</system.web>

and my test now fails. If I assume I don't need to write to my ASP.NET hosting (sub-)directories to save downloaded files, cookies etc. would the only need in "Full Trust" mode be the EO.WebBrowser licensing verification via MS Windows system registry? If so, wouldn't it be possible to implement a special licensing scheme where EO.WebBrowser installed on a shared medium/low trust ASP.NET hosting site will read license key from custom ASP.NET web service setup folder's license file, or license key will be stored in the web.config, read from it by custom web service and passed to the EO.WebBrowser on initialization...?

In the case of "Full Trust" ASP.NET hosting and a single developer license would it be possible to setup EO.WebBrowser.dll by simple copying it within e.g. ASP.NET Web API Web Service files?

Thank you.
eo_support
Posted: Monday, July 14, 2014 9:19:29 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

The full trust is not something you can configure in a shared hosting environment. Some shared hosting providers restrict your application's permission by lowering your app's trust level. The very purpose for a hosting company to do so is to prevent your application from performing certain actions (such as running unmanaged code, read/write certain area of the registry, etc) so that your code doesn't accidentally bring down other users on the same server. In this case, there is no way for you to gain higher permission/trust level than what's assigned to you by your hosting company. The only way to gain full trust is for them to give it to you.

Since EO.WebBrowser needs to run unmanaged code, it is not possible for EO.WebBrowser to run in a lower than full trust environment. You must have a full trusted environment. Some hosting company does give their shared hosting user full trust. Almost all hosting company would give their dedicated server user full trust since no other users use your dedicated server.

As to deployment, EO.WebBrowser.dll is a standard .NET dll so you pretty much just reference, use, and copy. When you purchase a license, you will get a license code which you can apply through code.

Hope this answers your question. Please feel free to let us know if you have any more questions.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.