Partager via


Query an E-mail Account Example for OMA DM

4/8/2010

This example shows how to query an email account for account settings.

Note

Brackets {} are required around the GUID in the LocURI. You must use the ASCII values of %7B and %7D respectively, as shown in the XML example. For example, if the GUID is "C556E16F-56C4-4edb-9C64-D9469EE1FBE0," you would change <Target><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D</LocURI></Target> to <Target><LocURI>./Vendor/MSFT/EMAIL2/%7BC556E16F-56C4-4edb-9C64-D9469EE1FBE%7D</LocURI></Target>

Code Example

<Atomic>
   <CmdID>100</CmdID>
   <Add>
      <CmdID>200</CmdID>
      <Item>
         <Target><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D</LocURI></Target>
         <Meta>
            <Format xmlns="syncml:metinf">node</Format>
            <Type xmlns="syncml:metinf">text/plain</Type>
         </Meta>
      </Item>
   </Add>

   <Replace>
      <CmdID>300</CmdID>
      <Item>
         <Target><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/SERVICENAME</LocURI></Target>
         <Meta>
            <Format xmlns="syncml:metinf">chr</Format>
            <Type xmlns="syncml:metinf">text/plain</Type>
         </Meta>
         <Data>email acct 1</Data>
      </Item>
   </Replace>

   <Replace>
      <CmdID>400</CmdID>
      <Item>
         <Target><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/SERVICETYPE</LocURI></Target>
         <Meta>
            <Format xmlns="syncml:metinf">chr</Format>
            <Type xmlns="syncml:metinf">text/plain</Type>
         </Meta>
         <Data>POP3</Data>
      </Item>
   </Replace>

   <Replace>
      <CmdID>500</CmdID>
      <Item>
         <Target><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/INSERVER</LocURI></Target>
         <Meta>
            <Format xmlns="syncml:metinf">chr</Format>
            <Type xmlns="syncml:metinf">text/plain</Type>
         </Meta>
         <Data>IncomingServer1</Data>
      </Item>
   </Replace>

   <Replace>
      <CmdID>600</CmdID>
      <Item>
         <Target><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/OUTSERVER</LocURI></Target>
         <Meta>
            <Format xmlns="syncml:metinf">chr</Format>
            <Type xmlns="syncml:metinf">text/plain</Type>
         </Meta>
         <Data>OutgoingServer1</Data>
      </Item>
   </Replace>

   <Replace>
      <CmdID>700</CmdID>
      <Item>
         <Target><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/AUTHNAME</LocURI></Target>
         <Meta>
            <Format xmlns="syncml:metinf">chr</Format>
            <Type xmlns="syncml:metinf">text/plain</Type>
         </Meta>
         <Data>authname1</Data>
      </Item>
   </Replace>

   <Replace>
      <CmdID>800</CmdID>
      <Item>
         <Target><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/AUTHSECRET</LocURI></Target>
         <Meta>
            <Format xmlns="syncml:metinf">chr</Format>
            <Type xmlns="syncml:metinf">text/plain</Type>
         </Meta>
         <Data>password1</Data>
      </Item>
   </Replace>

   <Replace>
      <CmdID>900</CmdID>
      <Item>
         <Target><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/REPLYADDR</LocURI></Target>
         <Meta>
            <Format xmlns="syncml:metinf">chr</Format>
            <Type xmlns="syncml:metinf">text/plain</Type>
         </Meta>
         <Data>someone@example.com</Data>
      </Item>
   </Replace>

   <Replace>
      <CmdID>1000</CmdID>
      <Item>
         <Target><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/NAME</LocURI></Target>
         <Meta>
            <Format xmlns="syncml:metinf">chr</Format>
            <Type xmlns="syncml:metinf">text/plain</Type>
         </Meta>
         <Data>John Q. Doe1</Data>
      </Item>
   </Replace>

   <Replace>
      <CmdID>1100</CmdID>
      <Item>
         <Target><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/AUTHREQUIRED</LocURI></Target>
         <Meta>
            <Format xmlns="syncml:metinf">int</Format>
            <Type xmlns="syncml:metinf">text/plain</Type>
         </Meta>
         <Data>1</Data>
      </Item>
   </Replace>

   <Replace>
      <CmdID>1200</CmdID>
      </Item>
         <Target><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/DWNDAY</LocURI></Target>
         <Meta>
            <Format xmlns="syncml:metinf">int</Format>
            <Type xmlns="syncml:metinf">text/plain</Type>
         </Meta>
        <Data>1</Data>
      </Item>
   <Replace>

   <Replace>
      <CmdID>1300</CmdID>
      <Item>
         <Target><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/LINGER</LocURI></Target>
         <Meta>
            <Format xmlns="syncml:metinf">int</Format>
            <Type xmlns="syncml:metinf">text/plain</Type>
         </Meta>
         <Data>60</Data>
      </Item>
   <Replace>

   <Replace>
      <CmdID>1400</CmdID>
      <Item>
         <Target><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/RETRIEVE</LocURI></Target>
         <Meta>
            <Format xmlns="syncml:metinf">int</Format>
            <Type xmlns="syncml:metinf">text/plain</Type>
         </Meta>
         <Data>999</Data>
      </Item>
   <Replace>

   <Replace>
      <CmdID>1500</CmdID>
      <Item>
         <Target><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/DOMAIN</LocURI></Target>
         <Meta>
            <Format xmlns="syncml:metinf">chr</Format>
            <Type xmlns="syncml:metinf">text/plain</Type>
         </Meta>
         <Data>Domain1</Data>
      </Item>
   <Replace>

