Share via


Forms2RecordDataSet SOAP Message Example

Applies to: SharePoint Workspace 2010 | Visual Studio 2008

The schema in Forms.xsd that describes the Forms2RecordDataSet type is very simple, but it is very general and does not describe the structure in the same detail as most other Groove Web Services. The reason for this is that the schema varies from one Forms tool to another. Consequently, the Forms2RecordDataSet structure is a self-describing structure, where the Schema element describes the structure of the Data element. This section illustrates a sample instance of Forms2RecordDataSet from a SOAP message.

Remarks

The schema that defines the RecordDataSet type is:

  <xs:complexType name="Forms2RecordDataSet">
   <xs:sequence>
      <xs:element name="Schema" type="xs:anyType" />
      <xs:element minOccurs="0" name="Data" type="xs:anyType" />
      <xs:element minOccurs="0" name="SchemaVersionID" 
        type="xs:string" />
    </xs:sequence>
  </xs:complexType>

The following example is an instance of a Forms2RecordDataSet for a Forms tool. This instance was returned by the QueryRecords operation. Because this XML is rather long, it is broken into sections with descriptions between sections. Some elements have been removed to improve readability.

<QueryRecordsResult>
 <Schema>
  <xs:schema 
   xmlns="http://webservices.groove.net/Groove/2.0/Forms2/" 
   targetNamespace="http://webservices.groove.net/Groove/2.0/Forms2/" 
   version="1.0" 
   elementFormDefault="qualified"
  >

This is the start of the QueryRecordsResult element, which has a type of Forms2RecordDataSet. Note that there is no XML element for Forms2RecordDataSet because it is only a type. The Schema element is the first element in Forms2RecordDataSet.

The schema element starts with definitions for the complex types FileAttachments and FileContents. Both these types are the same in all Forms tool, and they have the identical definition in every Forms2RecordDataSet that is returned by a GrooveForms2 operation.

<xs:complexType 
 name="FileAttachments" 
 xmlns:xs="http://www.w3.org/2001/XMLSchema">
 <xs:sequence>
  <xs:element
    minOccurs="0" 
    maxOccurs="unbounded" 
    name="FileAttachment" 
    type="FileAttachment"
   />
  </xs:sequence>
</xs:complexType>

<xs:complexType
 name="FileAttachment"
 xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
 <xs:sequence>
  <xs:element name="ID" type="xs:string"/>
  <xs:element name="CreatedBy" type="xs:string"/>
  <xs:element name="ModifiedBy" type="xs:string"/>
  <xs:element name="Created" type="xs:dateTime"/>
  <xs:element name="Modified" type="xs:dateTime"/>
  <xs:element name="FullName" type="xs:string"/>
  <xs:element name="Type" type="xs:string"/>
  <xs:element name="Size" type="xs:int"/>
  <xs:element minOccurs="0" name="Contents" type="FileContents"/>
 </xs:sequence>
</xs:complexType>

<xs:complexType
 name="FileContents"
 xmlns:xs="http://www.w3.org/2001/XMLSchema">
 <xs:choice>
  <xs:element name="Base64" type="xs:base64Binary"/>
 </xs:choice>
</xs:complexType>

The next schema defined is for the Data element. This is the schema that describes the format of the Data element of the message, which contains the contents of the records. The schema for Data defines a series of elements, each describing the record schema associated with a form in the tool. The unique name of the record schema element is created from the form ID, but has to be modified to conform to XML naming requirements. This name is returned in the Form.FormsRecordDataSet_ID element, which is returned by the ReadForms operation. The record schema element contains elements that describe the fields in the record, and have either a basic XSD type or use the FileAttachments type as defined above.

Note

If you are querying records and requesting the metadata only, the record schemas for all forms will be included. Otherwise, only the record schemas that appear in the Data element will be defined in the Schema element. If you are querying or reading records and there are no records returned in the Data element, then there will be no record schemas defined in the Schema element.

