1

We have to implement a provided external API. This API cannot be changed. For this API, SOAP messages are exchanged, and one of them dealing with fault exception is like that :

<h:Parent xmlns:h="namespace1">
    <Member xmlns="namespace2">0</Member>
</h:Parent>

While we can implement this with other frameworks such as asmx, we do not succeed in doing it in WCF : data member seems to have the same namespace as the datacontract. Is there a way to add a namespace for datamember ?

Thanks a lot

1 Answers1

0

You can change the namespace associated to the Member data contract using the Namespace property.

vc 74
  • 37,131
  • 7
  • 73
  • 89
  • Do you have a sample of code for that ? Because I think this will change the namespace for the datacontract and for the member, and not just for the member. – user2532237 Jun 29 '13 at 05:49
  • I mean add the namespace attribue to the contract of the Member class, not the Parent – vc 74 Jun 29 '13 at 11:46
  • i have understood what you meant, but data member has not this "namespace" attribute. If it works on your WCF, could you please show me the code ? I may have missed something as we are totally new on WCF. – user2532237 Jun 29 '13 at 15:01
  • The DataMember attribute does not have this property but DataContract does. Add it to the DataContract attribute of the Member data contract, not to the property of type Member. – vc 74 Jun 30 '13 at 08:37
  • Hi. We have tried, but then our SOAP message is like that : ` 0 ` which is not wanted (subNode is not wanted) – user2532237 Jul 01 '13 at 07:06