Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I just started to play with WCF (O'Reilly's WCF book at my hands).
So far I get the point, but now I stumbled into something I can not work around.

The DataContract I use contains an Array of KeyValuePairs, which are defined in a different assembly (My.Lib.MessageParams).
The project itself has a different namespace (My.Wcf.Test1).

When I create the proxy via svcutil I get a proxy class that defines the DataMembers as expected.

Here comes the problem, the proxy gets the same namespace as the one where the DataContract is defined in (my.lib.MessageParams).

Can I somehow adjust this?

I do not want to have the same namespace here (My.Lib.MessageParams)
because of an event I want to fire when a message is receiced.

I tried the following:
[DataContract(Namespace="http://My.Wcf.MessageParameters")]



This now seems to work (I din't change anything, I just ran svcutil multiple times), but the namespace is turned into lowercase now.
As Toli pointed out it should be pascal-cased...
Any idea how to fit this convention?

Any help is kindly appreciated ;)
best regards and have a good day
Andy
Posted
Updated 9-Nov-10 5:29am
v3
Comments
Toli Cuturicu 9-Nov-10 11:21am    
Not answering your question at all, but:
Namespaces should be PascalCased!
hoernchenmeister 9-Nov-10 11:25am    
You are totally right. This happened due to renaming the namespaces for this post... It should just serve as a sample to hide the ugly, companyenforced namespaces I have to use ;)

1 solution

I've had this problem, I changed the namespace name after calling svcutil in the source code :-D
 
Share this answer
 
Comments
hoernchenmeister 9-Nov-10 9:55am    
I already tried this, but honestly I would prefer to know how to do this without having to change the namespace manually over and over again ;)
I am quite new to the topic and I am not sure if this would leat to other problems later on...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900