Each record schema element includes the fields that are defined for that form. Note that the system fields are always included in the schema and record even if they are not displayed on the form. The following fragment of the schema that defines the Data element defines two record schemas. The first record schema has a user-designed field named "TextField" plus the system fields. The second record schema includes the same fields with a field named "AttachA" added.

    <xs:element name="Data">
     <xs:complexType>
      <xs:sequence>
       <xs:element
        name="_454_463363869417099472E_43085"
       >
        <xs:complexType>
         <xs:sequence>
          <xs:element name="RecordURI" type="xs:string" minOccurs="0"/>
          <xs:element name="TextField" type="xs:string" minOccurs="0"/>
          <xs:element name="_CreatedByURL" type="xs:string" 
             minOccurs="0"/>
          <xs:element name="_ModifiedByURL" type="xs:string" 
             minOccurs="0"/>
          <xs:element name="Forms_Tool_grooveFormID" type="xs:double" 
             minOccurs="0"/>
          <xs:element name="_ParentID" type="xs:double" minOccurs="0"/>
          <xs:element name="_RecordID" type="xs:double" minOccurs="0"/>
          <xs:element name="_Created" type="xs:dateTime"  
             minOccurs="0"/>
          <xs:element name="_CreatedBy" type="xs:string" 
             minOccurs="0"/>
          <xs:element name="_Editors" type="xs:string" minOccurs="0"/>
          <xs:element name="_Modified" type="xs:dateTime" 
             minOccurs="0"/>
          <xs:element name="_ModifiedBy" type="xs:string" 
             minOccurs="0"/>
          <xs:element name="_Readers" type="xs:string" minOccurs="0"/>
          <xs:element name="_UnreadFlag" type="xs:double" 
             minOccurs="0"/>
         </xs:sequence>
        </xs:complexType>
       </xs:element>
       <xs:element name="_455_46461924156069982E_45120">
        <xs:complexType>
         <xs:sequence>
          <xs:element name="RecordURI" type="xs:string"/>
          <xs:element name="AttachA" type="FileAttachments" 
            minOccurs="0"/>
          <xs:element name="TextField" type="xs:string" minOccurs="0"/>
          <xs:element name="_CreatedByURL" type="xs:string"/>
          <xs:element name="_ModifiedByURL" type="xs:string"/>
          <xs:element name="Forms_Tool_grooveFormID" type="xs:double"/>
          <xs:element name="_ParentID" type="xs:double"/>
          <xs:element name="_RecordID" type="xs:double"/>
          ...
         </xs:sequence>
        </xs:complexType>
       </xs:element>
    </xs:sequence>
   </xs:complexType>
  </xs:element>
 </xs:schema>
</Schema>

The Data element consists of any number of record elements. Each record element is named with the record schema name of its form and contains a single Forms tool record.

The following example is a Data element that uses the above schema. It shows two records—one for each record schema. The second record includes two attachments, but these records were queried with a false value for the IncludeFileAttachmentContent parameter and the attachment contents are not included in the response. Elements that are deleted for readability are indicated by ... (ellipsis).

  <Data>
   <_454_463363869417099472E_43085>
    <RecordURI>/GWS/Groove/2.0/Forms2/... </RecordURI>
    <TextField>form with no attach fields </TextField>
    <_CreatedByURL>grooveIdentity://mt64...@ </_CreatedByURL>
    <_ModifiedByURL>grooveIdentity://yf6...@ </_ModifiedByURL>
    <Forms_Tool_grooveFormID>-4.3363869417099472E+085 
    </Forms_Tool_grooveFormID>
    <_ParentID>-1 </_ParentID>
    <_RecordID>2.1298887067938249E+146 </_RecordID>
    <_Created>2005-12-20T21:02:06Z </_Created>
    <_CreatedBy>TestAcct1206 </_CreatedBy>
    <_Editors>
    </_Editors>
    <_Modified>2005-12-21T20:51:15Z </_Modified>
    <_ModifiedBy>TestAcct1116 </_ModifiedBy>
    <_Readers> </_Readers>
    <_UnreadFlag>1 </_UnreadFlag>
   </_454_463363869417099472E_43085>
   <_455_46461924156069982E_45120>
    <RecordURI>/GWS/Groove/2.0/Forms2/... </RecordURI>
    <AttachA>
     <FileAttachment>
      <ID>3060eb...d </ID>
      <CreatedBy>grooveIdentity://yf6...@ </CreatedBy>
      <ModifiedBy> </ModifiedBy>
      <Created>2005-12-21T20:54:36Z </Created>
      <Modified>2005-12-21T20:54:36Z </Modified>
      <FullName>abc.txt </FullName>
      <Type>File </Type>
      <Size>3 </Size>
     </FileAttachment>
     <FileAttachment>
      <ID>a38... </ID>
      ...
      <FullName>bc.txt </FullName>
      ...
     </FileAttachment>
    </AttachA>
    <TextField>Has 2 attachments </TextField>
    <_CreatedByURL>grooveIdentity://mt64...@ </_CreatedByURL>
    ...
   </_455_46461924156069982E_45120>
   </Data>
  <SchemaVersionID>88
 </SchemaVersionID>
</QueryRecordsResult>

If the same records were queried with a true value for the IncludeFileAttachmentContent parameter, the FileAttachment for the abc.txt file would be the following:

    <AttachA>
     <FileAttachment>
      <ID>3060eb...d </ID>
      <CreatedBy>grooveIdentity://yf6...@ </CreatedBy>
      <ModifiedBy> </ModifiedBy>
      <Created>2005-12-21T20:54:36Z </Created>
      <Modified>2005-12-21T20:54:36Z </Modified>
      <FullName>abc.txt </FullName>
      <Type>File </Type>
      <Size>3 </Size>
      <Contents>
       <Base64>ZGVm</Base64>
      </Contents>
     </FileAttachment>

See Also

Reference

GrooveForms2 Web Service

Forms2RecordDataSet Complex Type

System Fields in Forms2RecordDataSet

Relationship between Groove Forms Tool Types and Forms2RecordDataSet Elements

Relationship between InfoPath Tool Types and Forms2RecordDataSet Elements

Concepts

Accessing Forms Tool Records