如何从一个SOAPUI请求执行多个记录

时间:2017-02-16 10:22:07

标签: mdm tibco tibco-mdm

我有一个SOAPUI请求。我需要从一个请求中执行多个产品ID。我们需要从SOAPUI更新它。这是请求:

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP-ENV:Body>
          <DataService>
             <Identity>
                <DirectoryPath>
                   <Directory type="Enterprise">AP</Directory>
                   <Directory type="User">admin</Directory>
                </DirectoryPath>
                <Authentication type="password">admin</Authentication>
             </Identity>
             <Transaction>
                <Command type="Modify">
                   <!--The Supported CommandTypes for Save are Add and Modify-->
                   <MasterCatalogRecord etype="Entity" commandqualifier="NoValidate/NoProcess">
                      <!--The Suppored commandqualifier for Save are Validate/Process, Validate/NoProcess, NoValidate/Process, NoValidate/NoProcess default is Validate/Process-->
                      <ExternalKeys>
                         <Key name="MASTERCATALOGNAME" type="string">SYSTEM</Key>
                         <Key name="PRODUCTID" type="string">SYS1</Key>
                      </ExternalKeys>
                      <EntityData>
                    <Attribute name="RECORD_STATE" type="string">Confirmed</Attribute>  
                      </EntityData>          
                    </MasterCatalogRecord>
                </Command>
             </Transaction>
          </DataService>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

1 个答案:

答案 0 :(得分:1)

以下是通过单个请求添加具有不同产品ID的多个记录(不相关)的示例请求:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.tibco.com/cim/services/mastercatalogrecord/wsdl/2.0">
   <soapenv:Header/>
   <soapenv:Body>
      <DataService version="2.0" xmlns="http://www.tibco.com/cim/services/mastercatalogrecord/wsdl/2.0">
         <Identity>
            <DirectoryPath>
               <Directory type="Enterprise">AP</Directory>
               <Directory type="User">admin</Directory>
            </DirectoryPath>
            <Authentication>admin</Authentication>
         </Identity>
         <Transaction atomic="on">
            <Command type="Modify">
               <!--The Supported CommandTypes for Save are Add and Modify-->
               <MasterCatalogRecord etype="Entity" commandqualifier="NoValidate/NoProcess">
                  <!--The Suppored commandqualifier for Save are Validate/Process, Validate/NoProcess, NoValidate/Process, NoValidate/NoProcess default is Validate/Process-->
                  <ExternalKeys>
                     <Key name="MASTERCATALOGNAME" type="string">SYSTEM</Key>
                     <Key name="PRODUCTID" type="string">SYS1</Key>
                  </ExternalKeys>
                  <EntityData>
                     <Attribute name="RECORD_STATE" type="string">Confirmed</Attribute>
                  </EntityData>
               </MasterCatalogRecord>
            </Command>
            <Command type="Modify">
               <!--The Supported CommandTypes for Save are Add and Modify-->
               <MasterCatalogRecord etype="Entity" commandqualifier="NoValidate/NoProcess">
                  <!--The Suppored commandqualifier for Save are Validate/Process, Validate/NoProcess, NoValidate/Process, NoValidate/NoProcess default is Validate/Process-->
                  <ExternalKeys>
                     <Key name="MASTERCATALOGNAME" type="string">SYSTEM</Key>
                     <Key name="PRODUCTID" type="string">SYS2</Key>
                  </ExternalKeys>
                  <EntityData>
                     <Attribute name="RECORD_STATE" type="string">Confirmed</Attribute>
                  </EntityData>
               </MasterCatalogRecord>
            </Command>
            <Command type="Modify">
               <!--The Supported CommandTypes for Save are Add and Modify-->
               <MasterCatalogRecord etype="Entity" commandqualifier="NoValidate/NoProcess">
                  <!--The Suppored commandqualifier for Save are Validate/Process, Validate/NoProcess, NoValidate/Process, NoValidate/NoProcess default is Validate/Process-->
                  <ExternalKeys>
                     <Key name="MASTERCATALOGNAME" type="string">SYSTEM</Key>
                     <Key name="PRODUCTID" type="string">SYS3</Key>
                  </ExternalKeys>
                  <EntityData>
                     <Attribute name="RECORD_STATE" type="string">Confirmed</Attribute>
                  </EntityData>
               </MasterCatalogRecord>
            </Command>
         </Transaction>
      </DataService>
   </soapenv:Body>
