Fredou
Fredou

Reputation: 20140

how to remove namespace on datamember?

I don't have the code with me but basically what I have is a wcf datacontract having about 20 datamember which each one is a custom type.

when sent over the wire, I have

      <datamembername namespace>
            <few properties here>
            <few properties here>
            <few properties here>
      <datamembername>
      <datamembername namespace>
            <few properties here>
            <few properties here>
            <few properties here>
      <datamembername>
      <datamembername namespace>
            <few properties here>
            <few properties here>
            <few properties here>
      <datamembername>

how could I remove the namespace on the datamember?

in one case I return a huge list of that datacontract and 80% of the packet is the namespace.

bandwidth is a problem for me in that case.

Upvotes: 6

Views: 2108

Answers (1)

Fredou
Fredou

Reputation: 20140

by doing this

     [DataContract(Namespace = "")] 

on my custom class, it removed what I needed.

Upvotes: 2

Related Questions