473,568 Members | 2,923 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WCF: How do I attribute a base .NET class ?

I defined a WCF callback contract:
<ServiceContrac t()_
Interface IEBAPEvents
'this interface defines the events to be triggered in the clients
'the EBAP pattern defines two events: a progress event and a completion
event

<OperationContr act(IsOneWay:=T rue)_
Sub OnProgressChang ed(ByVal e As FindFilesProgre ssChangedEventA rgs)

<OperationContr act(IsOneWay:=T rue)_
Sub OnFindFilesComp leted(ByVal e As FindFilesComple tedEventArgs)
End Interface

and the event args:

<DataContract() _
Public Class FindFilesProgre ssChangedEventA rgs
Inherits ProgressChanged EventArgs
...

<DataContract() _
Public Class FindFilesComple tedEventArgs
Inherits AsyncCompletedE ventArgs
When starting the WCF host an error message appears:
Error: Type 'System.Compone ntModel.Progres sChangedEventAr gs' cannot be seria
d. Consider marking it with the DataContractAtt ribute attribute, and marking
of its members you want serialized with the DataMemberAttri bute attribute.

How do I add an attribute to the .NET class ProgressChanged EventArgs ?

thank you very much
herbert
Sep 1 '07 #1
2 1724
Have you tried adding the Serializable attribute?
See example below. You need to "attribute up" both the base class, and
subclass.

using System;
using System.Collecti ons.Generic;
using System.Text;
using System.ServiceM odel;
using System.Collecti ons.ObjectModel ;
using System.Runtime. Serialization;

namespace MyCompany.MyApp lication
{

[Serializable]
[DataContract]
public class HelpDeskTicketD ifficulty
{

[DataMember]
private Guid _helpDeskTicket DifficultyUUID;

[DataMember]
private int _helpDeskTicket DifficultyID;

[DataMember]
private string _helpDeskTicket DifficultyName = string.Empty ;
public HelpDeskTicketD ifficulty() { } //unnecessary, but a
placeholder

public HelpDeskTicketD ifficulty(Syste m.Guid
helpDeskTicketD ifficultyUUID, int helpDeskTicketD ifficultyID, string
helpDeskTicketD ifficultyName)
{
this._helpDeskT icketDifficulty UUID =
helpDeskTicketD ifficultyUUID;
this._helpDeskT icketDifficulty ID = helpDeskTicketD ifficultyID;
this._helpDeskT icketDifficulty Name =
helpDeskTicketD ifficultyName;
}
#region A

public Guid HelpDeskTicketD ifficultyUUID
{
get
{
return this._helpDeskT icketDifficulty UUID;
}
set
{
this._helpDeskT icketDifficulty UUID = value;
}
}
public int HelpDeskTicketD ifficultyID
{
get
{
return _helpDeskTicket DifficultyID;
}
set
{
_helpDeskTicket DifficultyID = value;
}
}

public string HelpDeskTicketD ifficultyName
{
get
{
return _helpDeskTicket DifficultyName;
}
set
{
_helpDeskTicket DifficultyName = value;
}
}
#endregion

}
}



"herbert" <he*****@discus sions.microsoft .comwrote in message
news:8C******** *************** ***********@mic rosoft.com...
>I defined a WCF callback contract:
<ServiceContrac t()_
Interface IEBAPEvents
'this interface defines the events to be triggered in the clients
'the EBAP pattern defines two events: a progress event and a completion
event

<OperationContr act(IsOneWay:=T rue)_
Sub OnProgressChang ed(ByVal e As FindFilesProgre ssChangedEventA rgs)

<OperationContr act(IsOneWay:=T rue)_
Sub OnFindFilesComp leted(ByVal e As FindFilesComple tedEventArgs)
End Interface

and the event args:

<DataContract() _
Public Class FindFilesProgre ssChangedEventA rgs
Inherits ProgressChanged EventArgs
...

<DataContract() _
Public Class FindFilesComple tedEventArgs
Inherits AsyncCompletedE ventArgs
When starting the WCF host an error message appears:
Error: Type 'System.Compone ntModel.Progres sChangedEventAr gs' cannot be
seria
d. Consider marking it with the DataContractAtt ribute attribute, and
marking
of its members you want serialized with the DataMemberAttri bute attribute.

How do I add an attribute to the .NET class ProgressChanged EventArgs ?

thank you very much
herbert

Sep 5 '07 #2
The Serialize() attribute does not help.
herbert
Sep 5 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2025
by: Gabriel Genellina | last post by:
Hi In the following code sample, I have: - a Worker class, which could have a lot of methods and attributes. In particular, it has a 'bar' attribute. This class can be modified as needed. - a Base class (old-style) which defines a default class attribute 'bar' too. I can't modify the source code of this class. Note that Workes does not...
7
3642
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc. And i have things to offer, and to request. And a lot of ideas, but who needs them.... here's an example (from type_struct.py):
5
1462
by: Russell Warren | last post by:
I just ran across a case which seems like an odd exception to either what I understand as the "normal" variable lookup scheme in an instance/object heirarchy, or to the rules regarding variable usage before creation. Check this out: >>> class foo(object): .... I = 1 .... def __init__(self): .... print self.__dict__ .... ...
1
10976
by: adacai | last post by:
I'm now trying to use WCF for our SOA archecture, but I found the svcutil generated proxy a bit confused. Take the following code public interface ICatalog { Hashtable GetItems();
5
2922
by: Jonathan Kay | last post by:
Hi, I'd like to my WCF webservice to work both on SSL and without. Unfortunately searching has led to dead ends, references to changes that only work on the old previous beta versions and I admit I am rather confused and frustrated. That being said, I'd like some direction in how exactly I'm supposed to accomplish this. Thanks very...
4
17257
by: Dave Burns | last post by:
Hello, I am trying to specify a logical default value for a in a WCF Web Service using basicHttpBinding. I realize that the language defaults are: int - 0 string - null bool - false
16
2391
by: =?Utf-8?B?U3RldmUgQmFya2Vy?= | last post by:
WCF Question Hi guys, I’m pretty new to WCF, and have a basic question about how it works. I’m trying to use WCF to write an “SOA-system”, and am having a few problems. The following analogy explains what I’m trying to do. I have a very simple class:
5
5429
by: =?Utf-8?B?TWFyaw==?= | last post by:
I'm researching what is the best way to create a generic WCF proxy wrapper that has the following requirements: 1. Remove the System.ServiceModel config section requirement for clients. We have our own configuration management that follows our application lifecycle (development/system test/production). Also, most of the proxies we build are...
2
4215
by: Steven Cheng | last post by:
Hi Gary, As for the setting you mentioned, it is used to custimze the received data size limitation of WCF binding(such as NetTcpBinding or HttpBinding). After you have definite a customized Binding setting, you can apply it to your WCF service via the "bindingConfiguration" attribute of each <endpoint> here is a simple WCF service...
0
7605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7917
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7665
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.