</Atomic>
   <Get>
      <CmdID>1600</CmdID>
      <Item>
          <Target>
              <LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/SERVICENAME?list=StructData</LocURI>
          </Target>
      </Item>
   </Get>
   <Get>
      <CmdID>1700</CmdID>
      <Item>
          <Target>
              <LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/SERVICETYPE?list=StructData</LocURI>
          </Target>
       </Item>
   </Get>
   <Get>
      <CmdID>1800</CmdID>
      <Item>
         <Target>
              <LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/INSERVER?list=StructData</LocURI>
          </Target>
      </Item>
   </Get>
   <Get>
      <CmdID>1900</CmdID>
      <Item>
          <Target>
              <LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/OUTSERVER?list=StructData</LocURI>
          </Target>
      </Item>
   </Get>
   <Get>
      <CmdID>2000</CmdID>
      <Item>
          <Target>
              <LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/AUTHNAME?list=StructData</LocURI>
          </Target>
      </Item>
   </Get>
   <Get>
      <CmdID>2100</CmdID>
      <Item>
          <Target>
              <LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/AUTHSECRET?list=StructData</LocURI>
          </Target>
      </Item>
   </Get>
   <Get>
      <CmdID>2200</CmdID>
      <Item>
          <Target>
              <LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/REPLYADDR?list=StructData</LocURI>
          </Target>
      </Item>
   </Get>
   <Get>
      <CmdID>2300</CmdID>
      <Item>
          <Target>
              <LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/NAME?list=StructData</LocURI>
          </Target>
      </Item>
   </Get>
   <Get>
      <CmdID>2400</CmdID>
      <Item>
          <Target>
              <LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/AUTHREQUIRED?list=StructData</LocURI>
          </Target>
      </Item>
   </Get>
   <Get>
      <CmdID>2500</CmdID>
      <Item>
          <Target>
              <LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/DWNDAY?list=StructData</LocURI>
          </Target>
      </Item>
   </Get>
   <Get>
      <CmdID>2600</CmdID>
      <Item>
          <Target>
              <LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/LINGER?list=StructData</LocURI>
          </Target>
      </Item>
   </Get>
   <Get>
      <CmdID>2700</CmdID>
      <Item>
          <Target>
              <LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/RETRIEVE?list=StructData</LocURI>
          </Target>
      </Item>
   </Get>
   <Get>
      <CmdID>2800</CmdID>
      <Item>
          <Target>
              <LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/DOMAIN?list=StructData</LocURI>
          </Target>
      </Item>
   </Get>

The following is the unformatted output for the email account query listed above.

