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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Service returning Object fails when object is complex class

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :WCF

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;



View Complete Post

More Related Resource Links

Building a Custom Data Grid: Performing Ad Hoc Web Reporting with a VBScript 5.0 Class Object


A flexible, customizable grid for displaying data is a useful tool for ASP developers. It allows Web visitors to customize their view of your data. This article takes the data grid presented in "Ad Hoc Web Reporting with ADO 2.0" by John Papa and Charles Caison (MIND, December 1998) and adds handy features such as a finds feature that supports multiple finds and a mode for adding and editing records. This version also improves response time by allowing asynchronous record download and it componentizes the code so it can be used as a standalone VBScript class object that can be reused in other pages.

Randall Kindig

MSDN Magazine July 2000

send data in class object from one page to another using session


hello everybody

now i hav stored all data like user name, data fatched from database of that user

and i stored that data and user name such as:

string strUserName="user name"

dataset ds =new dataset();// data of that user

now i wan yo send d whole data from my login page to user profile page

can anybody help me for that...................

and plz tell me that how much is this way is benifitial to send data from one page to another page

plz........kindly waiting for positive rply

MCTS 70-503 Practice exam about service object instancing

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?

Calling a method with a class object as parameter data type.

   [WebMethod]    public string GetInfo(Customer inCust)    {        // Code in here    } I have a web service that resides on a remote server. I want to call a public method of theweb service named  "GetInfo". The method is shown above. The web service method expects a class object oftype "Customer". What I did to create a Customer object was to define in my asp.net project my own class named "Customer" which is exactlythe same as the class that belongs to the web service project on the remote server. I then created an instance of Customerand tried to call the web service passing in an object of type customer : my.Service ws = new my.Service(); // Get web service connectionCustomer aCustomer = new Customer();aCustomer.Initialize();ws.GetInfo(aCustomer) // call web service passing in a Customer object The problem is that the compiler gives me the following error: Value of type '_Default.Customer' cannot be converted to 'ws.Class1'. Here Default is refering to my Default.aspx.cs code. Why is this? Do I need to Cast my "aCustomer" class object to a type ofws.Customer ? How do I do that?

Using extensions with Object Class and Page in WPF

I don't usually ask a question without trying it first, but hey, why not.  Searching for this one is not exactly easy. I am wondering if I can use extensions with Object and if they (the variables) will subsequently be available for use in a Page partial class generated for WPF?  By this I mean in the same project and assembly. BTW, I won't be offended by posts pointing out why not to do this with Object.  The why in this case is something as basic as having one base class that contain: bYes = True; bNo = False; Now of course, having a base class is not going to work with something like Page... There may be much better ways to this, what I do not want is syntax MyBaseInstance.bYes and MyBaseInstance.bNo in MyPageInstance and bYes or bNo everywhere else.  Any advice? Regards,  Dave Horsman

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 ?

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

Unable to Create Object Variable for Linq Data Class


For some unknown reason I suddenly am unable to create an object variable for a Linq Data Class. If I create a new project and try the process again with the same database everything works as advertized.

The code I am using is Dim db As New RoggDataContext  which gives me an error on the object variable "db": Overload resolution failed because no accessibility 'NEW'  accepts this number of arguments.

I have looked inside every file in the Web Project like the web config to check the connection string, gobal, and designer.vb looking for any errors whit no JOY.  I also tried to create a new form and code behind with a button and received the same error.

This is mind blowing because as I already stated, I can create a new Web Site and the problem goes away.

Any help is appreciated!



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

How to recognise obsolate object from isolated storage whose class has been changed?

<!-- [if gte mso 10]> <mce:style>


Our company is building a word add-in (document-level add-in) with visual studio 2008, word 2007 and VSTO 3.0 sp1

There is one issue that causes us a headache. It is related to obsolete objects in isolated storage.

In Word add-in we serialize object and save it to isolated storage. Later we can load that object from isolated storage and use it in our application.

The problem occurs in following scenario:

-We are working in Word add-in and save one serialized object to isolated storage

-Turn of Word add-in and change code of the class whose instance we have saved in isolated storage

-Work in word add-in again and load and deserialize object from isolated storage. This object is of obsolete class and code usually breaks here or later in code when we are trying to access changed content.

If this scenario happens, we will clear obsolete object from isolated storage. Issue is how to recognize that object’s class is changed?

We tried to recognize changes in the following ways:

·       &

how to create class and acess member using object

hi i am a new user to C# .net can any body help me to write a new class in c# AND HOW TO ACESS methods and members using its object thnks in advance

WCF returns private members of the object instead of returning the Public members



I am  using WCF to return a serialized custom object to a web page which access the WCF using a script manager. The problem here is the object returned all the private members instead of the public members although the private members are marked private.

The flow behind this: the asp.net  web site stores the object in SQL State session; all the classes in the object are marked serialized as it is stored in SQL State Session. All the public properties in the classes are marked as <DataMember>. When trying to access this object from the client it lists down all the private members of the class instead of listing the public members.

Please advice!

Many Thanks




How to update value directly in class Object using Linq



I have a class object which is basically kind of hierarchy and looks like this when I convert that to XML.


  	<SKU>SKU 1</SKU> 
	<ConfigurationStatus>Not Configurable</ConfigurationStatus> 
  			<SKU>SKU 2</SKU> 
  			<ConfigurationStatus>Not Configurable</ConfigurationStatus> 
  					<SKU>SKU 3</SKU> 
		  			<ConfigurationStatus>Not Configurable</ConfigurationStatus> 



So you can see that I have "objectComponent" which is kind of hierarchy and that hierarchy can be upto any level.

Now I need to update <quantity> value where <sk

MOSS 2007 to SharePoint 2010 Upgrade Fails - Object with Id 57bdacb5-31fe-4f4c-bdb3-3caf048474bd and


Ok apart from deleting these Classes and Objects what else can be done. Any one know a way around. Just to help you find them if you have a similar error look in the Classes and Objects Tables in the Offending database listed in the error message. In this error message below it is SharePoint_Config. How I found them,  yes its like looking for a needle in a hey stack see this post, very handly sql query.

I have a copy of a VM I can create again so I am going to try deleting these and if this works I will Answer my own post. This of course is unsupported and purely a hack hence why I am posting searching for enlightenment. Of course I have other errors so this may merely negate the first one.



[psconfigui] [SPConfigurationDatabaseSequence2] [INFO] [9/30/2010 3:44:42 PM]: SPConfigurationDatabase Name=SharePoint_Config
[psconfigui] [SPConfigurationDatabaseSequence2] [WARNING] [9/30/2010 3:44:42 PM]: Object with Id 57bdacb5-31fe-4f4c-bdb3-3caf048474bd and class id 92e1ba91-03dc-4d85-8978-8c6224d84d5e could not be deserialized. Most likely its type is no longer a sub class of SPPersistedObject.
[OWSTIMER] [UserProfileApplicationSequence] [INFO] [9/30/20

how to persist a class object when page PostBack


i have created a user control UserControl.ascx, in Code behind file of UserControl.ascx i have created an object of a class MyClass.cs,
if(!Page.IsPostback) {
objMyClass= new MyClass();
but when i click on button of UserControl.ascx page and try to access objMyClass object then it set as null, so how to persist MyClass object when page PostBack, i wanted to keep object persist till the user access the page, when user goes out of this page then object should distroy?

To keep the object persist, i have used ViewState

So i have made MyClass Serializable and
i have used ViewState to keep my objet persist, but it give the error
like : UserControl is not marked as serializable.

so i have made my UserControl as Serializable, but the problem is still coming.

One more thing is that MyClass is also resposnsible to create some other class object also.

Can any one suggest me correct solution?

Problem i am getting when i try to PersisObject On UserControl

[SerializationException: Type 'ASP.common_grid_UserControl_ascx' in Assembly 'App_Web_44142fbl, Version=, Culture=neutral, PublicKeyToken=null' is not marked as serializable.] System.Runtime.Serialization.FormatterServices.InternalGetSeri

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