Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone,

Let me explain my question : i have a shared type let's call it "SharedType".
Then I have multiple wcf services under multiple namespaces using that type example : Service1.SharedType , Service2.SharedType ... Can i serialize all of these under the same xml namespace and name?? each of my clients have a type of name "SharedType" and namespace "www.datacontract.org".I noticed that the first service to run encounters no problem i can use SharedType on the respectif client.When i start the second, i cannont use that type on it's client , it tells me that the type is not expected and that i should use a resolver...
Is there a way to force the acceptance, i need them this way on purpose.
And yeah i use wcf class library not wcf applications.

Thank you :)
Posted
Updated 6-Jul-14 23:41pm
v2

1 solution

You are the author of all services and clients? Consider to extract the datacontracts into one seperate dll and reuse it in all projects.
 
Share this answer
 
Comments
Saph_7 8-Jul-14 10:03am    
That's one solution.But in order to keep the solution as it is, i reconstruct the type under each service manually like this : Service1.SharedType type = new Service1.SharedType(); type.field1 = entrantType.field1; ....type.fieldn = entrantType.fieldn; exhausting but keeps the solution unchanged.

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