Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF: Should all datacontracts use the same namespace?
    primarykey
    data
    text
    <p>I have several service contracts exposed over WCF, which use multiple datacontracts. The service is to be consumed by Adobe Flex. I've run into many problems getting Flex to consume the WSDL produced by the server. I used the procedure outlined <a href="http://weblogs.asp.net/pglavich/archive/2010/03/16/making-wcf-output-a-single-wsdl-file-for-interop-purposes.aspx" rel="nofollow">here</a> to squeeze the WSDL into a single file (I used FlatWsdl and not WcfExtras, if it matters).</p> <p>Now I'm getting a bunch of errors when using VS2010's own wsdl.exe tool to extract my metadata. Specifically, I'm getting the following errors:</p> <pre><code>1) Schema validation warning: Schema item 'complexType' named 'ArrayOfKeyValueOfSomeKeySomeValuep1alXzIb' from namespace 'http://schemas.microsoft.com/2003/10/Serialization/Arrays' is invalid. Namespace 'http://My/Wcf/Namespace' is not available to be referenced in this schema. 2) Schema validation warning: Schema item 'complexType' named 'MyComplexType' from namespace 'http://My/Wcf/Namespace' is invalid. Namespace 'http://schemas.datacontract.org/2004/07/My.Real.Namespace' is not available to be referenced in this schema. </code></pre> <p>Now, the Dictionary ("ArrayOfKeyValueOf...") type is apparently defined in an external schema, which is not imported by my WSDL. Please note that SomeKey and SomeValue have a datacontract namespace of My/Wcf/Namespace.</p> <p>As for MyComplexType, the weird thing is that if I change its Datacontract-namespace to the same namespace used by my services, servers, and bindings, then error (2) goes away. I can't figure out why.</p> <p>What I'm asking boils down to two questions:</p> <p>1) How can I add an import directive of an external schema to my WSDL? I saw some solutions on-line that suggested writing a wrapper class around the containers. This is something I would really like to avoid.</p> <p>2) Do I really have to put all my datacontracts into a single namespace? I don't have any technical objection to doing it, but it's going to be very cumbersome to modify the namespace of all datacontracts. Perhaps there's an automated way of achieving this?</p> <p>TIA!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload