Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I try to answer my own question. I hope I'll get much better answers but it would be nice to here what's wrong with my next approach:</p> <pre><code>&lt;!-- only updatable fielsds here --&gt; &lt;xs:complexType name="tProjectBase"&gt; &lt;xs:sequence&gt; &lt;xs:element name="projectnum" type="xs:string" minOccurs="0" /&gt; &lt;xs:element name="description" type="xs:string" minOccurs="0" /&gt; &lt;xs:element name="accepteddate" type="xs:dateTime" minOccurs="0" /&gt; &lt;xs:element name="activeyears" type="xs:int" minOccurs="0" /&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;!-- extending updateble with keys and not updateble --&gt; &lt;xs:complexType name="tProject"&gt; &lt;xs:complexContent&gt; &lt;xs:extension base="tProjectBase"&gt; &lt;xs:sequence&gt; &lt;xs:element name="id" type="xs:int" /&gt; &lt;xs:element name="projectname" type="member"/&gt; &lt;xs:element name="projectcreator" type="xs:string" /&gt; &lt;!--not updatable--&gt; &lt;/xs:sequence&gt; &lt;/xs:extension&gt; &lt;/xs:complexContent&gt; &lt;/xs:complexType&gt; &lt;!-- only keys here --&gt; &lt;xs:complexType name="tProjectKeys"&gt; &lt;xs:choice&gt; &lt;xs:element name="id" type="xs:int"/&gt; &lt;xs:element name="projectname" type="xs:string"/&gt; &lt;/xs:choice&gt; &lt;/xs:complexType&gt; &lt;xs:element name="tUpdateProject"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element name="keys" type="tProjectKeys" /&gt; &lt;xs:element name="project" type="tProjectBase" /&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="tCreateProject"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element name="projectcreator" type="xs:string /&gt; &lt;xs:element name="project" type="tProjectBase" /&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; </code></pre> <ul> <li><p>GetProject</p> <ul> <li>request = tProjectKeys</li> <li>reponse = tProject</li> </ul></li> <li><p>UpdateProject</p> <ul> <li>request = tUpdateProject</li> <li>response = nothing (all messages are supposed to have header which have status)</li> </ul></li> <li><p>CreateProject</p> <ul> <li>request = tCreateProject</li> <li>response = id of the created project</li> </ul></li> </ul> <p>There's problems with this approach also. For example now the keys are "hard-coded". What if some customers would have projectnum as unique and would like to use that as key to update project from external system. Maybe that is the information that their external system uses. So the original question's scheme is more flexible. But which way to go?</p>
 

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