title: How can I add a prefix to a WCF ServiceContract Namespace
body: <p>I'm trying to implement an UPnP MediaServer in WCF. I'm slowly getting there, but now I've hit a brick wall. I need to add a prefix to the ServiceContract namespace. Right now I have the following:</p>
  
  <pre><code>[ServiceContract(Namespace = "urn:schemas-upnp-org:service:ContentDirectory:1")]
  public interface  IContentDirectory
  {
      [OperationContract(Action = "urn:schemas-upnp-org:service:ContentDirectory:1#Browse")]
      void Browse(string ObjectID, string BrowseFlag, string Filter, ulong StartingIndex, ulong RequestedCount, string SortCriteria, out string Result, out ulong NumberReturned, out ulong TotalMatches, out ulong UpdateID);
  }
  </code></pre>
  
  <p>This listens to the correct soap-messages. However, I need the soap-body to begin with</p>
  
  <pre><code>&lt;u:Browse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"&gt;
  </code></pre>
  
  <p>and WCF is now listening to:</p>
  
  <pre><code>&lt;Browse xmlns="urn:schemas-upnp-org:service:ContentDirectory:1"&gt;
  </code></pre>
  
  <p>How do I get the prefix there? Does it matter? Or is there another reason why the parameters are not passed into the Browse method?</p>
  
  <p><strong>UPDATE</strong>
  Here's some extra info: The following message is sent by a real UPnP control point. The parameters are <strong>not</strong> passed into the Browse method.</p>
  
  <pre><code>&lt;s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    &lt;s:Header&gt;
      &lt;To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none"&gt;http://XXXXX:8731/ContentDirectory&lt;/To&gt;
      &lt;Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none"&gt;urn:schemas-upnp-org:service:ContentDirectory:1#Browse&lt;/Action&gt;
    &lt;/s:Header&gt;
    &lt;s:Body&gt;
        &lt;u:Browse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"&gt;
           &lt;ObjectID&gt;0&lt;/ObjectID&gt;
           &lt;BrowseFlag&gt;BrowseDirectChildren&lt;/BrowseFlag&gt;
           &lt;Filter&gt;*&lt;/Filter&gt;
           &lt;StartingIndex&gt;0&lt;/StartingIndex&gt;
           &lt;RequestedCount&gt;15&lt;/RequestedCount&gt;
           &lt;SortCriteria /&gt;
        &lt;/u:Browse&gt;
     &lt;/s:Body&gt;
  &lt;/s:Envelope&gt;
  </code></pre>
  
  <p>This is the request that is generated by the WCF test client. Now the parameters are passed into the Browse method:</p>
  
  <pre><code>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    &lt;s:Header&gt;
      &lt;To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none"&gt;http://XXXXXX:8731/ContentDirectory&lt;/To&gt;
      &lt;Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none"&gt;urn:schemas-upnp-org:service:ContentDirectory:1#Browse&lt;/Action&gt;
    &lt;/s:Header&gt;
    &lt;s:Body&gt;
      &lt;Browse xmlns="urn:schemas-upnp-org:service:ContentDirectory:1"&gt;
        &lt;ObjectID&gt;0&lt;/ObjectID&gt;
        &lt;BrowseFlag&gt;BrowseMetadata&lt;/BrowseFlag&gt;
        &lt;Filter&gt;*&lt;/Filter&gt;
        &lt;StartingIndex&gt;0&lt;/StartingIndex&gt;
        &lt;RequestedCount&gt;0&lt;/RequestedCount&gt;
        &lt;SortCriteria i:nil="true" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" /&gt;
      &lt;/Browse&gt;
    &lt;/s:Body&gt;
  &lt;/s:Envelope&gt;
  </code></pre>