Was this page helpful?

WS: Create new user

    Web Services: Create New User Example (from template)

    In this example we use procedures specified in main.wsdl and access.wsdl. I'll specify for each method which file it belongs into separately.

    For creation new user in Atollon system you are obliged to create user record and contact record. Lets try creating new user from template. First we need user template id which should be used, for that we call GetUserTemplate (access.wsdl). Example assumes we have proper system id however other identificators can be used for template search.

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <SOAP-ENV:Body>
        <impl:GetUserTemplate xmlns:impl="http://atollon.com/enterprise/wsdl">
          <server>pioneer</server>
          <session>D2D29F9F6519938C7189DA8FA143F2BC40537ABF3708</session>
          <systemId>some.system.id.here</systemId>
        </impl:GetUserTemplate>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    
    Operation response: 'ListUserTemplate'
    <persistency-response operationId='ListUserTemplate'>
    <ns1:GetUserTemplateResponse xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://atollon.com/enterprise/wsdl">
      <result>OK</result>
      <count>1</count>
      <TEMPLATE>
        <id>123673000</id>
        <name>Administrator</name>
        <treeHandle>60328000</treeHandle>
      </TEMPLATE>
    </ns1:GetUserTemplateResponse>
    

    Next we can call CreateUserByTemplate (access.wsdl) which will create user record.

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <SOAP-ENV:Body>
        <impl:CreateUserByTemplate xmlns:impl="http://atollon.com/enterprise/wsdl">
          <server>pioneer</server>
          <session>D2D29F9F6519938C7189DA8FA143F2BC40537ABF3708</session>
          <password>3bebc2d4e437c743bd5dbc0062635bd5</password>
          <templateId>123673000</templateId>
          <userName>safka</userName>
        </impl:CreateUserByTemplate>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    <ns1:CreateUserByTemplateResponse xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://atollon.com/enterprise/wsdl">
      <result>OK</result>
      <newId>2884620000</newId>
    </ns1:CreateUserByTemplateResponse>
    

    Now we should create contact which will hold any information about user. This is not needed for user's abillity to login and use system. But it allows to store with user any personal information. Because some data fields in contact can be dynamicaly configured, we should first fetch list of such. That will do ListContactList (main.wsdl) for us.

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <SOAP-ENV:Body>
        <impl:ListContactList xmlns:impl="http://atollon.com/enterprise/wsdl">
          <server>pioneer</server>
          <session>D2D29F9F6519938C7189DA8FA143F2BC40537ABF3708</session>
          <useDefaultTreeHandle>true</useDefaultTreeHandle>
          <list>contacttype</list>
        </impl:ListContactList>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    <ns1:ListContactListResponse xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://atollon.com/enterprise/wsdl">
      <result>OK</result>
      <time>0.00204587</time>
      <count>11</count>
      <ITEM>
        <id>775356000</id>
        <name>EEE</name>
        <description />
        <type>1</type>
        <priority>0</priority>
      </ITEM>
      <ITEM>
        <id>1442000</id>
        <name>E-mail</name>
        <description />
        <type>1</type>
        <priority>0</priority>
      </ITEM>
      <ITEM>
        <id>106260000</id>
        <name>Facebook</name>
        <description />
        <type>11</type>
        <priority>8</priority>
      </ITEM>
      <ITEM>
        <id>1435000</id>
        <name>Fax</name>
        <description />
        <type>4</type>
        <priority>3</priority>
      </ITEM>
      <ITEM>
        <id>775357000</id>
        <name>FFF</name>
        <description />
        <type>1</type>
        <priority>0</priority>
      </ITEM>
      <ITEM>
        <id>106258000</id>
        <name>LinkedIn</name>
        <description />
        <type>9</type>
        <priority>6</priority>
      </ITEM>
      <ITEM>
        <id>1441000</id>
        <name>Mobile</name>
        <description />
        <type>3</type>
        <priority>1</priority>
      </ITEM>
      <ITEM>
        <id>1440000</id>
        <name>Other</name>
        <description />
        <type>8</type>
        <priority>11</priority>
      </ITEM>
      <ITEM>
        <id>1445000</id>
        <name>Phone</name>
        <description />
        <type>2</type>
        <priority>4</priority>
      </ITEM>
      <ITEM>
        <id>106259000</id>
        <name>Twitter</name>
        <description />
        <type>10</type>
        <priority>7</priority>
      </ITEM>
      <ITEM>
        <id>1439000</id>
        <name>Web</name>
        <description />
        <type>5</type>
        <priority>5</priority>
      </ITEM>
    </ns1:ListContactListResponse>
    

    These items we can use as fields in CONTACT array in CreateContact (main.wsdl) we will use next.

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <SOAP-ENV:Body>
        <impl:CreateContact xmlns:impl="http://atollon.com/enterprise/wsdl">
          <server>pioneer</server>
          <session>D2D29F9F6519938C7189DA8FA143F2BC40537ABF3708</session>
          <PERSON>
            <sysUser>2884620000</sysUser>
            <name1>Dolezal</name1>
            <name3>Petr</name3>
            <dueDays>14</dueDays>
            <ADDRESSES/>
            <CONTACTS>
              <CONTACT>
                <content>pedo@email.cz</content>
                <description></description>
                <isMain>1</isMain>
                <isPrimary>0</isPrimary>
                <type>775356000</type>
                <typeName>EEE</typeName>
                <typeType>1</typeType>
              </CONTACT>
            </CONTACTS>
            <BANKS/>
            <DGROUPS/>
            <PICTURES xsi:nil="true"/>
            <PERSONINFO>
              <sex>0</sex>
              <maritalStatus>0</maritalStatus>
              <born></born>
              <salutation xsi:nil="true"/>
            </PERSONINFO>
            <EMPLOYMENTS/>
            <RELATIONS/>
            <FOLDERS/>
            <COMPANYINFO>
            </COMPANYINFO>
          </PERSON>
        </impl:CreateContact>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    
    <ns1:CreateContactResponse xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://atollon.com/enterprise/wsdl">
      <result>OK</result>
      <time>0.36476707</time>
      <newId>2884632000</newId>
    </ns1:CreateContactResponse>

    With this new user is fully created with contact iformation added. Don't forget to consult WSDL files for more availaible attributes or contact our support.

    Was this page helpful?
    Tag page (Edit tags)
    • No tags
    Page statistics
    670 view(s), 2 edit(s), and 8602 character(s)

    Comments

    You must login to post a comment.

    Attach file

    Attachments