Reputation: 2569
i got the problem, that a WCF service ( generated with svcutil.exe ) generates it's own datatypes, instead of using the ones i already defined..
for example:
The svcutil generated something like this:
public partial class EmailTransactionRequestMsg : object, System.Runtime.Serialization.IExtensibleDataObject
{
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
private int bit_to_setField;
private string country_db_identifierField;
.
.
}
when i actually want it to use the class already exists:
[DataContract(Namespace = "Ps.App.Mailing.MsgQueue.MsgInterfaces")]
public class EmailTransactionRequestMsg
{
[DataMember]
public string country_db_identifier;
[DataMember]
public int bit_to_set;
}
i see that the svcutil service creates a new extensionData-field ( which i don't know for which purpose this is required )
So, how do i get svcutil to use my own class ( because i don't want to cast the objects by every single field )
Thank you all!
Upvotes: 3
Views: 2542
Reputation: 921
Please take a lookat the following svcutil reference:
http://msdn.microsoft.com/en-us/library/aa347733.aspx
especially the /reference: switch which should be exactly what you're looking for.
i see that the svcutil service creates a new extensionData-field ( which i don't know for which purpose this is required )
This is generated for you to help with data contract versioning. If you add a new property to EmailTransactionRequestMsg later but have a client that is using an older assembly without that property defined it will still be able to use the new service and ExtensionDataObject will contain unknown (new) property(ies). Again MSDN should sprovide you with more details: http://msdn.microsoft.com/en-us/library/system.runtime.serialization.extensiondataobject.aspx
Upvotes: 4