2012-01-05 103 views
0

我能够登录到SugarCRM公司(连同其SOAP调用)来插入数组值到SugarCRM的:如何使用的soapUI使用的soapUI

<user_auth xsi:type="sug:user_auth"> 
    <user_name xsi:type="xsd:string">admin</user_name> 
    <password xsi:type="xsd:string">21232f297a57a5a743894a0e4a801fc3</password> 
<user_auth> 

这样做,我得到一个会话ID(除其他事项外)。但是现在我想将一些数据添加到Leads模块中。该XML看起来是这样的:

<sug:set_entry soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
    <session xsi:type="xsd:string">5bhvqlqgb9a0vi70e73l053m92</session> 
    <module_name xsi:type="xsd:string">Leads</module_name> 
    <name_value_list xsi:type="sug:name_value_list" soapenc:arrayType="sug:name_value[]"/> 
</sug:set_entry> 

我居住所需的三个字段2,会议MODULE_NAME。我如何填充第三个,name_value_list?举例来说,我们假设我只想添加铅的first_namelast_name

回答

2

以下内容适用于SugarCRM 5.x.所以它会适当地与6.x一起工作。

<sug:set_entry soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
<session xsi:type="xsd:string">xx</session> 
<module_name xsi:type="xsd:string">Leads</module_name> 
<name_value_list xsi:type="sug:name_value_list" soapenc:arrayType="sug:name_value[]"> 
    <item xsi:type="tns:name_value"> 
     <name xsi:type="xsd:string">first_name</name> 
     <value xsi:type="xsd:string">test</value> 
    </item> 
    <item xsi:type="tns:name_value"> 
     <name xsi:type="xsd:string">last_name</name> 
     <value xsi:type="xsd:string">test2</value> 
    </item> 
</name_value_list> 
</sug:set_entry>