Posted: 8/28/2009 11:57:37 AM EDT
| I'm a Java developer and a client reported an issue when I gave them a new WSDL. I'd added a new enumerated datatype that was a union with an existing type and added a new value. It seems that the MS parser/binding/whatever tool doesn't like unions. The schema is WSI compliant and validates through XML Spy but MS still doesn't like it. Anyone deal with this before? |
So ExtendedEnumeration is a union based on BaseEnumeration but it adds three new values for a total of six. |
| I wrote a console app that took the schema (added a complex type with just the extended enumeration as an element). I created a XML document that had one instance of the complex type with the enumerated element set to NewValue1. Using the XmlReader class, the document validated successfully against the schema. So at least at the library/parser level, .NET 3.5 does support union types. |
Pardon my ignorance on the .NET side but are you binding to the schema? Come to think of it I think you can only bind to a WSDL. I recall sending my co-worker a schema and he needed the WSDL. I think the binding process makes each element, enumeration, etc. an object. Maybe this is why it works for you and not for us. Sorry if that was a key detail. Then again, it may not mean anything.
|
|
You can consume the WSDL in a .NET application; that's probably what you're saying (tomatoes and all that) but you only provided the schema for the union type so I can only validate XML against it. |
| I generated a mock web service with a generic Hello World web method in it (outputs a string and takes an enumeration as an input). Taking the WSDL from that web service, I modified it so the enumeration simple type was a union type. The interesting thing is that VS can't figure out how to create the union enumeration in the proxy classes as it would normally do for a simple enumeration. However, VS reverts the input parameter to a string type so you can still use the web method. You just don't have the associated enumeration for it anymore. Is this the same issue your client is running into (the fact the enumeration isn't being created)? |