Try using the WcfFacility in the host declaration.

<%@ ServiceHost
    Language="C#"
    Debug="true"
    Service="blogService"
    
Factory="Castle.Facilities.WcfIntegration.WindsorServiceHostFactory`1[[Castle.Facilities.WcfIntegration.Rest.RestServiceModel,Castle.Facilities.WcfIntegration]],
 Castle.Facilities.WcfIntegration" %>

along with registering the wcffacility with the container using 
AddFacility<WcfFacility>()

Kind regards
James

On Sep 14, 2010, at 9:35 PM, barroei wrote:

> here is the code i currently have
> Interface:
>    [ServiceContract(Namespace = "http://tests/blogService";)]
>    public interface IBlogServiceAlternate
>    {
>        [OperationContract]
>        [WebGet(UriTemplate = "/")]
>        Post[] GetMyPosts();
>    }
> 
> Implementation Class:
> [ServiceBehavior(ConfigurationName="poxBehavior")]
>    public class AlternateBlogService : IBlogServiceAlternate
>    {
>        private readonly ILogger logger;
> 
>        public AlternateBlogService(ILogger logger)
>        {
>            this.logger = logger;
>        }
> 
>        public Post[] GetMyPosts()
>        {
>            logger.Log("Returned all posts");
> 
>            Post p = new Post
>            {
>                Id = 1,
>                CreatedDate = new DateTime(2009, 5, 1),
>                Title = "My Alternate Interesting Post",
>                Text = "Here is some interesting information"
>            };
> 
>            return new[]
>            {
>               p
>            };
>        }
>    }
> 
> Web.Config
> <system.serviceModel>
>    <behaviors>
>      <endpointBehaviors>
>        <!-- plain old XML -->
>        <behavior name="poxBehavior">
>          <webHttp/>
>        </behavior>
>        <!-- JSON -->
>        <behavior name="jsonBehavior">
>          <enableWebScript  />
>        </behavior>
>      </endpointBehaviors>
>    </behaviors>
>    </system.serviceModel>
> 
> the Service Decleration :
> 
> <%@ ServiceHost Service="blogService"
> Factory="Castle.Facilities.WcfIntegration.DefaultServiceHostFactory,
> Castle.Facilities.WcfIntegration"  %>
> 
> Error:
> 
> - <Fault xmlns="http://schemas.microsoft.com/ws/2005/05/envelope/
> none">
> - <Code>
>  <Value>Sender</Value>
> - <Subcode>
>  <Value xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/
> none">a:DestinationUnreachable</Value>
>  </Subcode>
>  </Code>
> - <Reason>
>  <Text xml:lang="he-IL">The message with To 'http://localhost:50388/
> BlogService.svc/BlogServiceAlternate/GetMyPosts' cannot be processed
> at the receiver, due to an AddressFilter mismatch at the
> EndpointDispatcher. Check that the sender and receiver's
> EndpointAddresses agree.</Text>
>  </Reason>
>  </Fault>
> On 14 ספטמבר, 20:47, barroei <[email protected]> wrote:
>> hey all,
>> i am trying to build a WCF service via Windsor that will implement
>> multiple Endpoints.
>> and each endpoint will be exposed via a diffrent Request Method
>> 
>> 1 for Soap
>> 1 for Rest
>> 
>> like the following example.
>> 
>> is there a way todo that?
>> cause i couldnt find a way to connect the endpoints to the behavior
>> configuration
>> or to set the behavior of the Binding via Code.
>> 
>> Thx
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Castle Project Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/castle-project-users?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to