Translate

Thursday, April 25, 2013

Using Web services in SailPoint IIQ

SailPoint has a lot of predefined REST web services which can be used to call specific functions from a web service client.
If you have requirement to execute a task or report without using the Sailpoint UI or console directly, then you can use the web services option, or it can be any general requirement.

Web services can be used in two different ways in Sailpoint.


  • Using IIQclient class
  • Creating custom web service 

Using IIQclient class
  1. Import the identityiq.jar file in eclipse. This jar contains the class sailpoint.integration.IIQClient; which contains the default functions provided by sailpoint to call the web services.
  2. Create a sample class to create a object of iiqclient class to call the functions available publicly 
  3.  Download the  REST API Integration pdf from compass, which has all the functions listed in details.


 Custom Web Service
  1. Creating custom web service as per the needs is the best option to develop the function as per requirements.
  2. Create a custom web service method class which will extend BaseResource class.
  3. BaseResource class will give you the context object of sailpoint to create methods as required.
  4. Create a class which will extend the SailPointRestApplication.java to include the method create in step3
  5. Go to web.xml and modify the value of   javax.ws.rs.Application to your custom class.
  6. Now you can call the custom webservice using any client which can all REST web services.
  7. The return type of REST web-services is JSON, which needs to be converted to process it properly.
 
customwebservice_method.java
import sailpoint.rest.BaseResource;
import sailpoint.tools.GeneralException;

import javax.ws.rs.GET;
import javax.ws.rs.Path;

@Path("/executeTask")

public class CustomWebServiceMethod extends BaseResource{

      @GET
      public void getApplication() throws GeneralException
      {..

 customwebservice.java
public class CustomWebService extends SailPointRestApplication{
     
      public Set < Class < ? > > getClasses()
      {
            System.out.println("hello");
            Set < Class < ? > &gt classes = super.getClasses();
            classes.add(CustomWebServiceMethod.class);






1 comment:

  1. Is there a way to invoke "import filename.xml" command from REST API? If Yes, Kindly share an sample/example code. Thank you.

    ReplyDelete