Reputation: 315
I’ve been struggling the past day trying to find a way to generate a WCF Service that actually maintains the restrictions that are defined in the originating XSDs. The basic problem is that if I build a contract first service using an XSD that includes restrictions (for example patterns) the restrictions are removed from the WSDL/XSDs that are output when deploying the service.
Here is someone else complaining about the same problem: http://geekswithblogs.net/wojan/archive/2010/12/10/143086.aspx
I’m left with what I think are 2 options:
Thoughts?
Upvotes: 1
Views: 1061
Reputation: 12680
You can replace the built-in WCF generated WSDL by doing something along the lines of what this very good blog post did. That post shows how override the default WCF behavior of generating included references for the XSDs instead creating a single "flat" WSDL document.
The problem I see is that you need a way to communicate the additional XSD restrictions for this process. It's good you aware that you also need to replace the built-in XML serializer to get strict XSD compliance in the soap deserialization process because that is the only way to achieve what you want. Given all the deep customization's you'd need to make to WCF, you may actually want to consider rolling your own custom SOAP stack. I'm not aware of any other .NET framework (Microsoft or 3rd party) that does this.
Upvotes: 0