CSLA 3.7 WSDL Question

CSLA 3.7 WSDL Question

Old forum URL: forums.lhotka.net/forums/t/8406.aspx


dd3000 posted on Monday, January 25, 2010

Since upgrading from CSLA 3.0 to CSLA 3.7 we have noticed that the WSDL definition for one of our webservices now contains information about the Broken Rules Collection:
<s:complexType name="BusinessBaseOfOurClass" abstract="true">
<s:complexContent mixed="false">
<s:extension base="s2:BusinessBase" />
</s:complexContent>
</s:complexType>
<s:complexType name="BusinessBase" abstract="true">
<s:complexContent mixed="false">
<s:extension base="s2:UndoableBase">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="BrokenRulesCollection" type="s2:ArrayOfBrokenRule" />
</s:sequence>
</s:extension>
</s:complexContent>
</s:complexType>
<s:complexType name="UndoableBase" abstract="true">
<s:complexContent mixed="false">
<s:extension base="s2:BindableBase" />
</s:complexContent>
</s:complexType>
<s:complexType name="BindableBase" abstract="true">
<s:complexContent mixed="false">
<s:extension base="s2:MobileObject" />
</s:complexContent>
</s:complexType>
<s:complexType name="MobileObject" abstract="true" />
<s:complexType name="BrokenRule">
<s:complexContent mixed="false">
<s:extension base="s2:MobileObject" />
</s:complexContent>
</s:complexType>
<s:complexType name="ArrayOfBrokenRule">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="BrokenRule" nillable="true" type="s2:BrokenRule" />
</s:sequence>
</s:complexType>

Is there any way to keep the BrokenRulesCollection from appearing in the WSDL? We have a BizTalk orchestration that references this web service and doesn't like the new BrokenRulesCollection sequence. I have already tried hiding the property with a new private BrokenRulesCollection property in the derived class, or applying XmlIgnore or SoapIgnore attributes to the BrokenRulesCollection property, but nothing seems to be working.

I would also appreciate it, if someone could let me know how to get the XML to appear correctly on this forum.


Thanks
David

RockfordLhotka replied on Monday, January 25, 2010

You are exposing your business objects directly as the external interface (contract) for your service?

At the risk of being overly blunt - that's a terrible idea. It is a fundamentally flawed architectural choice.

Services are constructed to expose an immutable contractual interface. Changing that interface should take a concious effort or act, because such changes will break consumers (as you've discovered).

Architecturally, who would want to tie the internal implementation (your objects) to this immutable contract? You can't ever change your object model without breaking the contract - which means you can't ever change your object model. Which means you can't evolve or maintain your application.

A service is a type of interface - no different from a web or Windows interface. No one ever exposes their objects directly through those interfaces - they always have UI code (or data binding) between the interface and the object model.

The exact same thing applies to a service interface. You should never expose your objects directly through a service interface either. You should always have some UI code (or data binding equivalent) between the interface (contract) and the object model.

Certainly CSLA doesn't guarantee it'll maintain the same interface for meta-properties (like BrokenRulesCollection) over time. I try to avoid breaking UI code, but the idea of exposing objects directly as the interface is way outside of any scope I'd consider (mostly because you can probably tell how I feel about doing such a thing :) ).

Copyright (c) Marimer LLC