EF 4 to EF 5 Database Authentication - silverlight-5.0

I have an application developed using EF4, .Net 4.5, Silverlight 5, Ria services.
I want to upgrade from EF4 to EF5, a lot of differences specially on the DBContext.
I was using a custom database authentication in EF4 by implementing the IAuthentication interface in my AuthenticationDomainService class and use the extended WebContextBase class on the client.
I don't know what are the equivalent to these steps on EF5 as I don't have a DomainService class nor AuthenticationDomainService class.
Can anyone give me directions to resolve the issue!!

I was not getting DomainService class due to the absence of WCFRIA.EntityFramework.5.0.0.1 package.
I have install it and I can now have the authentication created.
Hope it can help anyone else.

Related

how to use addin developed with microsoft.sharepoint.dll in other system

I've developed an outlook addin in vs2013. The development machine has sharepoint installed. My code has:
using Microsoft.SharePoint;
But when I run this code on a client machine it shows an error.
enter image description here.In some sites they suggest using Microsoft.SharePoint.Client.dll. Can anyone help?
This won't work as you expected. Microsoft.SharePoint.dll is a server side library which is part of Microsoft SharePoint and hence can neither be referenced nor used otherwise in a client-side environment such as an Outlook add-in.
What you are looking for is Client-Side Object Model, or CSOM for short. However, developing CSOM apps is a completely different story, needs slightly different knowledge and skills. The bad news is most of your SharePoint-related work will have to be redeveloped almost from scratch.
If your SharePoint integration isn't heavy, you might be able to achieve what you want with SharePoint's web services, either REST or SOAP. There an article on MSDN providing insight to various types of SharePoint APIs and providing guidance which API to use in what situation. You shoudl read this first.
we can't use using Microsoft.SharePoint; in sharepoint not installed system.
we need to use using Microsoft.SharePoint.client; for client system and use client object model code.

Using IoC container in a multi-site environment

I am setting up a architecture for a new project. For this project we are using Sitecore 7 CMS. As you may know, Sitecore supports a multi-site environement. This means that 1 IIS instance can be used for multiple sites because Sitecore resolves them to use the right code and content.
For this project I will have the following hierarchy:
Core (generic, site unspecific logic)
Website A
Website B
We should be able to add as many sites as we want. Every site has a Data, Business and Presentation layer.
I also want to use a IoC container such as Castle Windsor, Ninject or Unity. I want a generic container/kernel for the core and then I would like to be able to register class for specific sites. So the classes I register for Website A should not be resolved for Website B
In Unity I guess you could child containers. I did not find a good way to force the application to use the child container when the Sitecore Context meets a certain requirement.
In Ninject I found stuff on contextual bindings, named scopes and modules which I liked very much. I thought I create a NinjectModule with Contextual Bindings and on resolving I would check the context. I did not find a nice and generic way of doing this.
However, after hours of googling I did not find a good example or tutorial on how this could be achieved and how this should be done in the best way.
For now I do not have a preference for which framework I want to use.
Hope some one would shed some light for my problem so that I can make some progress.
Thanks in advance
Look in to Windsor's Handler Selectors. They're a nice solution to multi-tenant applications. Also, Mike Hadlow has a couple of posts about using Handler Selectors in a multi-tenant environment.
I resolved it by using Multi-tenancy in Autofac: https://code.google.com/p/autofac/wiki/MultitenantIntegration

developing custom WSO2 Carbon authenticator clients

I am implementing new authentication methods for WSO2 Carbon. I know there is a pretty good explanation and sample piece of code in this post.
The problem is, what if I want to generate stub and service client components from the sample BE authenticator? What are the steps to follow? Any tools (java2wsdl / wsdl2java, maven plugins,...) or reference tutorial that can help to achieve this in the most straightforward way?
I know there are several existing authenticators (IWA, webseal,...), but they already come with some stub/ui built in the existing repositories. I would be rather interested in being able to develop/generate all the components more or less from scratch rather than having to modify existing code, which is often prone to errors.
Thanks
This is some high level thing.. but hope this is useful.
1st you can develop the BE component as OSGI bundle. Then you can deploy it in /repository/components/dropins directory. Here you need to have a service.xml file to expose as web service (Please refer WebSeal BE component)
Then configure following property in the carbon.xml file.. if BE service has been defined as admin service
true
Open browser and locate your WSDL of new service
https://{ip}:{port}/services/{service name}.wsdl
Then use wsdl2java tool to create the stub class for you. There is a UI tool in WSO2AS product to do it.
Use stub as a dependency for your FE

Splitting Up the Rest Api WADL?

Is there a way to Split up application.wadl in Java environment?
Technology that are in place are
Jersey + Spring + spring MVC .
I want to split only application.wadl so that I can expose only those web services that I will be supporting for backward compatibility for my users. Also the authentication will be based on some different criteria.
Does jersey provide any support for such requirements ?
In general I was not able to find any way to split wadl generation logic by configuration. But here is hack you can perform.
There is class called GenerateWadlTask.java This basically does the wadl generation logic for jersey.
You can just extend this class in your custom application wadl generation task and use it
as per your logic.
For code example just download the jersey server source jar and look at the class. The logic is pretty straight forward.
hope this help.
EDIT:- There is a maven plugin called enunicate http://enunciate.codehaus.org/ That will make your life easy.

Beginner Design pattern question (Web Services involved)

I am a noob to web services world. I need to develop a login validator module and expose it as a service. I want it to be service independent, i.e I should have the option of exposing it as a SOAP service or REST service in the future.
What pattern should I follow ? Sorry if I am unclear in my requirements, I can clarify as per need.
Thanks !!
Edit : I am using Eclipse as an IDE and Jersey libraries. I am not into any framework, simply using the MVC pattern. I find a lot of difference between SOAP ann REST methods, so I want my methods to be implementation independent - i.e I should be easily able to use my method through a SOAP or REST service call as per need. What should I do for maximum flexibility ?
Picking a good MVC framework and understanding how to use it properly can help ensure that your feature is "service independent". Most of the documentation I've read for good frameworks suggest that you keep your business logic separate from your controller.
If you read the documentation for the tools that you use, and ensure that there is a layer between your business logic and your controllers, then that will make the job of switching from SOAP to REST or some other protocol much, much easier.
Since you mentioned you're using Eclipse in your comment below, I'm assuming you are using or are willing to use Java:
Restlets
http://www.restlet.org/
Spring 3.0 REST
http://blog.springsource.com/2009/03/08/rest-in-spring-3-mvc/
Develop your service as a POJO. Make sure to respect staless pattern.
Create an EndPoint class for each publication type you require (Soap, Rest, EJB, JMS, what ever)
Use appropriate standard to expose your EndPoint. For Soap and Rest the JAX-WS api and implementations can do it for you using java annotations on your EndPoint.
That's it !