Clarity Service Management

Expand all | Collapse all

ITAM Update webservice use

  • 1.  ITAM Update webservice use

    Posted 04-18-2015 10:12 AM

    Hi All,

    I am using Update webservice of ITAM wsdl

    What all arguments are to be passed to access this service

    Can anyone illustrate me how to use this ?

     

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:core="http://schemas.datacontract.org/2004/07/CA/ITAM/Service/Core" xmlns:apis="http://www.ca.com/ITAM/APIService" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">

       <soapenv:Header>

          <core:ITAMHeader>

             <!--Optional:-->

             <core:TicketID>AyWBsTaLVU22EZN3oQzTRA==</core:TicketID>

          </core:ITAMHeader>

       </soapenv:Header>

       <soapenv:Body>

          <apis:Update>

             <!--Optional:-->

             <apis:objects>

                <!--Zero or more repetitions:-->

                <core:ITAMObject>

                   <!--Optional:-->

                   <core:FieldstoNull>

                      <!--Zero or more repetitions:-->

                      <arr:string>?</arr:string>

                   </core:FieldstoNull>

                </core:ITAMObject>

             </apis:objects>

          </apis:Update>

       </soapenv:Body>

    </soapenv:Envelope>

     

    Regards

    Winkle Khurana



  • 2.  Re: ITAM Update webservice use

    Posted 04-19-2015 02:32 PM

    Hi Guys,

     

    Does anyone know the answer



  • 3.  Re: ITAM Update webservice use

    Posted 04-20-2015 09:31 AM

    The below code in some C# that creates and searches for an asset.  Instead of using the Create method, you would need to use the Update method, but the parameters are the same.

     

            static void Main(string[] args)
            {
                // attempt to login to APM
                TAMServiceClient itsc = new TAMServiceClient("BasicHttpBinding_ITAMService");
                ITAMHeader ithdr = new ITAMHeader();
                try
                {
                    // login and get a session/ticket 
                    String tid = itsc.Login(ref ithdr, "uapmadmin", "uapmadmin");
                }
                catch (Exception ex)
                {
                    System.Console.WriteLine("Exceptiopn on Login: " + ex.Message);
                    System.Console.WriteLine(ex.StackTrace);
                    // Since login failed, end the program
                    Environment.Exit(0);
                }
                // search for an object, in this case, an Asset
                // create the asset with the atributes you want to search on
                asset myasset = new asset();
                myasset.serialnumber = "ABCD";
                myasset.modelid = null;
                myasset.assetfamilyid = null;
                myasset.classkey = null;
                myasset.assetname = null;
    
                List<ITAMObject> assetCreate = new List<ITAMObject>();
                assetCreate.Add(myasset);
                myasset = new asset();
                myasset.serialnumber = "ABCD_2";
                myasset.modelid = null;
                myasset.assetfamilyid = null;
                myasset.classkey = null;
                myasset.assetname = null;
                assetCreate.Add(myasset);
                itsc.Create(ref ithdr, assetCreate);
    
    
                // create the SearchDefinition and criteria
                SearchDefinition sd = new SearchDefinition();
                Criteria sdcriteria = new Criteria();
                Criterion sdcriterion = new Criterion();
                //set the criterion/criteria for the search
                sdcriterion.Operator = Operator.Equal; // search for matches
                sdcriterion.SearchObjects = new List<ITAMObject>() { myasset };   //create the object array of what objects to search for
                sdcriteria.CriteriaList = new List<Criterion>() { sdcriterion };  //set the criterion for the search
                sd.Criteria = sdcriteria;   // set the criteria for the search
                List<ITAMObject> sdresults = null;
                try
                {
                    sdresults = itsc.Search(ref ithdr, sd);
                    //ITAMObject[] sdresults = itsc.Search(ref ithdr, sd);
                    // process the array of results.  Its an array due to the fact that the serarch may have returned more than one result
                    // check for emtpy array which means no results
                    System.Console.WriteLine(sdresults.Count);
                    foreach (ITAMObject iobj in sdresults)
                    {
                        asset theasset = (asset)iobj;
                        System.Console.WriteLine(theasset.assetname);
                    }
                }
                catch (Exception ex)
                {
                    System.Console.WriteLine("Exceptiopn on Search: " + ex.Message);
                    System.Console.WriteLine(ex.StackTrace);
                }
               
    
                // logout of the APM session
                try
                {
                    itsc.Logout(ref ithdr);
                }
                catch (Exception ex)
                {
                    System.Console.WriteLine("Exceptiopn on Logout: " + ex.Message);
                    System.Console.WriteLine(ex.StackTrace);
                    // Since login failed, end the program
                    Environment.Exit(0);
                }
            }
    

    I do not have the SOAP Envelope created by this call to share, but I hope this helps.

     

    Also, be aware that the code above is a sample only, and would need to updated to work.  An asset needs a model, and a family and class, and I have all those set to 'null' in the example, but I hope its enough to get you on the right track.

     

    Rick



  • 4.  Re: ITAM Update webservice use

    Posted 01-31-2017 08:29 AM

    Does anyone know how to use update wsdl  ITAM SOAP??



  • 5.  Re: ITAM Update webservice use

    Posted 02-01-2017 05:51 PM

    Please provide a bit more context into what you're looking for.

     

    Thanks,

    John



  • 6.  Re: ITAM Update webservice use

    Posted 04-20-2017 05:06 PM

    Did you ever get an answer to how to use the APM "Update" Webservice through the WSDL?  I'm trying to do the same using a SOAP operator in Process Automation.



  • 7.  Re: ITAM Update webservice use

    Posted 04-24-2017 01:04 PM

    Hi Thomas,

    There's a previous message that may shed some light on your question:

     

    ITAM webservice usage:

    https://communities.ca.com/message/241955958?commentID=241955958#comment-241955958 

    andre.prins wrote: "I noticed this also in creating or updating a record, some of the fields have this xxxxxxxSpecified field, which you have to set to true otherwise the change is not applied for that field."

     

    Regards,

    Heikki Ikonen

    Netgain



  • 8.  Re: ITAM Update webservice use

    Posted 04-24-2017 03:39 PM

    Thanks Heikki.  I was finally able to figure out how to configure a Process Automation SOAP operator to successfully call into APM.