Questions tagged [servicebehavior]

The “ServiceBehavior” tag applies to scenarios/issues involving the WCF ServiceBehavior attribute, which specifies the internal service-wide execution behavior of a service contract implementation.

The ServiceBehaviorAttribute attribute is applied to a service implementation to specify service-wide execution behavior. (To specify execution behavior at the method level, use the OperationBehaviorAttributeattribute.) This attribute can be applied only to service implementations. ServiceBehaviorAttribute properties are a Windows Communication Foundation (WCF) programming model feature that enables the following behavior properties:

  • The AddressFilterMode property specifies the type of filter that the dispatcher system uses to locate the endpoint that handles requests.
  • The AutomaticSessionShutdown property automatically closes the session when the channel is closed and the service has finished processing any remaining messages.
  • The ConcurrencyMode property controls the internal threading model, enabling support for reentrant or multithreaded services.
  • The ConfigurationName property is used to declare a name for use in the name attribute of the element in a configuration file.
  • The IgnoreExtensionDataObject property enables the run time to ignore extra serialization information that is not required to process the message.
  • The IncludeExceptionDetailInFaults property specifies whether unhandled exceptions in a service are returned as SOAP faults. This is for debugging purposes only.
  • The InstanceContextMode property specifies whether and when services and their service objects are to be recycled during an exchange with a client.
  • The MaxItemsInObjectGraph property to limit on the number of items in an object graph that are serialized.
  • The Name and Namespace properties control the name and namespace for the WSDL expression of the service element.
  • The ReleaseServiceInstanceOnTransactionComplete property specifies whether the service object is recycled when a transaction completes.
  • The TransactionAutoCompleteOnSessionClose property specifies whether outstanding transactions are completed when the session closes.
  • The TransactionIsolationLevel property specifies the transaction isolation level that the contract supports.
  • The TransactionTimeout property specifies the time period within which a transaction must complete or it aborts.
  • The UseSynchronizationContext property indicates whether to synchronize inbound method calls with the user interface thread automatically.
  • The ValidateMustUnderstand property informs the system whether it should confirm that SOAP headers marked as MustUnderstand have, in fact, been understood.

Refer to the following MSDN link for additional information: http://msdn.microsoft.com/en-us/library/system.servicemodel.servicebehaviorattribute.aspx

55 questions
28
votes
8 answers

An error occurred when verifying security for the message

When I try to call a WCF service I am getting the following message "An error occurred when verifying security for the message." When I remove the custom authenication the service works no problem. I can't figure out though what I have misconfigured…
Matt Klepeis
  • 1,724
  • 1
  • 14
  • 25
21
votes
2 answers

WCF ConcurrencyMode Single and InstanceContextMode PerCall

I have an issue with my wcf service config. I would like every call to my service create a new instance of the service. For the concurrency I would like to one call is finished before another start. Thus if I have a service like this…
maxence51
  • 994
  • 1
  • 8
  • 20
14
votes
5 answers

WCF Error "Maximum number of items that can be serialized or deserialized in an object graph is '65536'"

I am receiving the following error on a WCF call: Maximum number of items that can be serialized or deserialized in an object graph is '65536' I've read a ton of forum posts and many of them mention modifying the app.config and web.config to…
Scot
  • 572
  • 1
  • 7
  • 27
8
votes
1 answer

WCF service dataContractSerializer maxItemsInObjectGraph in web.config

I am having issues specifying the dataContractSerializer maxItemsInObjectGraph in host's web.config.
Dave
  • 4,038
  • 9
  • 45
  • 57
8
votes
1 answer

Different Service behaviors per endpoint

The situation We are implementing different sort of security on some WCF service. ClientCertificate, UserName & Password and Anonymous. We have 2 ServiceBehaviorConfigurations, one for httpBinding and one for wsHttpBinding. (We have custom…
6
votes
1 answer

Simple example of IServiceBehavior and ApplyDispatchBehavior

I am trying to Plug Unity into a WCF Service Library with a Service Behavior. I need a simple bare bones example of a Service Behavior. All I want to do is setup my IOC Unity Container on startup of the WCF Service. NOTE: I am not using a WCF…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
5
votes
1 answer

Can you change a BehaviorExtension with WCF configuration?

My site calls a service (let's call it FooService) that requires a very complex set of authentication protocols. The protocols are all wrapped up in a custom ClientCredentials behavior that is declared like this in code: class…
John Wu
  • 50,556
  • 8
  • 44
  • 80
5
votes
1 answer

WCF - Custom Credentials & Security Tokens

I'm fairly new to WCF development and have run into a couple problems whilst learning the framework. I have a service api which must support both REST & SOAP. So far this has been easy to implement especially with WCF4 and routing. I am currently…
Daniel
  • 1,843
  • 2
  • 18
  • 27
5
votes
1 answer

ServiceBehavior for WCF REST

I have a problem configuring a ServiceBehavior for my WCF service. Some background. Basically I am developing a REST service WCF that is supposed to run on IIS. I need to be able to log exceptions thrown by the service (I'm using log4net) and…
4
votes
1 answer

Adding attribute to BehaviorExtensionElement

I'm adding a custom behaviorExtensionElement for WCF and want to add an attribute that can be read when the configured element is being read, e.g.
ConfusedNoob
  • 9,826
  • 14
  • 64
  • 85
3
votes
1 answer

Is it Possible to turn on IncludeExceptionDetailInFaults with castle windsor fluent api?

I am getting this exception. The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the …
Serdar
  • 1,416
  • 2
  • 17
  • 43
3
votes
1 answer

Why is a ServiceBehavior an attribute of the Service Class and not the Contract?

I've found plenty of places where people point out that a ServiceBehavior should be an attribute of the service class and not the contract, and this definitely seems to be the case. Why is this?
djmc
  • 853
  • 9
  • 20
3
votes
1 answer

How many instances exists when a InstanceContextMode.Single WCF service exposes multiple endpoints?

Does the ServiceBehavior setting InstanceContextMode.Single sets a single instance regardless of the number of endpoints?
Jader Dias
  • 88,211
  • 155
  • 421
  • 625
2
votes
1 answer

Is the ServiceBehaviour's namespace important for web service versioning?

Simple, as that... is the ServiceBehaviour's namespace important for web service versioning? Meaning that for forward/backward compatibility of clients to server is this namespace involved in any way? I really didn't understand what is this specific…
Learner
  • 3,297
  • 4
  • 37
  • 62
2
votes
2 answers

WCF - How to attach serviceBehaviors to WCF endpoint (no tag)

I am consuming a third party WCF service and its config is below (a portion of it). I wanted to assign serviceBehaviors to endpoint, but there is no tag here. In this case, how do you assign 'serviceBehaviors'?
CoolArchTek
  • 3,729
  • 12
  • 47
  • 76
1
2 3 4