WCF service client with svcutil (no "extra" clientide-datatype def.)

I had a problem that the WCF service (generated using svcutil.exe) generates its own data types instead of using the ones I already defined.

eg:

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 really want it to use a 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 is creating a new extension for the Data field (which I don't know why this is necessary)

So, how do I get svcutil to use my own class (because I don't want to throw objects over each field)

Thanks everyone!

+3
source share
1 answer

, svcutil:

http://msdn.microsoft.com/en-us/library/aa347733.aspx

/reference:, , .

, svcutil Data- ( , )

, . EmailTransactionRequestMsg , , , , ExtensionDataObject () (). MSDN : http://msdn.microsoft.com/en-us/library/system.runtime.serialization.extensiondataobject.aspx

+4

Source: https://habr.com/ru/post/1711644/


All Articles