How to update uCMDB via webservices (398 Views)
Reply
Occasional Visitor
MilanZ
Posts: 2
Registered: ‎01-21-2013
Message 1 of 4 (398 Views)

How to update uCMDB via webservices

[ Edited ]

Hello everybody,

I need to update CI attributes in uCMDB via WSDL. I created two CI custom attributes. The first is created as string type and the second as integer type. There is no problem to update string type attribute but I have trouble to update integer attribute type

 

part of xlm file for update string attribute:
        <soapenv:Body>
                <upd:updateCIsAndRelations>
                        <upd:cmdbContext>
                                <typ:callerApplication>synch_cmdb</typ:callerApplication>
                        </upd:cmdbContext>
                        <upd:CIsAndRelationsUpdates>
                                <upd1:CIsForUpdate>
                                                <typ:CI>
                                                        <typ:ID temp="false">a3ff45a859e106fe35c3920a843c946a</typ:ID>
                                                        <typ:type>storage_disk_part</typ:type>
                                                        <typ:props>
                                                                <typ:strProps>
                                                                        <typ:strProp>
                                                                                <typ:name>storage_disk_part_storage_name</typ:name>
                                                                                <typ:value>myname</typ:value>
                                                                        </typ:strProp>
                                                                </typ:strProps>
                                                        </typ:props>
                                                </typ:CI>
                                        </upd1:CIsForUpdate>
                        </upd:CIsAndRelationsUpdates>
                        <upd:ignoreValidation>false</upd:ignoreValidation>
                </upd:updateCIsAndRelations>
        </soap:Body>
 

part of xlm file for update integer attribute :      
        <soapenv:Body>
        <upd:updateCIsAndRelations>
                <upd:cmdbContext>
                        <typ:callerApplication>synch_cmdb</typ:callerApplication>
                </upd:cmdbContext>
                <upd:CIsAndRelationsUpdates>
                        <upd1:CIsForUpdate>
                                        <typ:CI>
                                                <typ:ID temp="false">a3ff45a859e106fe35c3920a843c946a</typ:ID>
                                                <typ:type>storage_disk_part</typ:type>
                                                <typ:props>
                                                        <typ:intProps>
                                                                <typ:intProp>
                                                                        <typ:name>storage_disk_part_storage_gbi</typ:name>
                                                                        <typ:value>1023</typ:value>
                                                                </typ:intProp>
                                                        </typ:intProps>
                                                </typ:props>
                                        </typ:CI>
                                </upd1:CIsForUpdate>
                </upd:CIsAndRelationsUpdates>
                <upd:ignoreValidation>false</upd:ignoreValidation>
        </upd:updateCIsAndRelations>
</soap:Body>

The error that is returned when integer attribute is updated:

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header/><soapenv:Body><soapenv:Fault><faultcode>soapenv:Client</faultcode><faultstring>operation updateCIsAndRelations error: validation error occured, class [storage_disk_part].  Error in properties type validation : there is no appropriate attribute for property:(integer-st
orage_disk_part_storage_gbi:1023); nested exception is:
        java.lang.Exception: </faultstring><detail><ucmdbparams:ucmdbFault xmlns:ucmdbparams="http://schemas.hp.com/ucmdb/1/params/ucmdb"><ucmdbparams:msg>validation error occured, class [storage_disk_part].  Error in properties type validation : there is no appropriate attribute for property:(integer-storage_disk_part_storage_gbi:1023); nested exception is:
        java.lang.Exception: </ucmdbparams:msg><ucmdbparams:stacktrace>stack trace is N/A</ucmdbparams:stacktrace></ucmdbparams:ucmdbFault></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>

Regards,

Milan

 

P.S. This thread has been moved from Application Perf Mgmt (BAC / BSM) Support and News Forum to CMS and Discovery Support and News Forum. -HP Forum Moderator

HP Expert
Asaf Shechter
Posts: 1,353
Registered: ‎12-09-2008
Message 2 of 4 (393 Views)

Re: How to update uCMDB via webservices

please make sure that the attribute: storage_disk_part_storage_gbi is really defined as Integer. it looks like you have validation error on this attribute type.
Occasional Visitor
MilanZ
Posts: 2
Registered: ‎01-21-2013
Message 3 of 4 (390 Views)

Re: How to update uCMDB via webservices

Hi Asaf,

The attribute is realy set as integer. I attached screenshot.

Milan

Regular Visitor
Jouni_v
Posts: 1
Registered: ‎12-23-2011
Message 4 of 4 (264 Views)

Re: How to update uCMDB via webservices

Hi. Thanks your Saop xml messages, pictures tells more than works -many times. 

 

I can too update by soap using <CIsAndRelationsUpdates>   under <type>node</type> many props , but how I update till.example device Location and Party  attributes, just these that belongs to that device s global_id ? 

May I use 

     updates.CIsForUpdate = ci;  // collection)    to node  device atributes (that works)

 and

    updates.referencedCIs = ciR; //collection of Locations attributes    (that not works)

 

Many thanks

 

<CIsAndRelationsUpdates>

    <CIsForUpdatexmlns=http://schemas.hp.com/ucmdb/1/types/update>   

    <CIxmlns=http://schemas.hp.com/ucmdb/1/types>

       <ID>63242fe46cdb9b8a811d67bbb08c7f2e</ID>

          <type>node</type>

           <props>

            <strProps>

             <strProp>

              <name>net_bios_name</name>

              <value>net_bios_name..my bioas name</value>

             </strProp>

           </strProps>

          </props>

       </CI>

     </CIsForUpdate>

    <referencedCIsxmlns=http://schemas.hp.com/ucmdb/1/types/update>

    <CIxmlns=http://schemas.hp.com/ucmdb/1/types>

      <ID>63242fe46cdb9b8a811d67bbb08c7f2e</ID>

       <type>location</type>

        <props>  

         <strProps>

          <strProp>

           <name>street_address</name>

             <value>My Street 5a</value>

           </strProp>

         </strProps>

        </props>

     </CI>

   </referencedCIs>

</CIsAndRelationsUpdates>

<ignoreValidation>false</ignoreValidation>

</updateCIsAndRelations>

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.