CA Service Management

  • 1.  How to pass UUID values in CallServerMethod SOAP Web Services

    Posted Jul 16, 2018 08:37 PM

    I'm trying to use the CallServerMethod to use the SPEL API insert_object method. Everything worked fine callind the function, but one of the parameters it requires is the UUID of the user. Since the definition of the method has string as parameters it will reject it saying that string is not valid for a UUID.I've tried using the cnt:*** or U'***' format, but the problem is related to the type defined as string in the xml. I've also tried changing string to handle as per a recommendation of another forum but that did not work as well.

     

    This is the example code:

     

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://www.ca.com/UnicenterServicePlus/ServiceDesk">
    <soapenv:Header/>
    <soapenv:Body>
    <ser:callServerMethod>
    <sid>839479796</sid>
    <methodName>insert_object</methodName>
    <factoryName>api</factoryName>
    <formatList></formatList>
    <parameters>
    <string>cnt:BA7DE0ADD82EEC40A907CD132BE64D9B</string>
    <string>NULL</string>
    <string>0</string>
    <string>obj_id</string>
    <string>cr:1544588</string>
    <string>wait_time</string>
    <string>5</string>
    <string>event_tmpl</string>
    <string>evt:400505</string>
    </parameters>
    </ser:callServerMethod>
    </soapenv:Body>
    </soapenv:Envelope>

     

    Response:

     

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
    <soapenv:Fault>
    <faultcode>soapenv:Client</faultcode>
    <faultstring>Bad arguments. Does not match signature.</faultstring>
    <faultactor/>
    <detail>
    <ErrorMessage>Bad arguments. Does not match signature.</ErrorMessage>
    <ErrorCode>5</ErrorCode>
    </detail>
    </soapenv:Fault>
    </soapenv:Body>
    </soapenv:Envelope>



  • 2.  Re: How to pass UUID values in CallServerMethod SOAP Web Services

    Broadcom Employee
    Posted Jul 16, 2018 09:41 PM

    Hi Ignacio

     

    Unfortunately, this is a limitation of the callServerMethod web services method as it can only pass interger, string or null parameters to the spel method that is being called. A method with object parameters like insert_object  can not be called with callServerMethod()

    Also note that in the documentation, it states that 'This method is intended for CA Development and services for customizations only; it is not recommended for most sites.'

     

    Regards,

    Gordon.



  • 3.  Re: How to pass UUID values in CallServerMethod SOAP Web Services

    Posted Jul 16, 2018 09:48 PM

    Well, this is kind of frustrating, it seems that all the possible paths are blocked. I mean I need to attach an SLA, it can be done via WS since it only works with classic SLA. The rules in SDM do not allow such a complex and dynamic rule as we need. The only possible way was to do it using the insert_object method for each event. But now we have a method via webservices to call the SPEL but it does not allow the type of data needed. 

    Anyway, it seems there's a lot of opportunities to improve here.



  • 4.  Re: How to pass UUID values in CallServerMethod SOAP Web Services

    Posted Jul 17, 2018 12:44 AM

    Hi,

    you can wrap ootb method with your own, so you'll be able to pass uuid as string to your method which will handle it and pass furthur as uuid.

    example:

    // FILENAME: z_att_evt.maj  
    OBJECT api { 
        FACTORY { 
            METHODS { 
                z_att_evt(string obj_id, string evt, int delay, string cnt); 
            }; 
        }; 
    }; 

    // FILENAME: z_att_evt.spl 
    api::z_att_evt(string obj_id, string evt, int delay, string cnt) { 
        <...>
    }

     

    ps: I dont see any factory defined in your example;

    ps2: if you're attaching an event better to use SPEL EVENT methods instead of plain insert object;

     

    Regards,

    Timur



  • 5.  Re: How to pass UUID values in CallServerMethod SOAP Web Services
    Best Answer

    Posted Jul 18, 2018 02:55 PM

    I'm curious, what prevents you from creating it via webservice?

     

    createObject with "atev" as the objectType should create an attached event.

     

    Isn't it what you want to achieve?



  • 6.  Re: How to pass UUID values in CallServerMethod SOAP Web Services

    Posted Jul 19, 2018 06:50 PM

    I'm very grateful, you are indeed right. That was the best way to achieve this. I've tried it and resolved it. 
    We ended up with that solution because support from CA told us to go in that direction since there was no other way to attach an event when classic sla is not in use.

    I will make a post about this showing how to do it. 

    Once again thanks Oliver!!



  • 7.  Re: How to pass UUID values in CallServerMethod SOAP Web Services

    Posted Jul 20, 2018 08:51 AM

    Glad I helped