Silverlight: InstanceContextMode and ConcurrencyMode

Posted on 2010-01-02
Last Modified: 2012-05-08
We have a web service that's accessed from Silverlight that needs to be able to accept multiple requests however it's apparent that's not occurring.  Below are snippets of the service definition and behavior definition, please assist me in understanding why this service won't accept multiple requests.  Thanks in advance!

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class RiteTrackServer
{ ... }

<service behaviorConfiguration="RiteTrackServer.RiteTrackServerBehavior" name="RiteTrackServer.RiteTrackServer">
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="RiteTrackServerBinding" contract="RiteTrackServer.RiteTrackServer"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
Question by:HandelIT
    LVL 25

    Expert Comment

    InstanceContextMode.Single should be used for only singleton lifetime behavior. Are you trying to create singleton object ? else change the InstanceContextMode to "PerSession" or "PerCall"

    Have some clarifications on ur implementation of wcf.

    Good practice or thumb rule for implementing WCF is "ServiceContract" should be used with Interface and "ServiceBehavior" should be used with a class which implements the service.
    LVL 1

    Accepted Solution

    This was resolved by us internally.  The issue was that you needed to remove this line from the service code definition:
        [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]

    And you needed to set this tag in the Web.config to "false":
        <serviceHostingEnvironment aspNetCompatibilityEnabled="false"/>

    Please close this question and refund the points.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Suggested Solutions

    This tutorial will show you how to add an attribute to an XML ( stream returned from a Windows Communication Foundation ( (WCF) Web Service.  Some knowled…
    In previous Articles, we have discussed how we can upload a file using .asmx web service and isolated storage space. Here, in continuation to the topic, I am going to discuss how we can use WCF for the same purpose. Steps: 1.Create the silverli…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now