OK. I figured out what I wanted to do.
In the WCF project I created a Service Registry Class. I set of the
Request type and the DefaultConcreteTypes for my IAwards and
IAwardRepository.
public class ServicesRegistry:Registry
{
protected override void configure()
{
ForRequestedType<IAwards>().TheDefaultIsConcreteType<Awards>();
ForRequestedType<IAwardRepository>().TheDefaultIsConcreteType<AwardRepository>();
}
}
In the StructureMapServiceHostFactory Constructor I added an
additional StructureMapConfiguration that adds the ServicesRegistry.
public StructureMapServiceHostFactory()
{
StructureMapConfiguration
.ScanAssemblies()
.IncludeTheCallingAssembly()
.With<DefaultConventionScanner>();
StructureMapConfiguration
.AddRegistry(new ServicesRegistry());
}
Work great now!!!!!
On Aug 22, 9:24 am, "Brian and Leslie Walk" <
walkfam...@gmail.com>
wrote:
> Basically I am calling the WCF Awards Service from my Web app and I get the
> 202 - No Default Instance defined for PluginFamily.
> I implemented all the code from your post and that works great. Below is a
> little code snippet of how I have implemented the service, nothing strange
> about it from what I can see.
>
> public class Awards : IAwards
> {
> private readonly Data.IAwardRepository _awardRepository;
>
> public Awards(Data.IAwardRepository awardRepository){_awardRepository =
> awardRepository;}
>
> }
>
> I have seen demos that use the global.asax on the web app to load a
> bootstrapper and use a registry to define the defaults. I find this to be
> the best solution since it is located in a central location. So I am trying
> to do the same thing in WCF but I must be missing something.
>
> Thanks for the help and let me know if I need to post any more information
> that would help.
>
> On Fri, Aug 22, 2008 at 7:55 AM, Jimmy Bogard <
jimmy.bog...@gmail.com>wrote:
>
>
>
> > Would you be able to post the snippet that doesn't work?
>
> > On Fri, Aug 22, 2008 at 4:55 AM,
iwalk....@gmail.com <
walkfam...@gmail.com
> > > wrote:
>
> >> @Jims suggestion I am posting a question I had from his blog.
>
> >> 'I have implemented all of the changes to my app but I am having an
> >> issue setting up the default instance in WCF. I have seen posts that
> >> setup the interface to a concrete class in code(e.g. a Registry), but
> >> I must be missing something when implementing this in WCF, how do you
> >> do this in a WCF app?'
>
> >> On Jul 29, 10:49 pm, Jimmy Bogard <
jimmy.bog...@gmail.com> wrote:
> >> > Yeah, yeah
>
> >> >
http://www.lostechies.com/blogs/jimmy_bogard/archive/2008/07/29/integ.
> >> ..
>
> >> > Maybe further down the line, but I definitely ran into some pain where
> >> > I couldn't use the generic goodness, and there weren't System.Type
> >> > equivalents, mostly around the StructureMapConfiguration stuff. It
> >> > was fun creating the
> >> > IServiceHostFactoryBehaviorInstanceProviderPluginProviderProvider
> >> > implementations, let me tell you...
>
> >> > On Jul 28, 1:22 pm, Jeremy Miller <
jeremydmil...@yahoo.com> wrote:
>
> >> > > I can make a small change to make With<T>() act as "use this anywhere
> >> > > in the entire object graph for only this 'BuildSession'"
>
> >> > > It's not actually that big of a change, and if you're hitting this
> >> > > withWCF, someone else will too.
>
> >> > > You know what would be really, really awesome Jimmy? A blog post on
> >> > > usingWCFwith IoC.- Hide quoted text -
>
> >> > - Show quoted text -- Hide quoted text -