2012-01-05 85 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>