通过Asp WebService序列化对象属性的属性 [英] Serialize attributes of object's properties through Asp WebService

查看:45
本文介绍了通过Asp WebService序列化对象属性的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用客户端-服务器模型开发Win窗体应用程序.
在服务器上,我使用了ASP Web服务,在客户端上,我通过Web服务首选项调用了服务器.
我在服务器上创建了所有对象,并将它们序列化为客户端,但是我只序列化了它们的属性而没有其属性.

示例:
我在服务器上创建了一个对象:

Hi all,

I''m developing a Win form application with Client-Server model.
At server, I used a ASP Web Service, and at Client, I called the server through a Web Service Preference.
I created all object on Server and serialize them to Client, but I only serialized their properties with out their attribute.

Example:
I created an object on server:

[Serialize()]
public class Customer
{
    public Customer()
    {
    }
     
    [BrowsableAttribute(false)]
    public int Id {get; set;}
    
    [CategoryAttribute ("Customer infomation")]
    [DescriptionAttribute ("Id of customer")]
    public int CustomerId {get; set;}
 
    [CategoryAttribute ("Customer infomation")]
    [DescriptionAttribute ("Name of customer")]
    public string CustomerName {get; set;}
}



在将Customer对象序列化为Client之后,它只有属性,而没有其属性的属性,如下所示:



After I serialized Customer object to Client, it''s has only properties without attributes of it''s properties as behind:

[Serialize()]
public class Customer()
{
    public Customer()
    {
    }
    
    public int Id {get; set;}
        
    public int CustomerId {get; set;}
    
    public string CustomerName {get; set;}
}


请帮帮我!
谢谢!


Please help me!
Thanks!

推荐答案

实际上您不会获得属性....这些属性未进行XML序列化,这就是为什么它不会显示在客户端中的原因代理.
Actually you will not get the properties....The properties are not XML Serialized and that''s why it will not show up in the client proxy.


这篇关于通过Asp WebService序列化对象属性的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