| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

MPS_XML

This version was saved 16 years, 9 months ago View current version     Page history
Saved by Juri Strumpflohner
on July 17, 2007 at 6:37:59 pm
 

MPS Communication

Information exchange between the Client and Server

 

Info: This page will be continously updated, while more features are added to MPS, which may require changes to the exchanged XML documents.

 

The communication between the mobile client and the server are done by exchanging XML documents over the HTTP protocol. I divided the XML documents into

  • XML strings from the mobile client to the server (Requests)
  • XML strings from the server to the client (Responses)

 


 

Requests

An XML request has an element type, which is used on the server-side to identify which kind of information is needed by the mobile client.

Currently the following types are used:

  • commit:post

    Used to indicate that the XML document contains posts which have to be stored to the DB

  • retrieve:post

    Used to indicate that the client wants to retrieve posts stored in the DB

 

Type: "commit:post"

XML Schema:

<?xml version="1.0" encoding="utf-8"?>

<xs:schema xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="root">

    <xs:complexType>

      <xs:sequence>

        <xs:element minOccurs="1" name="type" type="xs:string" />

        <xs:element minOccurs="1" name="requestBody">

          <xs:complexType>

            <xs:sequence>

              <xs:element minOccurs="1" maxOccurs="unbounded" name="post">

                <xs:complexType>

                  <xs:sequence>

                    <xs:element minOccurs="0" name="id" type="xs:string" />

                    <xs:element minOccurs="1" name="title" type="xs:string" />

                    <xs:element minOccurs="1" name="body" type="xs:string" />

                    <xs:element minOccurs="1" name="user" type="xs:string" />

                  </xs:sequence>

                </xs:complexType>

              </xs:element>

            </xs:sequence>

          </xs:complexType>

        </xs:element>

      </xs:sequence>

    </xs:complexType>

  </xs:element>

</xs:schema>

 

 

Example:

<?xml version="1.0" encoding="ISO-8859-1" ?>

<root>

    <type>commit:post</type>

    <requestBody>

          <post>

                <id>123</id>          

                <title>Post-title</title>

                <body>Post-body</body>

                <user>Juri</user>

          </post>    

    </requestBody>

</root>

 

Type: "retrieve:post"

XML Schema:

<?xml version="1.0" encoding="utf-8"?>

<xs:schema xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="root">

    <xs:complexType>

      <xs:sequence>

        <xs:element minOccurs="1" name="type" type="xs:string" />

        <xs:element minOccurs="1" name="requestBody">

          <xs:complexType>

            <xs:sequence>

              <xs:element minOccurs="1" name="param" type="xs:string" />

              <xs:element minOccurs="1" name="user" type="xs:string" />

            </xs:sequence>

          </xs:complexType>

        </xs:element>

      </xs:sequence>

    </xs:complexType>

  </xs:element>

</xs:schema>

 
Example:
<?xml version="1.0" encoding="ISO-8859-1" ?>

<root>

    <type>retrieve:post</type>

    <requestBody>

          <param>all</param>

          <user>Juri</user>

    </requestBody>

</root>

 

 

Responses

XML responses from the server can have the following types:
  • data:post

    For indicating that a list of posts can be transmitted to the client

 

Type: "data:post"

XML Schema:

<?xml version="1.0" encoding="utf-8"?>

<xs:schema xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="root">

    <xs:complexType>

      <xs:sequence>

        <xs:element minOccurs="1" name="type" type="xs:string" />

        <xs:element minOccurs="1" name="responseBody">

          <xs:complexType>

            <xs:sequence>

              <xs:element minOccurs="1" maxOccurs="unbounded" name="post">

                <xs:complexType>

                  <xs:sequence>

                    <xs:element minOccurs="1" name="id" type="xs:string" />

                    <xs:element minOccurs="1" name="title" type="xs:string" />

                    <xs:element minOccurs="1" name="body" type="xs:string" />

                    <xs:element minOccurs="1" name="user" type="xs:string" />

                  </xs:sequence>

                </xs:complexType>

              </xs:element>

            </xs:sequence>

          </xs:complexType>

        </xs:element>

      </xs:sequence>

    </xs:complexType>

  </xs:element>

</xs:schema>

 

 

Example:

<?xml version="1.0" encoding="ISO-8859-1" ?>

<root>

    <type>data:post</type>

    <responseBody>

        <post>

            <id>123</id>

            <title>Post-title</title>

            <body>Post-body</body>

            <user>Juri</user>

        </post>

        <post>

            <id>542</id>

            <title>Post-title</title>

            <body>Post-body</body>

            <user>First-life user</user>

        </post>       

    </responseBody>

</root>

Comments (0)

You don't have permission to comment on this page.