Troubleshooting the Web Services API Issues

Contents
casp102
Contents
Common Issues
If you are experiencing problems when using the
CA Spectrum
Web Services API, check the following:
  • Is the URL constructed correctly?
  • Is the correct verb used with the noun?
  • Is the Request XML for GET Tunneling constructed correctly?
  • Have the proper credentials been entered?
  • Has the "accept" header and "Content-type" been set correctly for XML or JSON?
  • Do any
    CA Spectrum
    Web Services API errors appear in the tomcat log?
"Next" Link Does not Work
Symptom:
The "next" link that was generated in a response does not work correctly when I try to retrieve the next throttled set of results.
Solution:
The format of the parameters within the generated link may vary depending on your environment. For example, "&" may be generated as "&" This is due to differences between XML, HTTP, and JSON formatting standards. Notice the difference in the prefixes for the start and throttlesize parameters in the following URLs:
http://localhost/spectrum/restful/models?id=5b03b5ba-64ed-4603-b3e1-8e71919fccd8&start=2&throttlesize=2 http://localhost/spectrum/restful/models?id=5b03b5ba-64ed-4603-b3e1-8e71919fccd8&start=2&throttlesize=2
To correct, change '&amp' to '&' in your URL.
This applies to XML only (not JSON).
Web Services API Search Crashes the SpectroSERVER
Symptom
:
The CA Spectrum SpectroSERVER crashes shortly after running a webservices api search.
The stack output will look similar to this (with the key beingCsModelDomainSrvc::getModelIDListByXmlSearchCriteria):
#0 0x00002b2f85bc9ca0 in CsBuffer::makestr(int, char) const () from /opt/SPECTRUM/lib/libGlobl.so.1 #0 0x00002b2f85bc9ca0 in CsBuffer::makestr(int, char) const () from /opt/SPECTRUM/lib/libGlobl.so.1 #1 0x00002b2f7e8d46cb in CsLandscape::search_keyed_models(CsFindSpec const*, CsULHashTable*, CsFindSpec::LogicalOp_e, CsULHashTable*, int) () from /opt/SPECTRUM/lib/../SS/libsskrnl.so.1 #2 0x00002b2f7e8d4ad7 in CsLandscape::terminal_find_model_handles(CsFindSpec const*, CsULHashTable*, CsFindSpec::LogicalOp_e, CsError::CsError_e*, int) () from /opt/SPECTRUM/lib/../SS/libsskrnl.so.1  #3 0x00002b2f7e8d4ee6 in CsLandscape::find_model_handles(CsFindSpec const*, CsError::CsError_e*, CsSecurityIf const*, int) () from /opt/SPECTRUM/lib/../SS/libsskrnl.so.1 #4 0x00002b2f7e8d5786 in CsLandscape::find_models(CsFindSpec const*, CsSecurityIf const*, int) () from /opt/SPECTRUM/lib/../SS/libsskrnl.so.1 #5 0x00002b2f7e8d5871 in CsLandscape::find_models(CsFindSpec const*, CsSecurityIf const*) () from /opt/SPECTRUM/lib/../SS/libsskrnl.so.1 #6 0x00002b2f7e8f8d04 in CsModelDomainSrvc::get_model_desc_list(CsSecurityIf const&, char const*, char const*, CsULHashTable*) () from /opt/SPECTRUM/lib/../SS/libsskrnl.so.1 #7 0x00002b2f7e8f9b4c in CsModelDomainSrvc::getModelIDListByXmlSearchCriteria(CsCAttribute::CsCValue const&, CsSecurityIf const&) () from /opt/SPECTRUM/lib/../SS/libsskrnl.so.1 #8 0x00002b2f7e858217 in CModelDomainItcM::processItcRequest(ITC_Request_Parms*) () from /opt/SPECTRUM/lib/../SS/libsskrnl.so.1 #9 0x00002b2f80fb30d4 in ITC_Request_Parms_Corba::processRequest_TransferExceptions() () from /opt/SPECTRUM/lib/libitc.so.1 #10 0x00002b2f80fb28e1 in ItcWorkQueue::process_work_item(ItcQdItem*) () from /opt/SPECTRUM/lib/libitc.so.1 #11 0x00002b2f80fb26a2 in ItcWorkQueue::process_work_node(CsWorkNode*) () from /opt/SPECTRUM/lib/libitc.so.1 #12 0x00002b2f8340d3aa in CsWorkScheduler::do_work() () from /opt/SPECTRUM/lib/libwkmgr.so.1 #13 0x00002b2f7ebde7a3 in moot_thread_start () from /opt/SPECTRUM/lib/libmoot.so.1 #14 0x00000031a16419e0 in ?? ()
Cause:
The cause is due to an incompatible search type in the web service query.
For example, the isManaged attribute (0x1295d) only supports and "equal" value.
It will not support "has-substring" or "has-substring-ignore-case"
Solution:
Check your web services search. If you are using an "incorrect" search type for the attribute you are searching on you will need to correct it. If you are unsure that you are using an incorrect search type, you can create the same search in the OneClick Locater and save the search. Then review the xml associated to the search on the OneClick web server in the <SPECROOT>/custom/console/config directory.
For example, this search for the isManaged attribute (0x1295d) will crash your SpectroSERVER because the isManaged attribute will not work with a substring search:
<has-substring-ignore-case>
<attribute id="0x1295d">
<value>no</value>
</attribute>
</has-substring-ignore-case>
This needs to be updated to be:
<equals>
<attribute id="0x1295d">
<value>no</value>
</attribute>
</equals>