XSD Schema - longtomin/FrInMeBa GitHub Wiki

The XSD Schema

the frinme.xsd file gives an overview of the functions of the server. Every restful function has an in.... and out.... xsd schema entry.

Here an example.

<xs:element name="InSignup">
	<xs:complexType>
		<xs:sequence>
			<xs:element type="xs:string" name="Username" />
			<xs:element type="xs:string" name="Password" />
			<xs:element type="xs:string" name="Email" />
		</xs:sequence>
	/xs:complexType>
</xs:element>
<xs:element name="OutSignUp">
	<xs:complexType>
		<xs:choice>
			<xs:sequence>
				<xs:element type="xs:string" name="Username" />
				<xs:element type="xs:int" name="UserID" />
				<xs:element type="xs:string" name="SignUp" />
				<xs:element type="xs:string" name="Reason" />
			</xs:sequence>
			<xs:element type="xs:string" name="Errortext" />
		</xs:choice>
	</xs:complexType>
</xs:element>    

the InSignUp element has a user, a password and a email address, each is a string. Here the password is not user to authenticate the user, it is user to store it for further authentications.

The signup function is checking several things, and returns at the end a xml in the body of the request. This xml is jaxb generated and has a choice. If an error occurred, the errortext is populated, the rest is empty. if everything is ok, the username, userID, Signup and Reason is returned.

Each Out.... XSD element has the Errortext or the result of the function.

Each In.... XSD element has the username and password, to become stateless, plus additional informations like email address, see above or ChatID, UserID, and so on.

We added a shortname xsd schema in the meantime. It is to reduce the traffic between the server and the smartphone client. The signup is now looking ike this.

<!-- Signup Information Input -->
<xs:element name="ISiUp">
	<!-- In Signup User -->
	<xs:complexType>
		<xs:sequence>
			<xs:element type="xs:string" name="UN"/>
			<xs:element type="xs:string" name="PW"/>
			<xs:element type="xs:string" name="E"/>
		</xs:sequence>
	</xs:complexType>
</xs:element>
<!-- Returned Signup Information -->
<xs:element name="OSiUp">
	<!-- Out Signup User -->
	<xs:complexType>
		<xs:choice>
			<xs:sequence>
				<xs:element type="xs:string" name="UN"/>
				<xs:element type="xs:int" name="UID"/>
				<xs:element type="xs:string" name="SU"/>
				<xs:element type="xs:string" name="R"/>
			</xs:sequence>
			<xs:element type="xs:string" name="ET"/>
		</xs:choice>
	</xs:complexType>
</xs:element>
⚠️ **GitHub.com Fallback** ⚠️