<SyncML><SyncHdr/><SyncBody><Status><CmdID>100</CmdID><MsgRef>1</MsgRef><CmdRef>0</CmdRef><Cmd>SyncHdr</Cmd><Data>200</Data></Status><Status><CmdID>200</CmdID><MsgRef>1</MsgRef><CmdRef>1</CmdRef><Cmd>Atomic</Cmd><Data>200</Data></Status><Status><CmdID>300</CmdID><MsgRef>1</MsgRef><CmdRef>2</CmdRef><Cmd>Add</Cmd><Data>200</Data></Status><Status><CmdID>400</CmdID><MsgRef>1</MsgRef><CmdRef>3</CmdRef><Cmd>Replace</Cmd><Data>200</Data></Status><Status><CmdID>500</CmdID><MsgRef>1</MsgRef><CmdRef>4</CmdRef><Cmd>Replace</Cmd><Data>200</Data></Status><Status><CmdID>600</CmdID><MsgRef>1</MsgRef><CmdRef>5</CmdRef><Cmd>Replace</Cmd><Data>200</Data></Status><Status><CmdID>700</CmdID><MsgRef>1</MsgRef><CmdRef>6</CmdRef><Cmd>Replace</Cmd><Data>200</Data></Status><Status><CmdID>800</CmdID><MsgRef>1</MsgRef><CmdRef>7</CmdRef><Cmd>Replace</Cmd><Data>200</Data></Status><Status><CmdID>900</CmdID><MsgRef>1</MsgRef><CmdRef>8</CmdRef><Cmd>Replace</Cmd><Data>200</Data></Status><Status><CmdID>1000</CmdID><MsgRef>1</MsgRef><CmdRef>9</CmdRef><Cmd>Replace</Cmd><Data>200</Data></Status><Status><CmdID>1100</CmdID><MsgRef>1</MsgRef><CmdRef>10</CmdRef><Cmd>Replace</Cmd><Data>200</Data></Status><Status><CmdID>1200</CmdID><MsgRef>1</MsgRef><CmdRef>11</CmdRef><Cmd>Replace</Cmd><Data>200</Data></Status><Status><CmdID>1300</CmdID><MsgRef>1</MsgRef><CmdRef>12</CmdRef><Cmd>Replace</Cmd><Data>200</Data></Status><Status><CmdID>1400</CmdID><MsgRef>1</MsgRef><CmdRef>13</CmdRef><Cmd>Replace</Cmd><Data>200</Data></Status><Status><CmdID>1500</CmdID><MsgRef>1</MsgRef><CmdRef>14</CmdRef><Cmd>Replace</Cmd><Data>200</Data></Status><Status><CmdID>1600</CmdID><MsgRef>1</MsgRef><CmdRef>15</CmdRef><Cmd>Replace</Cmd><Data>200</Data></Status><Status><CmdID>1700</CmdID><MsgRef>1</MsgRef><CmdRef>16</CmdRef><Cmd>Get</Cmd><Data>200</Data></Status><Results><CmdID>1800</CmdID><MsgRef>1</MsgRef><CmdRef>16</CmdRef><Item><Source><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/SERVICENAME</LocURI></Source><Data>email acct 1</Data></Item></Results><Status><CmdID>1900</CmdID><MsgRef>1</MsgRef><CmdRef>17</CmdRef><Cmd>Get</Cmd><Data>200</Data></Status><Results><CmdID>2000</CmdID><MsgRef>1</MsgRef><CmdRef>17</CmdRef><Item><Source><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/SERVICETYPE</LocURI></Source><Data>POP3</Data></Item></Results><Status><CmdID>2100</CmdID><MsgRef>1</MsgRef><CmdRef>18</CmdRef><Cmd>Get</Cmd><Data>200</Data></Status><Results><CmdID>2200</CmdID><MsgRef>1</MsgRef><CmdRef>18</CmdRef><Item><Source><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/INSERVER</LocURI></Source><Data>IncomingServer1</Data></Item></Results><Status><CmdID>2300</CmdID><MsgRef>1</MsgRef><CmdRef>19</CmdRef><Cmd>Get</Cmd><Data>200</Data></Status><Results><CmdID>2400</CmdID><MsgRef>1</MsgRef><CmdRef>19</CmdRef><Item><Source><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/OUTSERVER</LocURI></Source><Data>OutgoingServer1</Data></Item></Results><Status><CmdID>2500</CmdID><MsgRef>1</MsgRef><CmdRef>20</CmdRef><Cmd>Get</Cmd><Data>200</Data></Status><Results><CmdID>2600</CmdID><MsgRef>1</MsgRef><CmdRef>20</CmdRef><Item><Source><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/AUTHNAME</LocURI></Source><Data>authname1</Data></Item></Results><Status><CmdID>2700</CmdID><MsgRef>1</MsgRef><CmdRef>21</CmdRef><Cmd>Get</Cmd><Data>200</Data></Status><Results><CmdID>2800</CmdID><MsgRef>1</MsgRef><CmdRef>21</CmdRef><Item><Source><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/AUTHSECRET</LocURI></Source><Data>****************</Data></Item></Results><Status><CmdID>2900</CmdID><MsgRef>1</MsgRef><CmdRef>22</CmdRef><Cmd>Get</Cmd><Data>200</Data></Status><Results><CmdID>3000</CmdID><MsgRef>1</MsgRef><CmdRef>22</CmdRef><Item><Source><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/REPLYADDR</LocURI></Source><Data>someone@example.com</Data></Item></Results><Status><CmdID>3100</CmdID><MsgRef>1</MsgRef><CmdRef>23</CmdRef><Cmd>Get</Cmd><Data>200</Data></Status><Results><CmdID>3200</CmdID><MsgRef>1</MsgRef><CmdRef>23</CmdRef><Item><Source><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/NAME</LocURI></Source><Data>John Q. Doe1</Data></Item></Results><Status><CmdID>3300</CmdID><MsgRef>1</MsgRef><CmdRef>24</CmdRef><Cmd>Get</Cmd><Data>200</Data></Status><Results><CmdID>3400</CmdID><MsgRef>1</MsgRef><CmdRef>24</CmdRef><Item><Source><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/AUTHREQUIRED</LocURI></Source><Data>1</Data></Item></Results><Status><CmdID>3500</CmdID><MsgRef>1</MsgRef><CmdRef>25</CmdRef><Cmd>Get</Cmd><Data>200</Data></Status><Results><CmdID>3600</CmdID><MsgRef>1</MsgRef><CmdRef>25</CmdRef><Item><Source><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/DWNDAY</LocURI></Source><Data>1</Data></Item></Results><Status><CmdID>3700</CmdID><MsgRef>1</MsgRef><CmdRef>26</CmdRef><Cmd>Get</Cmd><Data>200</Data></Status><Results><CmdID>3800</CmdID><MsgRef>1</MsgRef><CmdRef>26</CmdRef><Item><Source><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/LINGER</LocURI></Source><Data>60</Data></Item></Results><Status><CmdID>3900</CmdID><MsgRef>1</MsgRef><CmdRef>27</CmdRef><Cmd>Get</Cmd><Data>200</Data></Status><Results><CmdID>4000</CmdID><MsgRef>1</MsgRef><CmdRef>27</CmdRef><Item><Source><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/RETRIEVE</LocURI></Source><Data>999</Data></Item></Results><Status><CmdID>4100</CmdID><MsgRef>1</MsgRef><CmdRef>28</CmdRef><Cmd>Get</Cmd><Data>200</Data></Status><Results><CmdID>4200</CmdID><MsgRef>1</MsgRef><CmdRef>28</CmdRef><Item><Source><LocURI>./Vendor/MSFT/EMAIL2/%7B(email account GUID)%7D/DOMAIN</LocURI></Source><Data>Domain1</Data></Item></Results><Final/></SyncBody></SyncML>

Remarks

One provisioning XML file typically contains configuration information for multiple Configuration Service Providers. To use this example, you must replace the values as appropriate, and add the node as a child of the SyncBody node in an OMA DM provisioning file. For more information about the syntax of the provisioning file, see OMA DM Provisioning Files.

See Also

Concepts

OMA DM Provisioning Files

Other Resources

EMAIL2 Configuration Service Provider Examples for OMA DM