|
|
|
WebService: Как правильно вернуть унаследованный класс?
|
|||
|---|---|---|---|
|
#18+
Есть следующий код: [WebService] [System.Xml.Serialization.XmlIncludeAttribute(typeof(Response))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(Request))] public class PX : System.Web.Services.WebService { ...... [WebMethod] public GetDictionariesResponse GetDictionaries( GetDictionariesRequest request) { .... } ....... } [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetDictionariesRequest))] public class Request { public int val1 } [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetDictionariesResponse))] public class Response { public int val1; } public class GetDictionariesResponse : Response { public int val2; } public class GetDictionariesRequest : Request { public int val2; } В результате для метода GetDictionaries GetDictionariesResponse не включает в себя val1, хотя для GetDictionariesRequest все нормально. В чем дело? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.08.2006, 17:53 |
|
||
|
|

start [/forum/topic.php?fid=18&fpage=910&tid=1390810]: |
0ms |
get settings: |
5ms |
get forum list: |
16ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
98ms |
get topic data: |
5ms |
get forum data: |
1ms |
get page messages: |
13ms |
get tp. blocked users: |
1ms |
| others: | 207ms |
| total: | 354ms |

| 0 / 0 |
