Native Integration in Silverlight 4 - silverlight-4.0

a question concerning the new concept of Trusted Applications in Silverlight 4:
I gather that trusted applications run outside the browser with elevated trust. Will it therefore be possible to call arbitrary functions in unmanaged DLLs (by means of DllImport) from a trusted application or is this feature still reserved to proper desktop applications?
Thank you very much in advance and kind regards,
Marc Frei

Unfortunately, Silverlight 4 does not allow calling unmanaged code via P/Invoke. You can only call native code using the COM via the AutomationFactory class. However, calling native code was added to Silverlight 5.

Related

Access to a WCF web service in VB6

I am very basic in VB6 so sorry if I am asking an obvious question!
We have an old VB6 application and currently we need to do some re-enhancements in it. I want to somehow connect it to a WCF webservice to send and get files (WCF will take care of loading and storing them in DB).
Based on my researches, it is possible based on This article and some others, Now I am wondering if is it required to have .NetFramework installed on systems to do this?
You can use RESTFUL WCF Service and set the UriTemplate attribute for the method(OperationContract).
Full article for creating REST service
The article you have linked suggests that the VB6 code should call a .Net wrapper for the WCF service.
If you do that, then yes, certainly you will require the .Net framework to be installed on the machine that runs the VB6, because that machine will also have to run the .Net wrapper.

Web API run VB6 COM components in STA mode

Masters,
I've few past developed VB6 components that are heavily used in our most of the applications
Now, we want to consume same components for newly developing Web API project.
But, as per this post ,
http://www.west-wind.com/weblog/posts/2012/Sep/18/Creating-STA-COM-compatible-ASPNET-Applications
We found strike on Asp.net Web API it might due to we don't have any page in Web API project.
Please tell me correct workaround achieve this.
Thanks in advance.
I would suggesting looking into the StaTaskScheduler http://blogs.msdn.com/b/pfxteam/archive/2010/04/07/9990421.aspx

Silverlight OOB Calling Class Library

I have a class library that reads and writes to a local SQL CE database using Entity Framework 4.2 code first. I want to access the class library from a Silverlight 4 OOB app.
What is the best way to do this?
Do I have to turn the class library into a COM object?
Would it be better to use Silverlight 5?
With both Silverlight 4 and Silverlight 5, if you're using OOB, you can use elevated privileges to get access to lots of things, and with Silverlight 5, that includes the whole file system and P/Invoke if needed.
For that to work, you'll have to sign your app with a code signing certificate.

silverlight app using both windows and forms authentication

I have a Silverlight RIA application that uses Forms authentication. We want to pass users of a certain domain through Windows authentication and if that fails or user is not part of that domain it falls back to Forms authentication.
Most of the stuff I've found was for aspx sites using methods not available in Silverlight. Many others say it isn't possible. Has anybody managed to do this without to much trouble?
The app is based on the Silverlight Business Application template in VS2010 (SL4).
I don't think this is possible. Ran into the same issue and decided to turn off windows authentication.
See:
http://forums.silverlight.net/forums/t/228703.aspx
http://connect.microsoft.com/VisualStudio/feedback/details/566410/enable-wcf-ria-services-with-forms-authentication-and-integrated-windows-authentication
The second link seems to indicate this is a bug that may be resolved in a future release

Re-using a thirdy party web service using WCF

I have a 3rd party web service, which I intend to use from 2 different applications:
a Windows Workflow (WF) project
a website
Right now, from these 2 apps I manually add the reference to the 3rd party web service & call the required method. This means I have this proxy layer generated in 2 places.
What am looking for is a way to create (am not sure about the correct word to use, sorry guys) the 3rd party web service in one place & have the 2 applications re-use it.
Can this be achieved using WCF, something like wrapping the 3rd party web service in WCF.
Is this approach right?any help or pointers would be a great help, haven't done much service based development.
Environment: The website, the WF project resides on 2 different servers (windows 2003 R2).
Environment(development): windows 7 enterprise/vs 2010 / c#
Thanks
More detail:
Think I dint use the right words in my first query, the following is what am looking for & why I need it that way,I need to call the 3rd party web service from a new WCF service.This new WCF service will be called from other applications(winforms/WF/website) instead of calling the 3rd party service.The idea is to able to switch the 3rd party service(vendore) without changing the implementation & in one place.We use an hr-xml format for request/response & all our vendors(exisiting or future) support the hr-xml format for the industry we are in.If we use a class library, then to change vendor, we should recompile & distribute the dll correct,we dont want to do that. I am not sure about an architecture to be followed to achieve this whole functionaity.Any pointers in the right direction would be a great help.
Thanks
Your quest makes great sense indeed - and I think it should be quite easy to accomplish:
create a new class library assembly ("WebServiceClient" or whatever you want to call it)
inside that new project, do you Add Service Reference - this will create the necessary WCF proxy classes and the config file
compile that class library
From both your apps, you should be able to reference that web service client assembly, and use it - you have the code for the client side proxy only inside that common assembly, but you can use it from any number of apps.
One point to remember: you will need to copy&paste the config for the web service to the main application's config (app.config for a Winforms/console app, web.config for a website/web app) since it cannot be read directly from a class library's config file (that won't be used by .NET).
In this case, I think, WCF service will be the gr8 idea. You dont want to recombile the client applications if the vendor is changed.