Problems with tempuri (or other namespaces)

Apr 28, 2009 at 3:46 PM
Edited Apr 28, 2009 at 4:26 PM
When you add headers to your client proxy as you show in doc, there is a problem if your name space finish with /. For example http://tempuri.org/.

Why? In SoapHeadersClientHook.cs, line 86. You do this:

string action = contractDescription.Namespace + "/" + contractDescription.Name + "/" + op.Name;

And action, at the end, is "http://tempuri.org//MyContractInterface/TestFunction" with two slashs.

Next, when client interceptor try to recover headers (SoapHeadersClientHook.cs, ln 54)

   if (headersFromAction.TryGetValue(request.Headers.Action, out operationHeaders))

the Action doesn't match

http://tempuri.org/MyContractInterface/TestFunction

is that we need, but we have

http://tempuri.org//MyContractInterface/TestFunction

Pherhaps there is another way to build uris without concat strings, for example:

Uri contractDescriptionUri=new Uri(contractDescription.Namespace);
//uri put slash when convert to string.
string action = contractDescriptionUri.ToString()  + contractDescription.Name + "/" + op.Name;

Thx for your work