</soapenv:Envelope>

以下是通过单一请求广告多个相关记录的请求:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Body>
      <DataService version="2.0" xmlns="http://www.tibco.com/cim/services/mastercatalogrecord/wsdl/2.0">
         <Identity>
            <DirectoryPath>
               <Directory type="Enterprise">AP</Directory>
               <Directory type="User">admin</Directory>
            </DirectoryPath>
            <Authentication type="password">admin</Authentication>
         </Identity>
         <Transaction atomic="on">
            <Command type="Modify">
               <!--The Supported CommandTypes for Save are Add and Modify-->
               <MasterCatalogRecord etype="Entity" commandqualifier="Validate/Process">
                  <!--The Suppored commandqualifier for Save are Validate/Process, Validate/NoProcess, NoValidate/Process, NoValidate/NoProcess-->
                  <ExternalKeys>
                     <Key name="MASTERCATALOGNAME" type="string">SYSTEM</Key>
                     <Key name="PRODUCTID" type="string">SYS1</Key>
                  </ExternalKeys>
                  <EntityData>
                     <Attribute name="RECORD_STATE" type="string">Confirmed</Attribute>
                  </EntityData>
                  <RelationshipData>
                     <Relationship>
                        <RelationType>SystemToClient</RelationType>
                        <RelatedEntities>
                           <MasterCatalogRecord etype="Entity">
                              <ExternalKeys>
                                 <Key name="MASTERCATALOGNAME" type="string">CLIENT</Key>
                                 <Key name="PRODUCTID" type="string">CLI1</Key>
                              </ExternalKeys>
                           </MasterCatalogRecord>
                        </RelatedEntities>
                     </Relationship>
                  </RelationshipData>
               </MasterCatalogRecord>
               <MasterCatalogRecord etype="Entity" commandqualifier="Validate/Process">
                  <ExternalKeys>
                     <Key name="MASTERCATALOGNAME" type="string">CLIENT</Key>
                     <Key name="PRODUCTID" type="string">CLI1</Key>
                  </ExternalKeys>
                  <EntityData>
                     <Attribute name="attr1_string" type="string">Test_B</Attribute>
                  </EntityData>
                  <RelationshipData>
                     <Relationship>
                        <RelationType>C1toC2</RelationType>
                        <RelatedEntities>
                           <MasterCatalogRecord etype="Entity">
                              <ExternalKeys>
                                 <Key name="MASTERCATALOGNAME" type="string">CLIENT2</Key>
                                 <Key name="PRODUCTID" type="string">c25</Key>
                              </ExternalKeys>
                           </MasterCatalogRecord>
                        </RelatedEntities>
                     </Relationship>
                  </RelationshipData>
               </MasterCatalogRecord>
               <MasterCatalogRecord etype="Entity" commandqualifier="Validate/Process">
                  <ExternalKeys>
                     <Key name="MASTERCATALOGNAME" type="string">CLIENT2</Key>
                     <Key name="PRODUCTID" type="string">c25</Key>
                  </ExternalKeys>
                  <EntityData>
                     <Attribute name="attr1_string" type="string">Test_C</Attribute>
                  </EntityData>
               </MasterCatalogRecord>
               <MasterCatalogRecord etype="Entity" commandqualifier="Validate/Process">
                  <ExternalKeys>
                     <Key name="MASTERCATALOGNAME" type="string">CLIENT2</Key>
                     <Key name="PRODUCTID" type="string">c25</Key>
                  </ExternalKeys>
                  <EntityData>
                     <Attribute name="attr1_string" type="string">Test_B</Attribute>
                  </EntityData>
                  <RelationshipData>
                     <Relationship>
                        <RelationType>C2toC3</RelationType>
                        <RelatedEntities>
                           <MasterCatalogRecord etype="Entity">
                              <ExternalKeys>
                                 <Key name="MASTERCATALOGNAME" type="string">CLIENT3</Key>
                                 <Key name="PRODUCTID" type="string">c25</Key>
                              </ExternalKeys>
                           </MasterCatalogRecord>
                        </RelatedEntities>
                     </Relationship>
                  </RelationshipData>
               </MasterCatalogRecord>
               <MasterCatalogRecord etype="Entity" commandqualifier="Validate/Process">
                  <ExternalKeys>
                     <Key name="MASTERCATALOGNAME" type="string">CLIENT3</Key>
                     <Key name="PRODUCTID" type="string">c25</Key>
                  </ExternalKeys>
                  <EntityData>
                     <Attribute name="attr1_string" type="string">Test_C</Attribute>
                  </EntityData>
               </MasterCatalogRecord>
            </Command>
            <Command type="Modify">
               <!--The Supported CommandTypes for Save are Add and Modify-->
               <MasterCatalogRecord etype="Entity" commandqualifier="Validate/Process">
                  <!--The Suppored commandqualifier for Save are Validate/Process, Validate/NoProcess, NoValidate/Process, NoValidate/NoProcess-->
                  <ExternalKeys>
                     <Key name="MASTERCATALOGNAME" type="string">SYSTEM</Key>
                     <Key name="PRODUCTID" type="string">SYS2</Key>
                  </ExternalKeys>
                  <EntityData>
                     <Attribute name="RECORD_STATE" type="string">Confirmed</Attribute>
                  </EntityData>
                  <RelationshipData>
                     <Relationship>
                        <RelationType>SystemToClient</RelationType>
                        <RelatedEntities>
                           <MasterCatalogRecord etype="Entity">
                              <ExternalKeys>
                                 <Key name="MASTERCATALOGNAME" type="string">CLIENT</Key>
                                 <Key name="PRODUCTID" type="string">CLI2</Key>
                              </ExternalKeys>
                           </MasterCatalogRecord>
                        </RelatedEntities>
                     </Relationship>
                  </RelationshipData>
               </MasterCatalogRecord>
               <MasterCatalogRecord etype="Entity" commandqualifier="Validate/Process">
                  <ExternalKeys>
                     <Key name="MASTERCATALOGNAME" type="string">CLIENT</Key>
                     <Key name="PRODUCTID" type="string">CLI2</Key>
                  </ExternalKeys>
                  <EntityData>
                     <Attribute name="attr1_string" type="string">Test_B</Attribute>
                  </EntityData>
                  <RelationshipData>
                     <Relationship>
                        <RelationType>C1toC2</RelationType>
                        <RelatedEntities>
                           <MasterCatalogRecord etype="Entity">
                              <ExternalKeys>
                                 <Key name="MASTERCATALOGNAME" type="string">CLIENT2</Key>
                                 <Key name="PRODUCTID" type="string">c251</Key>
                              </ExternalKeys>
                           </MasterCatalogRecord>
                        </RelatedEntities>
                     </Relationship>
                  </RelationshipData>
               </MasterCatalogRecord>
               <MasterCatalogRecord etype="Entity" commandqualifier="Validate/Process">
                  <ExternalKeys>
                     <Key name="MASTERCATALOGNAME" type="string">CLIENT2</Key>
                     <Key name="PRODUCTID" type="string">c251</Key>
                  </ExternalKeys>
                  <EntityData>
                     <Attribute name="attr1_string" type="string">Test_C</Attribute>
                  </EntityData>
               </MasterCatalogRecord>
               <MasterCatalogRecord etype="Entity" commandqualifier="Validate/Process">
                  <ExternalKeys>
                     <Key name="MASTERCATALOGNAME" type="string">CLIENT2</Key>
                     <Key name="PRODUCTID" type="string">c251</Key>
                  </ExternalKeys>
                  <EntityData>
                     <Attribute name="attr1_string" type="string">Test_B</Attribute>
                  </EntityData>
                  <RelationshipData>
                     <Relationship>
                        <RelationType>C2toC3</RelationType>
                        <RelatedEntities>
                           <MasterCatalogRecord etype="Entity">
                              <ExternalKeys>
                                 <Key name="MASTERCATALOGNAME" type="string">CLIENT3</Key>
                                 <Key name="PRODUCTID" type="string">c251</Key>
                              </ExternalKeys>
                           </MasterCatalogRecord>
                        </RelatedEntities>
                     </Relationship>
                  </RelationshipData>
               </MasterCatalogRecord>
               <MasterCatalogRecord etype="Entity" commandqualifier="Validate/Process">
                  <ExternalKeys>
                     <Key name="MASTERCATALOGNAME" type="string">CLIENT3</Key>
                     <Key name="PRODUCTID" type="string">c251</Key>
                  </ExternalKeys>
                  <EntityData>
                     <Attribute name="attr1_string" type="string">Test_C</Attribute>
                  </EntityData>
               </MasterCatalogRecord>
            </Command>
         </Transaction>
      </DataService>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>