#Id/#Ref is unresolved

219 Views Asked by At

I have created a very simple Web Service using WCF/.NET framework 4.0 (C#). I have generated a WSDL file using the svcutil.exe utility. When I import the WSDL file using Eclipse (Java EE), I get the following errors:

XSD: Attribute reference 'http://schemas.microsoft.com/2003/10/Serialization/#Id' is unresolved XSD: Attribute reference 'http://schemas.microsoft.com/2003/10/Serialization/#Ref' is unresolved

I am using the DataContractSerializer with reference preservation turned on using:

[DataContract(IsReference = true)]

When I turn this option off, the error above, disappears. I have also flatten my WSDL file as suggested in another thread here on SO.

1

There are 1 best solutions below

0
On

If you don't need to preserve references in Java, turn off IsReference, and instead turn on "preserveObjectReferences". You can do this via an overload of the DataContractSerializer constructor, via the DataContractSerializerOperationBehavior attribute, or via the config file.