|
|
|
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&gotonew=1&tid=1390810]: |
0ms |
get settings: |
8ms |
get forum list: |
11ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
170ms |
get topic data: |
9ms |
get first new msg: |
5ms |
get forum data: |
2ms |
get page messages: |
25ms |
get tp. blocked users: |
1ms |
| others: | 228ms |
| total: | 463ms |

| 0 / 0 |
