WCF / ASMX :: Object Properties Serializing With PropertyName + Specified
Feb 22, 2011
I have a WCF service that when the objects serialize to clients an extra property is getting added with a 'Speficied' suffix. At first I thought it had to to with a couple of nullable type properties, but it is happening to all of my value types even if it is not declared Nullable. How can I get rid of this?
View 1 Replies
Similar Messages:
May 28, 2010
I have an ASMX web service that returns a large dataset. The objects are custom. That is, I am not sending DataSets or other complex objects. I need to chunk the response because it could be large. Following this: http://support.microsoft.com/kb/278998, I have enabled chunked transfer encoding on the server. The client is java. I am doing something along these lines:
connection.setRequestProperty("Range", "bytes=" + rangeStart + "-" + rangeEnd);
int responseCode = connection.getResponseCode();
I see the request property come in on the server side. I see the server build the response. I am tracing the outbound soap, and it appears to be created. I expected to get a response code of 206 back when the response is large. But, I always get 200 (or an error if the request is too large, Request Entity too large on the BlackBerry).What do I need to do on the server side to chunk? I can explore moving to WCF if I have to, but, would rather avoid it. I am guessing I need to implement the chunking while serializing or possibly write a custom HTTP Handler to do it for me. The problem with the serializer approach is, the web service framework is doing the serilization for me. I can take this approach if needed.
View 2 Replies
Feb 14, 2011
I have an object called MyObject that has several properties. MyList is a list of MyObject that I populate with a linq query and then I serialize MyList into json. I end up with something like this
List<MyObject> MyList = new List<MyObject>();
MyList = TheLinqQuery(TheParam);
var TheJson = new System.Web.Script.Serialization.JavaScriptSerializer();
string MyJson = TheJson.Serialize(MyList);
What I want to do is serialize only parts of MyObject. For instance, I might have Property1, Property2...Propertyn and I want MyJson to only include Property3, Property5 and Property8.
I thought of a way to do this by creating a new object with only the properties I want and from there create a new list for the serialization.
View 1 Replies
Jan 11, 2010
Is it possible to serialize object direct from Visual Studio .NET Debug window. I have a very complex object structure which contains multiple sub objects along with List item etc. I mean the Hierarchy is complex. And I need to analyze the object graph closely for that I need an offline view (may be in the from of XML/ Serialization). I can not do that from VS.
(One can reccomend me to use XMLSeriliazation in my code to generate but please consider that may not be alwways possible because of
1. with default .NET Serialization class a complex object which has manu sub objcts with Collection. is not get serialized properly. So need custom serialization & deserilazation code for that, does not come witf Microsoft Librarry.)
2. I am using it somewhere (Silverlift app) where such operation may be not possible.
3. I do not want to spent time creating or evaluating any ones custom serilaization code/tool
View 1 Replies
Mar 22, 2010
I have an Entity Framework data model. Part of the model is a Customer entity. The web service provides a method to get a customer, and to receive an updated version of this customer to be persisted.
To test this, I created a new ASP.NET web Application, (Solution > Add > New Project > ASP.NET Web Application), then added a reference to my service reference using the standard Add Service Reference dialog. I then call the service using the following code:
var client = new CustomerServiceClient();
var customer = client.GetCustomerByID(18); // get it
customer.LimitDown = 100; // change it
client.SaveCustomer(customer); // persist it
Everything works as expected.
Now, I do exactly the same thing, but this time with as ASP.NET Web Site (Solution > Add > New Web Site > ASP.NET Web Site). I add the reference in a similar fashion and copy and paste the code above into the new site. But now I get the following exception thrown on the 4th line:
System.InvalidOperationException The EntityReference object could not be serialized. This type of object cannot be serialized when t RelationshipManager belongs to an entity object that does not implement IEntityWithRelationships.
Source Error:
Line 2474: Line 2475:
public
SkyWalkerCustomerService.OperationResult
SaveCustomer(SkyWalkerCustomerService.Customer[code]....
Googling for this error returns very little. Why doesn't this work?I guess one answer would be to use a web application instead of a web site, but I have an large existing site to which I need to add the service reference, and I'd rather not convert it.
View 1 Replies
Feb 17, 2010
On DBML I have two entities as Parent, Child. I am trying to assign Child class properites in a Parent.
[code]....
I am getting the following Error:
Cannot access a disposed object.
Object name: 'DataContext accessed after Dispose.'.
View 2 Replies
May 10, 2010
I've posted the same question in the Object Data Source forum. This is a link to it http://forums.asp.net/t/1554083.aspx. Maybe I should've posted here to begin with. There seemed to be some overlap so I wasn't sure which was the best on to post the question in.
I'm trying to get a better understanding of how I could've designed my app so that the Object Data Source could work with the properties of my business objects. Please read the other post to see how it's currently being done. Sorry for the link to the other page. I didn't want to post a bunch of duplicate information. I would love to get some suggestions for alternative ways of doing this.
View 1 Replies
Apr 16, 2010
I have a webservice, it has few webmethods. when i create a client proxy and invoke the methods to check its response, i am getting this error. Can someone tell me what things can i check to know the cause of this? The error is not saying much hence blocked on this.
View 1 Replies
Jan 15, 2010
I could really use some help on this one. I've been fighting it now for several days and we are supposed to start testing early next week.I am subscribing to 4 web services all hosted by the same company. The integration with 1, 2 and 3 all went fine, but on the fourth I keep getting the very unhelpful error:
System.Web.Services.Protocols.SoapException = {"Server was unable to process request. ---> Object reference not set to an instance of an object."}
[code]...
View 9 Replies
Feb 5, 2010
I am using logger to record all error information.
When log error informtion we need to
logger.error("User.UserID" & user.userID)
logger.error("User.pw" & user.pw)
And what I am trying to achieve is;
logger.error(myClass.getObjectInfo(user))
and I want myClass.getObjectInfo can list all of the object property along with values.
View 5 Replies
Aug 2, 2010
i have websrvice class in this i declared a webmethod and a public property my problem is i want to acess service class public property in my asp.net web application after creating proxy object.
service class:
[Code]....
View 1 Replies
Dec 7, 2010
Idealy i would like to get a web-page that looks like the popup-windows that you get in Visual Studio when you click an object while debugging. So if the object contains any arrays, i'd also like to see what's in them, and for all those objects inside i would also like to be able to go deeper into those objects.
The reason i'm asking this, is that I can't debug my code locally (because it uses a web-service that will only run on the production), and I can't install Visual Studio on the production server, So i need to be able to actually debug on the production server. I can write my code locally though, and upload it to the production.
View 3 Replies
Sep 4, 2010
I have a 3rd party server side control that generates JavaScript and I'd like to see what methods and properties it exposes.Currently I just type in an invalid function like asdf123() so VS will break and I can add a watch to the variable, but there are a ton of methods and I don't know what I'm looking for (I'm trying to make the control do something undocumented).
View 3 Replies
Jan 28, 2011
I'm working on an application that uses an approach to localization where they just call a translate function for every piece of text on a page. It leads to a lot of redundant code that looks like this (psuedocode):
function page_load():
translateControlText(control1, language);
translateControlText(control2, language);
translateControlText(control3, language);
translateControlText(control4, language);
translateControlText(control5, language);
translateControlText(control6, language);
translateImageAlt(image1, language);
100 more lines of this on a single page
The application is massive, so I don't have the opportunity to rewrite the translation logic. However, I think I could just loop through all of the controls on a page, check their type, and translate the appropriate property. At least then I would just have to call 1 function per page, and then throw it in a base page or master. However, I probably wouldn't want to translate certain things, such as table cells. Regardless, there is an attribute called Localizable that is on many properties such as Control.Text and Image.Alt. I'd like to be able to get a list of every string on the Page that is stored in a Property marked Localizable. Is this possible? Is this possible without reflection?
View 2 Replies
Nov 29, 2010
I'd like to add some custom instance properties to an ASP.Net User object. for example, I'd like to log every user's login and have something like: User.LoginTimes or calculate the User Profile's Completion percentage and be able to access it like: User.ProfileInfoPercentage, etc.
Now What I'd like to know is what would be the best approach to do this?
Forget about user instances? (e.g. define a database table with userid and ProfilePercentage info and retrieve data from profile like: DB.GetProfilePercentage(Context.Current.User.UserID) )
Override the ASP.Net User class and add my own functionalities.
Use Extension methods for the user class.
View 1 Replies
Feb 17, 2011
I'm a junior ASP.NET developer comes from Java background, so may be my question is strange.
I want to build an ascx (asp control) which accept an object as parameter for example :
1- we have a class called Device ( Contains some properties name, color , Specification (another object))
2- we have a control DeviceItem ( Contains Table to view some of the Device properties value ) and contains a property called Device
if the devices object retrieved from the Database and we have an object called device1 from Type Device
is there a direct way to pass the Device object (device1) to the DeviceItem control, some thing like :
<uc1:DeviceItem ID="DeviceItem1" runat="server" Device="THE_DEVICE_OBJECT"/>
and then bind this object to the controller, to show some properties value?
View 4 Replies
Aug 5, 2010
I am interested to know what happens with unused properties of a class when an object is instantiated?
Are there performance hits for having additional unused properties? What about complex properties that are accessing the database, but I'm not using them, are they still being loaded?
View 1 Replies
Apr 22, 2010
I am using ASP.NET MVC 2.0 and I want to transfer my ViewModel properties to business object. I can do this manually or use AutoMapper or use new method available in ASP.NET MVC 2.0. My question is that does anyone know the name of the new method which allows to copy the properties from one object to another?
View 1 Replies
Jan 20, 2010
In the past I've used UserControls to create email templates which I can fill properties on and then use LoadControl and then RenderControl to get the html for which to use for the body text of my email. This was within asp.net webforms.
I'm in the throws of building an mvc website and wanted to do something similar. I've actually considered putting this functionality in a seperate class library and am looking into how I can do this so that in my web layer I can just call EmailTemplate.SubscriptionEmail() which will then generate the html from my template with properties in relevant places (obviously there needs to be parameters for email address etc in there).
I wanted to create a single Render control method for which I can pass a string to the path of the UserControl which is my template. I've come across this on the web that kind of suits my needs:
[code]....
Does that make sense? I was just wondering if this is at all possible in the first place and how I'd implement it? I'm not sure if it would be possible to map the properties set on 'object' to properties on the loaded user control and if it is possible where to start in doing this?
View 1 Replies
Jul 15, 2010
I have advice that this might work for programmatically filling a set of literals from a set of object properties:-
[code]....
However, the line: ctl.Text = pageData.help(i).trim() fails because it's not understood that pageData.help(i) should translate to pageData.help1, pageData.help2, etc.
View 1 Replies
Dec 15, 2010
My web method returns object 'User' that has a lot of properties.
In my 'OnComplete' function I am receiving those object.
[code]....
Question: How can I get values of object properties?
The code above provides me with '[object Object]' text instead of real object value.
View 1 Replies
Aug 27, 2010
I'm trying to retrieve 3 properties from an IEnumerable object. But cant!
The 3 properties are:
serier
dage
stofnavn
This is how the code is
[Code]....
View 3 Replies
Mar 31, 2010
I know how to deploy and retrieve a single element in LINQ, but how can I do to change all the properties in a list. In the line below, I can only modify a record, I would modify several.
_ListaAcaoMenuInfo.Where(p => p.Id_acao == id).FirstOrDefault().Id_menu = 0;
View 3 Replies
Feb 12, 2010
Tables: Article, Author, Comment (1 article and 1 author can have * comments)In the database is 1 article, 1 author and 1 comment.
The problem is, that code
myBD my_bd = new myBD();
var articles = by_bd.Article;
works OK, I can see that an Author and an Article has 1 comment. But that code
var comm = (from u in my_bd.Comment
where ......
select u);
returns the comment but it has NULL values in property Article and Author. Why ?
View 2 Replies
Mar 31, 2010
I'm not sure if I'm asking this correctly, but I'm having a problem with a web service. The company hosting a web service wants to see what I'm submitting to the API. Is there something in the debugger I can use to "print" or somehow get the request object and all of it's properties with values in Visual Studio? I'm guessing there's some way to get the XML request?
View 1 Replies