Click here to Skip to main content
15,901,035 members

Comments by Wes Payne (Top 2 by date)

Wes Payne 1-Nov-13 20:01pm View    
It looks like someone else managed a more complete copy from the same source. Thanks, though!
Wes Payne 1-Nov-13 20:00pm View    
Thank you for responding! If there was a file attachment, I could not find it.

With only the sample configuration to go with, I am not sure that I understand the answer. I think I have a potential interpretation that is close. Please help me clarify.

1. As with my code, you add a service node to the configuration that may or may not have the same name as the class that implements the service contract, and references a ServiceBehavior (MyServiceBehavior).
2. You add that ServiceBehavior to the configuration (behaviors->servicebehaviors->behavior). I assume this is where I would set all of the service-specific behaviors I would want, as I did in my example with "secureBehavior".
3. Within the service you define a single endpoint, which I imagine covers all requests for that service. This endpoint is bound to "webHttpBinding" type, but no specific binding of that type. The endpoint has no name and an empty address, but references a behavior.
4. You add that EndpointBehavior to the configuration (behaviors->endpointbehaviors->behavior). It has a single, empty webHttp node but no other defined nodes or attributes besides the behavior name (MyWeb).

So it looks like we're adding a single endpoint for the entire REST-ful, routed service, just to have the endpoint so that we can add the webHttpBinding to it. And there is no need to set up a full binding configuration.

I assume that, once this is all done, I won't have HTTP 404 occur with every request if the service should have the same name as the class which implements its service contract.

Also, it looks like somebody else tried to copy from the same place you did. If this is copied from elsewhere, could I have a link to the full document in order to establish more context?