Results 1 to 2 of 2

Thread: SOAP without php : good syntax for "name_value_list"

  1. #1
    mikrob35 is offline Senior Member
    Join Date
    Sep 2008
    Posts
    22

    Default SOAP without php : good syntax for "name_value_list"

    Hi all,

    I've been desperately trying to create a new account through the SOAP API without PHP, i.e. using a NuSoap GUI called soapUI.

    I managed to login in and to get the session id, but I'm stuck at the last step : passing an array of values to the "set_entry" function or to the "set entries" one.

    As an exemple, I would just want to create an account whose "name" attribute is "John".

    Here is the code that I need to complete :
    Code:
    <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sug="http://www.sugarcrm.com/sugarcrm" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
       <soapenv:Header/>
       <soapenv:Body>
          <sug:set_entry soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
             <session xsi:type="xsd:string">xxxxxxxxxxx</session>
             <module_name xsi:type="xsd:string">Accounts</module_name>
             <name_value_list xsi:type="sug:name_value_list" soapenc:arrayType="sug:name_value[]"/>
    $$$$$$$$$$$$$$$$$$
          </sug:set_entry>
       </soapenv:Body>
    </soapenv:Envelope>
    I tried to replace $$$$$$$$$$$$$$$$$$ with many syntax but I create an empty account each time. Here are my main tries :
    array('name'[name], 'value'[Curriculum Vitae])
    ###########################
    array('name'=> 'name', 'description'=> 'Curriculum Vitae')
    ###########################
    [array('name':name, 'value':Curriculum Vitae)]
    ###########################
    [name[0]=name, value[0]=Curriculum Vitae]
    ###########################
    <name xsi:type="xsd:string">Egypt</name>
    ###########################
    <name>Egypt</name>
    ###########################
    [array(name[name], value[Curriculum Vitae])]
    ###########################
    array(
    array('name' => 'name', 'value' => 'nom'),
    array('name' => 'description', 'value' => 'description')
    )
    ###########################
    <name_value>
    <name>
    name
    </name>
    <value>
    new test
    </value>
    ###########################

    I searched for a long time on the forum and on Google, but I couldn't get it right...
    Please help me find the proper way to write a name_value array from this "user friendly" SOAP interface!!!

    Thanks a lot in advance ; and sorry for the dumminess of this issue :-(

  2. #2
    vinay.bist is offline Junior Member
    Join Date
    Dec 2008
    Posts
    1

    Default Re: SOAP without php : good syntax for "name_value_list"

    Hi, try the below in the SOAP interface -

    <name_value_list xsi:type="sug:name_value_list" soapenc:arrayType="sug:name_value[4]">
    <name_value xsi:type="sug:name_value">
    <name xsi:type="xsd:string">name</name>
    <value xsi:type="xsd:string">EverettUser</value>
    </name_value>
    <name_value xsi:type="sug:name_value">
    <name xsi:type="xsd:string">website</name>
    <value xsi:type="xsd:string">sanyo@h.com</value>
    </name_value>
    <name_value xsi:type="sug:name_value">
    <name xsi:type="xsd:string">phone_office</name>
    <value xsi:type="xsd:string">323232323</value>
    </name_value>
    <name_value xsi:type="sug:name_value">
    <name xsi:type="xsd:string">description</name>
    <value xsi:type="xsd:string">Web madee Site</value>
    </name_value>
    </name_value_list>

    Here I use the array size [4] of name_value class, u can use according to your attributes list. May it works for you!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. PHP Warnings after install add-in Module
    By kgeving in forum Help
    Replies: 1
    Last Post: 2006-08-08, 05:54 PM
  2. Errors after upgrade
    By mturany in forum Help
    Replies: 0
    Last Post: 2006-04-24, 04:40 AM
  3. ERROR in 4.01
    By rateck in forum Help
    Replies: 3
    Last Post: 2006-02-02, 10:00 PM
  4. Replies: 7
    Last Post: 2005-05-10, 08:25 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •