tags:

views:

91

answers:

1

Here is my interface

[ServiceContract(Namespace = "")]      
interface IParam     {     }

Here is my class

public class Parameter : IParam
{

    private string categoryName;

    [DataMember]
    public string CategoryName
    {
        get { return categoryName; }
        set { categoryName = value; }
    }


}

My operation contact is

[OperationContract]
string GetSegmentsByCategoryName(Parameter Params);

Here is my main:

Parameter abc = new Parameter ();
abc.CategoryName = "xxx";

str = client.Channel.GetSegmentsByCategoryName(abc);

when I check at wireshark i got this xml

<Params xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;
<CategoryName>
xxx
</CategoryName>
</Params>

i one to get rid of xmlns:i="http://www.w3.org/2001/XMLSchema-instance when I pass the object through wcf httpbinding.

+1  A: 

That isn't the default/element namespace, though - it is simply an unused alias to a namespace that might be used. It isn't actually breaking anything. I would strongly advise to simply leave it alone.

If you really, really wanted to do this - perhaps write a message inspector.

Marc Gravell