CA Service Management

Expand all | Collapse all

WebService - How can I make a Ticket using the Web Service?

Jump to Best Answer
  • 1.  WebService - How can I make a Ticket using the Web Service?

    Posted 03-23-2018 11:05 AM

    Hello dear community, I have a question, I'm new using the WebService, and I'm trying to make a ticket and I don't know what thing I'm doing wrong, here is my code:

     

    <ser:createRequest>
    <sid>number of sid</sid>
    <creatorHandle>here I put the cnt value</creatorHandle>
    <attrVals>
    <!--1 or more repetitions:-->
    <string>tenant</string>
    <string>Test Tenant</string>
    <string>Applicant</string> 
    <string>User_lastname, User_name</string>
    <string>End User Affected</string>
    <string>User_lastname, User_name</string>
    <string>Report method</string>
    <string>Other</string>
    <string>Group</string>
    <string>Test_Group</string>
    <string>Incident Area</string>
    <string>Test_Incident_Area</string>
    <string>Priority</string>
    <string>2</string>
    <string>summary</string>
    <string>Test Summary</string>
    <string>description</string>
    <string>Test Description</string>
    </attrVals>
    <propertyValues>
    </propertyValues>
    <attributes>
    </attributes>
    </ser:createRequest>

     

    And this resturns me:

     

    <soapenv:Body>
    <soapenv:Fault>
    <faultcode>soapenv:Client</faultcode>
    <faultstring>Error - invalid parameter</faultstring>
    <faultactor/>
    <detail>
    <ErrorMessage>Error - invalid parameter</ErrorMessage>
    <ErrorCode>1000</ErrorCode>
    </detail>
    </soapenv:Fault>
    </soapenv:Body>

     

    Someone can help me? what i'm doing wrong?

     

    Forward Thanks!!!



  • 2.  Re: WebService - How can I make a Ticket using the Web Service?

    Posted 03-23-2018 11:51 AM

    Carlos, those attributes are not right. Take a look at

    Call Request (cr) Object - CA Service Management - 17.1 - CA Technologies Documentation 

    Thanks _Chi



  • 3.  Re: WebService - How can I make a Ticket using the Web Service?

    Posted 03-23-2018 01:07 PM

    Thanks for the help Chi!, but Can you show me how it works? or what fields I have to replace? Please!



  • 4.  Re: WebService - How can I make a Ticket using the Web Service?

    Posted 03-23-2018 01:24 PM

    Hi,

    first you need to get correct attribute names, you can fetch them using cmd, type:

    bop_sinfo -a cr

    to get all attrbitues related to cr (Request/Incidet/Problem factory), then, if attribute type is SREL (single relation to other factory) you need to pass foreigen key (REL_ATTR) as attr value. You can check which attribute is REL_ATTR using cmd:

    bop_sinfo -f cnt

     

    Now you know that cr have attribute called customer which is required and related with cnt factory which foreigen key is persistent_id, so you can start from:

    <attrVals>
    <!--1 or more repetitions:-->
    <string>customer</string>
    <string>cnt:<some hex UUID here></string>

    and so on.

     

    PS: if you haven't access to sdm env you can check some attributes here: Objects and Attributes - CA Service Management - 14.1 - CA Technologies Documentation 

    edited: oh Chi already provided it

     

    Regards,

    Timur Alimov



  • 5.  Re: WebService - How can I make a Ticket using the Web Service?

    Posted 03-23-2018 03:22 PM

    I edit all the method and still without working... here is my new code:

     

        <soapenv:Body>
        <ser:createRequest>
        <sid>sid</sid>
        <creatorHandle>cnt:A5F1C9C1011C764FBB982EFAB76ADCB0</creatorHandle>
         <attrVals>
         <!--1 or more repetitions:-->
         <string>tenant</string>
         <string>31635402584F964A95C8D7277C070306</string>
         <string>requested_by_combo_name</string>
        <string>cnt:A5F1C9C1011C764FBB982EFAB76ADCB0</string>
        <string>customer</string>
        <string>cnt:A5F1C9C1011C764FBB982EFAB76ADCB0</string>
        <string>zreporting_met</string>
        <string>7300</string>
        <string>category</string>
        <string>1121023953</string>
        <string>group</string>
        <string>21B93E5385DD7D4D8D464E71810A06B0</string>
        <string>priority</string>
        <string>2</string>
        <string>summary</string>
        <string>Prueba Resumen</string>
        <string>description</string>
        <string>Prueba de Descripcion</string>
        </attrVals>
        <propertyValues>
        </propertyValues>
        <attributes>
        </attributes>
        </ser:createRequest>
        </soapenv:Body>

     

    This retuens me the same error...

    What's wrong? 



  • 6.  Re: WebService - How can I make a Ticket using the Web Service?

    Posted 03-23-2018 03:55 PM

    Carlos, what is the actual error you are getting?



  • 7.  Re: WebService - How can I make a Ticket using the Web Service?

    Posted 03-23-2018 04:01 PM

    Jon the method returns me:

     

    <soapenv:Body>
    <soapenv:Fault>
    <faultcode>soapenv:Client</faultcode>
    <faultstring>Error - invalid parameter</faultstring>
    <faultactor/>
    <detail>
    <ErrorMessage>Error - invalid parameter</ErrorMessage>
    <ErrorCode>1000</ErrorCode>
    </detail>
    </soapenv:Fault>
    </soapenv:Body>

     

    And now I try this

     

    <soapenv:Header/>
    <soapenv:Body>
    <ser:createRequest>
    <sid>sid</sid>
    <creatorHandle>A5F1C9C1011C764FBB982EFAB76ADCB0</creatorHandle>
    <attrVals>
    <!--1 or more repetitions:-->
    <string>tenant</string>
    <string>31635402584F964A95C8D7277C070306</string>
    <string>requested_by</string>
    <string>cnt:A5F1C9C1011C764FBB982EFAB76ADCB0</string>
    <string>customer</string>
    <string>cnt:A5F1C9C1011C764FBB982EFAB76ADCB0</string>
    <string>zreporting_met</string>
    <string>rptmeth:7300</string>
    <string>category</string>
    <string>pcat_cr:1121023953</string>
    <string>group</string>
    <string>grp:21B93E5385DD7D4D8D464E71810A06B0</string>
    <string>status</string>
    <string>crs:5200</string>
    <string>priority</string>
    <string>pri:2</string>
    <string>summary</string>
    <string>'Prueba Resumen'</string>
    <string>description</string>
    <string>'Prueba de Descripcion'</string>
    </attrVals>
    <propertyValues>
    </propertyValues>
    <attributes>
    </attributes>
    </ser:createRequest>
    </soapenv:Body>
    </soapenv:Envelope>

     

    And it didn't work either, Do you know what I'm doing wrong?



  • 8.  Re: WebService - How can I make a Ticket using the Web Service?

    Posted 03-23-2018 04:26 PM

    Have you tried to do a simple one with maybe just a few fields (including any required ones...)?  You are passing a lot of stuff... not sure which one its getting stuck on .



  • 9.  Re: WebService - How can I make a Ticket using the Web Service?

    Posted 03-23-2018 05:02 PM

    Carlos,

     

    Can you try to add this and verify:

     

     <template></template>

     

    It can go right after

    <propertyValues>
    </propertyValues>

     

     

    _R



  • 10.  Re: WebService - How can I make a Ticket using the Web Service?

     
    Posted 03-25-2018 10:14 PM

    Most 'attrVals' parameters will expect a code or identifier, not a persid.  For Status pass the code (e.g. CLS), for priority pass the enum (1-5) - and the enum of course is 1 for priority 5, and 5 for priority 1.  For SID, pass the SID retrieved from a call to 'logon'.  Quotes are not needed around the summary and description.  The value 1121023953 for category appears to be outside the range you'd normally expect for an SDM identifier, where did it come from? (and again, leave off the 'pcat_cr:').

     

    cdtj shows you how to look up the actual attribute names and inspect existing tickets to see their contents.

    Jon_Israel 's approach is strongly recommended - start with one or two attributes and add them one at a time.



  • 11.  Re: WebService - How can I make a Ticket using the Web Service?
    Best Answer

    Posted 03-28-2018 11:45 AM

    Several errors or let me say mistakes are in the example above.

     

    <sid>sid</sid>

    is wrong. you first need to do a login call to get a real SID and the place this session id in any further SOAP call as the <sid> value

     

    <creatorHandle>A5F1C9C1011C764FBB982EFAB76ADCB0</creatorHandle>

    you need to specify a so called cnt persistent id as you did in all other so called srel attributes values

    so something like this might work: 

    <creatorHandle>cnt:A5F1C9C1011C764FBB982EFAB76ADCB0</creatorHandle>

     

    <string>tenant</string>
    <string>31635402584F964A95C8D7277C070306</string>

    remove the tenant stuff. the tenant is set automatically by the system.

     

    <string>category</string>
    <string>pcat_cr:1121023953</string>

    I wouldn't use "pcat_cr", go for the following:

    <string>category</string>
    <string>pcat:1121023953</string>

     

    <string>priority</string>

    <string>pri:2</string>

    pri:2 is not a valid persistent_id for a priority , the following might work

    <string>priority</string>
    <string>pri:503</string>

     

    as Raghu suggested add

    <template></template>

    right in between

    </propertyValues>

    <attributes>

    it is part of the soap schema and must be provided even with a null value

     

    In general make sure that all referenced persistent_id's exist.

     

    With these changes and of course persistent id's of my own system and after removing your custom attribute, the soap request was working on my test box

    Hope this helps

    Best regards

    .........Michael



  • 12.  Re: WebService - How can I make a Ticket using the Web Service?

    Posted 03-28-2018 11:49 AM

    THANKS DUDE!!!! you are awesome!



  • 13.  Re: WebService - How can I make a Ticket using the Web Service?

    Posted 03-23-2018 03:07 PM

    Carlos, did Timur's post help? Basically "bop_sinfo -d cr" will give you the schema of the cr object. And of course if you can't run this command handy the url links posted here should help as well. Thanks _Chi



  • 14.  Re: WebService - How can I make a Ticket using the Web Service?

    Posted 03-26-2018 04:53 AM

    Hi Carlos,

     

    The main issue is that you seem to be using wrong attribute names. As mentioned by previous contributors use the 'bop_sinfo' command to find the correct attributes. Also for simplicity, try creating a ticket with just the mandatory fields, before making it complex with all the non-mandatory fields.

     

    Please also take a look at the few JAVA sample code in $NX_ROOT\samples\sdk\websvc\java folder to get an idea.

     

    ===

    Kind Regards,

    Brian



  • 15.  Re: WebService - How can I make a Ticket using the Web Service?

    Posted 03-27-2018 11:58 AM

    Carlos.....

     

    Were you able to successfully create a SDM ticket using WebServices based on the feedback provided?



  • 16.  Re: WebService - How can I make a Ticket using the Web Service?

    Posted 04-10-2018 01:40 PM

    Yes now I'm able to create a ticket! thaks for the help