.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

MCTS 70-503 Practice exam about service object instancing

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :WCF
The question says the default behavior for instancing service object is that each instance is associated with one user-defined service object, but in the book, 'MCTS Self Training Kit', it is said that the default behavior is PerCall. Is this a bug in the practice exam?

View Complete Post

More Related Resource Links

Patterns in Practice: Object Role Stereotypes


Object role stereotypes can help you better understand and clarify the responsibilities of the objects in your application.

Jeremy Miller

MSDN Magazine August 2008

Best Practice for Windows Service "Settings" (Configuration) with .Net (C#) ???

Background:   I'm developing a Windows service using C# and .Net 3.5.  The behavior of the service should be controlled by some settings.  The settings will vary per host-computer but will not vary per user (which should be understandable since the settings control behavior of a service.)  A GUI panel of sorts must be provided to set-up and modify the settings that control the service behavior.Secondly, there is a "locally installed application" that has its own settings and those settings also vary per host-computer so all users of that computer would experience the same settings.  (Seemingly analogous maybe to a connection string but not a connection string.)Note that I do NOT perceive any need for Click-once support, web support, and so forth.  Translation:  I think I need the simplest darn type of settings support, the old "dinosaur" level of requirements not much more sophisticated than INI files used to be. I've researched using the "built-in" settings that make use of the Settings Visual Designer in VS 2008 and  System.Configuration.ApplicationSettingsBase.  It seems that: 1.  Application Settings cannot be changed at runtime.  MSFT documentation indicates the software must be shut down and settings must be modified by patching the XML with a text editor (notepad et al.)  The framework specifically prohibits application settings from being

Suspicious Question on MCTS 70-433 Practice Test

I am preparing to take the 70-433 sometime this week and while doing a practice test last night I came over this question which the answer provided doesn't look correct to me. The question is as follows: You have a table named Pets, which contains the following columns: petName, which stores the name of the pet ownerName, which stores the name of the pet's owner You also have a table named Owners, which contains the following columns: ownerName, which stores the name of the owner of one or more pets age, which stores the age of the owner location, which stores the name of the city in which the owner lives You must retrieve the name of each pet whose owner is over the age of 50 and lives in Seattle.  The solution provided by the test was as follows: SELECT   pet.petName FROM   Pets AS pet JOIN (   SELECT age FROM Owners WHERE location = 'Seattle') AS own ON   pet.ownerName = own.ownerName WHERE   own.age > 50 I don't believe this is possible. The join is made on the ownerName column, but the derived tabled 'own' does not contain that column, therefore it cannot be referenced. I set up the example on SSMS and indeed, it did not work. Is this answer wrong? Or am I missing something here? Thank you.

How to use return JSON object from web service as a declared Type?

Hi, I just hit the following issue: I am calling a web service that returns a serialized JSON object let's say: __type, FirstName, LastName (.net object Person with properties FirstName and LastName). __type's value is Test.Person I have created a JS object using Type.registerNameSpace/registerClass called Demo.Person and it is registered on the page using the ScriptManager. Everything is working fine; I am able to get data from the server on the call back. Is it possible to make the returned object from the web service be an instance of the declared JavaScript Demo.Person class? The idea would be to call a method like result.getFullName() on the client side without having to copy all the properties. This is just a simple scenario for more complex objects.   Thanks,   Teo

passing messageContract object to a WCF Service method using Soap - not as a method parameter

i want a web application to create a service reference to my WCF service, insert information to the header of the soap call and call my WCF method. my WCF supports soap operations (also there is an endpoint in the config). i read about MessageContract attribute and declared one in the interface file: [ServiceContract] public interface IBasicService { [OperationContract] [WebGet(UriTemplate = "GetData?value={value}")] // Add support for HTTP GET Requests string GetData(int value); } [MessageContract] public class BasicServiceHeader { [MessageHeader] public string myString; } the implementation of the contract : public class BasicService : IBasicService { public string GetData(int value) { return string.Format("You entered: {0}", value); } } i don't want the BasicServiceHeader to be passed as a parameter of GetData function , i want to keep the function signature as it is (without a BasicServiceHeader parameter) and to extract the BasicServiceHeader inside the function, (just like using soapHeader) can i do that ?

Send/open timeouts on WAS-hosted WCF service with named pipe orTCP binding, per-call instancing

We have a client that sends requests to a per-call WCF service (WAS hosted, NP binding, same machine) in a loop. The WCF service calls an external EXE to process requests. The operations on the service can take a few seconds, or a few hours. To combat this, we have sendTimeout=00:05:00, receiveTimeout=00:05:00 and a built-in circuit-breaker on the service that kills the external process after 00:05:00. Any service-side errors are returned to the client as FaultExceptions.  On the client, FaultExceptions are logged and the client proxy is aborted (proxy.Abort()). The client has configurable multithreading. In this example, it is running 3 threads, each of which creates a proxy, makes a call, and closes the proxy (or aborts it if an exception was received). Since the service is instanced as per-call, and it never receives more than 3 simultaneous calls (each of which being followed by a .Close() or .Abort() on the proxy), I would not expect the client to be getting timeouts during the send, but I am. In fact, the send timeouts I am receiving would seem to imply that the WCF service is hitting the default session limit, even though the class is explicitly marked with [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]. I put some trace logging on the client and I can see that the timeout is occurring when the proxy is being created. sendTimeout seems to

passing XMLDocument object as input to WCF service



i have to write a WCF service which accepts XMLDocument object as input.

In my contract, I have defined a function like this:

bool validate(XmlDocument doc);

In my service, the function is implemented llke this:

public bool validate(XMLDocument doc)


code to validate the doc against an XSD file

From my test project i am passing an XML document.

But it says service cannot be found.

Instead if i define XMLDocument doc inside function like this:

public bool validate()


XMLDocument doc= path of document

code to validate the doc against an XSD file

and contract like this:

bool validate();

it works fine.

It validates the XML against an XSD and returns true or false.

Please help.

QuotaExceededException only when service returns a FaultException where T is a rather big object


I receive a QuotaExceededException when the service returns an object via FaultException<T>. If the same object is returned directly as the result of the WCF Operation, then everything works perfectly. Any Idea ?

Here is the stack trace :

---- Exception ----
[QuotaExceededException] The size necessary to buffer the XML content exceeded the buffer quota.

Server stack trace:
   at System.ServiceModel.Channels.BufferedOutputStream.WriteCore(Byte[] buffer, Int32 offset, Int32 size)
   at System.ServiceModel.Channels.BufferedOutputStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.Xml.XmlStreamNodeWriter.FlushBuffer()
   at System.Xml.XmlBinaryNodeWriter.FlushBuffer()
   at System.Xml.XmlStreamNodeWriter.GetBuffer(Int32 count, Int32& offset)
   at System.Xml.XmlStreamNodeWriter.UnsafeWriteUTF8Chars(Char* chars, Int32 charCount)
   at System.Xml.XmlBinaryNodeWriter.UnsafeWriteName(Char* chars, Int32 charCount)
   at System.Xml.XmlBinaryNodeWriter.WriteName(String s)
   at System.Xml.XmlBinaryNodeWriter.WriteXmlnsAttribute(String prefix, String ns)
   at System.Xml.XmlBaseWriter.NamespaceManager.DeclareNamespaces(XmlNodeWriter writer)
   at System.Xml.XmlBaseWriter.Wr

Component Service Error; Where is the object?


Has anyone seen this before?

The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID {000C101C-0000-0000-C000-000000000046} to the user QUILNET\SPFarmAccount SID (S-1-5-21-174560267-3847720226-3386768351-2185) from address LocalHost (Using LRPC). This security permission can be modified using the Component Services administrative tool.

I looked for 000C101C-0000-0000-C000-000000000046 in the component services MMC but I couldn't even find any existance of it to change the permissions. any ideas?


Owner, Quilnet Solutions

Best practice for WCF service exposing multiple client-specific endpoints?


Moving forward with re-designing a web service architecture using WCF, our team has been discussing how we want to expose the endpoints. Example: I have a standard endpoint that all users could use with the proper token, but I also have some number of endpoints that will instead use certificate security. All endpoints will ultimately use the same implementation, so this is really just different ways of getting in to the system.

The certificate endpoints will have to point to a specific certificate in the store so will only work for one specific client. The thought is that our standard service could live at http://mysite.com/MyService.svc and the certificate endpoints would be something like http://mysite.com/MyService.svc/Acme. The concern here is that I'm effectively putting our client list into our WSDL, which is not desirable.

What's the best practice here? Is there a way to direct multiple clients through a single certificate endpoint and get the cert on the code side (how would we know which client we're dealing with without a sp

CreateDocument method in CMIS Object Service raising the Constraint Violation Exception


HI All,

Below are the code snippet for rasing the above exception like  "The operation violates a Repository- or Object-level constraint defined in the CMIS domain model. "


ObjectServicePortClient objectService = new TestCMISWinApp.ObjectService.ObjectServicePortClient("BasicHttpBinding_IObjectServicePort");

objectService.ClientCredentials.Windows.AllowNtlm =



Will it be a good practice to submit form data through web service method?



I am trying to submit my form's data to database using asmx Web Service method(Through AJAX extension methods i.e., Script callback method). My form contains lot of data, though only text data.This will be a very fast process,but still i want to get some advice from you expert persons that should i processd in the same way ?Or should i submit form data in the traditional way ?

Please give proper reason for your answer.

Service returning Object fails when object is complex class


Hi. I have created a WPF client and a self-hosted WCF Service based on an interface, in wich alle methods returns a standard response class. An example of one such method definition is:

Response CreateAccount(AccountCreationParams accountParams);


The response object is defined as:



public class Response



public string ResponseText;


public bool CompletedSuccesfully;



Can add web service reference but cannot see it in object browser or use it


I have added the following wsdl: http://burstons.nexcess.net/mom/mom.wsdl to a console app.  I see it under web references, when I right click to view in object browser it is not present.  If I right click Update Web Reference I get the error: The custom tool MSDISCOCodeGenerator failed.  Unable to import binding 'BlueAcornWebserviceBinding from namespace urn: WSDLMOM...  I can access this WSDL in Foxpro but not in Visual Studio 2008... Am I missing something...


Pass object to web service


I'd like to pass an object (Digital Persona featureset) to a web service.  Can't seem to find a good way to serialize it.

Any suggestions?


error using a custom collection object in a WCF service


I'm relatively new to WCF but have gotten most of my service to work very well. I'm having one "strange" problem: My service makes use of several custom data types, and all of them work fine except for the custom collections. Note...I am NOT trying to pass a collection object to the client...I am simply trying to initalize and use it from the main service object. Here is an example:

<ServiceBehavior(InstanceContextMode:=InstanceContextMode.PerSession)> _
Public Class User
    Implements IUser

    Public Memberships As new Memberships   ' this is the collection I am calling!

    Public Function countMemberships() as integer Implements IUser.countMemberships
         return Me.Memberships.count       'this returns an error! Object reference not set to an instance of the object...

    End Function 

End Class

' and here is my custom colection 

Public Class Memberships
    Inherits System.Collections.CollectionBase

    Public Sub Add(ByRef Membership As Membership)
    End Sub


Passing an object with a TimeSpan field to web service resets the TimeSpan to 00:00:00


Hello all,


I have a web service that takes a TaskGroupRecord object as a parameter. This object is defined as:

  public class TaskGroupRecord
    public Guid TaskGroupID { get; set; }
    public string Name { get; set; }
    public DateTime StartDate { get; set; }
    public TimeSpan Duration { get; set; }
    public RepeatSchedule Schedule { get; set; }

    public TaskGroupRecord()
      //TaskGroupID = Guid.Empty;
      //Name = string.Empty;
      //StartDate = DateTime.MaxValue;
      //Duration = new TimeSpan();
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend