How can I add a prefix to a WCF ServiceContract Namespace

Posted by Lodewijk on Stack Overflow See other posts from Stack Overflow or by Lodewijk
Published on 2010-03-22T19:46:09Z Indexed on 2010/03/22 19:51 UTC
Read the original article Hit count: 713

Filed under:
|
|
|

Hi,

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:

[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);
}

This listens to the correct soap-messages. However, I need the soap-body to begin with

<u:Browse xmlns-u="urn:schemas-upnp-org:service:ContentDirectory:1">

and WCF is now listening to:

<Browse xmlns="urn:schemas-upnp-org:service:ContentDirectory:1">

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?

© Stack Overflow or respective owner

Related posts about upnp

Related posts about wcf