Interfaces

WSDL Interface

Estimated reading: 11 minutes

Concept

Limbas provides for each table a different WSDL service. These are created dynamically and provide essential database operations. To request the WSDL definition document for the table customers use the following link: http://localhost/limbas/dependent/main_wsdl.php?Service=Kunden&WSDL. Notice that the table name is written in lower case except the first letter which is in upper case.

Furthermore, the access rights on single tables or elements for the WSDL interfaces are administrated in group hierarchies. Thus it is possible to create different user groups for different use cases. If a tables contains links, then these are shown as sub-trees in the XML output of a SOAP response, if the user has also the rights to access these. Authentication is mandatory und depends on the client. It can also be requested from the URL (e.g. http://username:password@mydomain).

Limbas makes intensive use of sessions. To activiate changes on tables or rights, both the sessions and the SOAP cachingfiles have to be deleted. These are saved under /tmp by default, but should be adapted in the php.ini.

Functions

query

Using the query-function, records can easily be selected. In order to query the customers located in Mannheim, use the following request:

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Kundenwsdl">
  <soapenv:Header/>
  <soapenv:Body>
     <urn:query soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <params xsi:type="urn:KundenQuery">
           <ORT xsi:type="xsd:string">Mannheim</ORT>
        </params>
     </urn:query>
  </soapenv:Body>
</soapenv:Envelope>

As a result, all related records are shown in the XML output of the SOAP response:

<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Kundenwsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
  <SOAP-ENV:Body>
     <ns1:queryResponse>
        <return xsi:type="ns1:KundenArray">
           <items xsi:type="ns1:Kunden">
              <ID xsi:type="xsd:integer">6</ID>
              <NAME xsi:type="xsd:string">Blauer See Delikatessen</NAME>
              <NAME_ZUSATZ xsi:type="xsd:string"/>
              <STRASSE xsi:type="xsd:string">Forsterstr. 57</STRASSE>
              <ORT xsi:type="xsd:string">Mannheim</ORT>
              <PLZ xsi:type="xsd:string">68306</PLZ>
              <LAND xsi:type="xsd:string"/>
              <REGION xsi:type="xsd:string"/>
              <POSTFACH xsi:type="xsd:string"/>
              <TEL xsi:type="xsd:string">0621-08460</TEL>
              <MOBIL xsi:type="xsd:string"/>
              <FAX xsi:type="xsd:string">0621-08924</FAX>
              <EMAIL xsi:type="xsd:string"/>
              <WEB xsi:type="xsd:string"/>
              <ORTSPLAN xsi:type="xsd:string"/>
              <KORRESPONDENZ xsi:type="ns1:KorrespondenzArray"/>
              <SEL xsi:type="xsd:integer">0</SEL>
              <BOO xsi:type="xsd:boolean">false</BOO>
           </items>
        </return>
     </ns1:queryResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The query function contains furthermore the following (optional) parameters, with which the query and output can be customized:

  • q_orderby: The element name which the records are sorted by.
  • q_rows: The number of records, that are shown per page. By default this is set to 30.
  • q_page: The page number (which would shown by Limbas).
  • q_nolimit: If this is set to 1, there is no limitation of the number of records that are queried.

Records can also be selected by using wildcards. A wildcard is set with “*” at the beginning and/or at the end of a search term. Furthermore the logical operators AND and OR can be used with “&&” and “||”. AND gives the intersection of records, which meet all conditions at the same time. In contrast, OR gives the union of all records, which meet at least one condition.

A query of all customers with the zip codes 6xxxx, 7xxxx, 8xxxx, 9xxxx having the first letter L in their name that is furthermore sorted by name, is as follows:

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Kundenwsdl">
 <soapenv:Header/>
 <soapenv:Body>
    <urn:query soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
       <params xsi:type="urn:KundenQuery">
          <q_orderby xsi:type="xsd:string">NAME</q_orderby>
          <PLZ xsi:type="xsd:string"><![CDATA[6* || 7* || 8* || 9*]]></PLZ>
          <NAME xsi:type="xsd:string">L*</NAME>
       </params>
    </urn:query>
 </soapenv:Body>
</soapenv:Envelope>

As a result, the XML output contains the related records:

<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Kundenwsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
  <SOAP-ENV:Body>
     <ns1:queryResponse>
        <return xsi:type="ns1:KundenArray">
           <items xsi:type="ns1:Kunden">
              <ID xsi:type="xsd:integer">43</ID>
              <NAME xsi:type="xsd:string">Lazy K Kountry Store</NAME>
              <NAME_ZUSATZ xsi:type="xsd:string"/>
              <STRASSE xsi:type="xsd:string">12 Orchestra Terrace</STRASSE>
              <ORT xsi:type="xsd:string"/>
              <PLZ xsi:type="xsd:string">99362</PLZ>
              <LAND xsi:type="xsd:string"/>
              <REGION xsi:type="xsd:string">WA</REGION>
              <POSTFACH xsi:type="xsd:string"/>
              <TEL xsi:type="xsd:string">(509) 555-7969</TEL>
              <MOBIL xsi:type="xsd:string"/>
              <FAX xsi:type="xsd:string">(509) 555-6221</FAX>
              <EMAIL xsi:type="xsd:string"/>
              <WEB xsi:type="xsd:string"/>
              <ORTSPLAN xsi:type="xsd:string"/>
              <KORRESPONDENZ xsi:type="ns1:KorrespondenzArray"/>
              <SEL xsi:type="xsd:integer">0</SEL>
              <BOO xsi:type="xsd:boolean">false</BOO>
           </items>
           <items xsi:type="ns1:Kunden">
              <ID xsi:type="xsd:integer">45</ID>
              <NAME xsi:type="xsd:string">Let's Stop N Shop</NAME>
              <NAME_ZUSATZ xsi:type="xsd:string"/>
              <STRASSE xsi:type="xsd:string">87 Polk St.Suite 5</STRASSE>
              <ORT xsi:type="xsd:string"/>
              <PLZ xsi:type="xsd:string">94117</PLZ>
              <LAND xsi:type="xsd:string"/>
              <REGION xsi:type="xsd:string">CA</REGION>
              <POSTFACH xsi:type="xsd:string"/>
              <TEL xsi:type="xsd:string">(415) 555-5938</TEL>
              <MOBIL xsi:type="xsd:string"/>
              <FAX xsi:type="xsd:string"/>
              <EMAIL xsi:type="xsd:string"/>
              <WEB xsi:type="xsd:string"/>
              <ORTSPLAN xsi:type="xsd:string"/>
              <KORRESPONDENZ xsi:type="ns1:KorrespondenzArray"/>
              <SEL xsi:type="xsd:integer">0</SEL>
              <BOO xsi:type="xsd:boolean">false</BOO>
           </items>
           <items xsi:type="ns1:Kunden">
              <ID xsi:type="xsd:integer">48</ID>
              <NAME xsi:type="xsd:string">Lonesome Pine Restaurant</NAME>
              <NAME_ZUSATZ xsi:type="xsd:string"/>
              <STRASSE xsi:type="xsd:string">89 Chiaroscuro Rd.</STRASSE>
              <ORT xsi:type="xsd:string"/>
              <PLZ xsi:type="xsd:string">97219</PLZ>
              <LAND xsi:type="xsd:string"/>
              <REGION xsi:type="xsd:string">OR</REGION>
              <POSTFACH xsi:type="xsd:string"/>
              <TEL xsi:type="xsd:string">(503) 555-9573</TEL>
              <MOBIL xsi:type="xsd:string"/>
              <FAX xsi:type="xsd:string">(503) 555-9646</FAX>
              <EMAIL xsi:type="xsd:string"/>
              <WEB xsi:type="xsd:string"/>
              <ORTSPLAN xsi:type="xsd:string"/>
              <KORRESPONDENZ xsi:type="ns1:KorrespondenzArray"/>
              <SEL xsi:type="xsd:integer">0</SEL>
              <BOO xsi:type="xsd:boolean">false</BOO>
           </items>
        </return>
     </ns1:queryResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

getByPk

This function selects all records of a table which have a specific primary-key. In the following example, the first three records are queried:

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Kundenwsdl">
  <soapenv:Header/>
  <soapenv:Body>
     <urn:getByPk soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <params xsi:type="xsd:long">1,2,3</params>
     </urn:getByPk>
  </soapenv:Body>
</soapenv:Envelope>

insert

This function creates a new record in the table. The primary key, which is for the customer table the field ID, can be left blank,so that the record gets an id that is generated by the database. Otherwise it can be specified as well.

An example for the creation of a customer is as follows

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Kundenwsdl">
  <soapenv:Header/>
  <soapenv:Body>
     <urn:insert soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <params xsi:type="urn:KundenArray">
           <items xsi:type="urn:Kunden">
              <ID xsi:type="xsd:integer"></ID>
              <NAME xsi:type="xsd:string">Martin Mustermann</NAME>
              <NAME_ZUSATZ xsi:type="xsd:string"></NAME_ZUSATZ>
              <STRASSE xsi:type="xsd:string">Musterstr. 1</STRASSE>
              <ORT xsi:type="xsd:string">Musterstadt</ORT>
              <PLZ xsi:type="xsd:string">123456</PLZ>
              <LAND xsi:type="xsd:string">Deutschland</LAND>
           </items>
        </params>
     </urn:insert>
  </soapenv:Body>
</soapenv:Envelope>

update

With this function a record can be changed.

If for example the street of the customer with id 52 has changed, the record can be updated as follows:

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Kundenwsdl">
  <soapenv:Header/>
  <soapenv:Body>
     <urn:update soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <params xsi:type="urn:Kunden">
           <ID xsi:type="xsd:integer">52</ID>
           <STRASSE xsi:type="xsd:string">Bahnhofstr. 1</STRASSE>         
        </params>
     </urn:update>
  </soapenv:Body>
</soapenv:Envelope>

delete

This function deletes a single record. The first entry of the customer table can be deleted with the following request:

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Kundenwsdl">
  <soapenv:Header/>
  <soapenv:Body>
     <urn:getByPk soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <params xsi:type="xsd:long">1</params>
     </urn:getByPk>
  </soapenv:Body>
</soapenv:Envelope>

join

This function makes it possible to link records.

In order to assign our first customer the correspondencies with the ids 1, 2 and 3, the following SOAP-Request can be sent:

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Kundenwsdl">
  <soapenv:Header/>
  <soapenv:Body>
     <urn:join soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <params xsi:type="urn:KundenJoin">
           <ID xsi:type="xsd:integer">1</ID>
           <KORRESPONDENZ xsi:type="xsd:string">1,2,3</KORRESPONDENZ>
        </params>
     </urn:join>
  </soapenv:Body>
</soapenv:Envelope>

Setup

Because the SOAP server invokes itself to query the WSDL definitions, the DOMAIN that is to be invoked has to be recorded in /etc/hosts .

Share this Doc

WSDL Interface

Or copy link

CONTENTS