Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to make wsdl that doesn't need to be changed when things change?
    primarykey
    data
    text
    <p>I'm making a CRUD Web Service and I have objects (which are also database records in my system) let's say customer with dozens of attibutes. Some of the attributes can change during the years. In rare occasion they can be renamed which i think is not a problem because that's inner implementation and the attribte names are not needed to be in the interface. However there will be new attributes and i don't know how to handle them correctly.</p> <p>What I was planning to do is like this in schema:</p> <pre><code>&lt;xs:complexType name="tKeyValuePair"&gt; &lt;xs:sequence&gt; &lt;xs:element name="fieldname" type="xs:string" /&gt; &lt;xs:element name="value" type="xs:string" /&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;xs:element name="keyvaluepair" type="tKeyValuePair" /&gt; &lt;xs:complexType name="tKeyValuePairs"&gt; &lt;xs:sequence&gt; &lt;xs:element ref="keyvaluepair" minOccurs="0" maxOccurs="unbounded" /&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;xs:element name="fieldvalues" type="tKeyValuePairs" /&gt; &lt;xs:complexType name="tCustomerBase"&gt; &lt;xs:sequence&gt; &lt;xs:element name="customername" type="xs:string" /&gt; &lt;!-- here are other fields that can't change but can be minOccurs="0"--&gt; &lt;xs:element ref="fieldvalues" /&gt; &lt;/xs:sequence&gt; </code></pre> <p></p> <p>Then I have a type for each operation that extends tCustomerBase like adding customerid in tCustomerUpdate for update to acts as key to find correct customer, adding createuser in tCustomerCreate for insert to store who created it in an other system.</p> <p>Now the fieldvalues are strings and i know that which field should be of which type and i can convert them before db-operation in my WS. </p> <p>But does this make sense? Should I use</p> <pre><code>xsd:any </code></pre> <p>somehow for the rest of the fields? </p> <p>What about using </p> <pre><code>xsd:anyType </code></pre> <p>Could I use that instead of string as type for keyvalue pair's value? I would appreciate help how really to do this right!</p> <p>Besides my question i will be happy to hear any comments about this kinda schema design. So feel free to comment the part of mock-up schema i wrote here!</p> <p>Thanks and Best Reagards -Matti </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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