# WebService connector rule add error

**URL:** <https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998>\
**Category:** SHF Discussion and Questions\
**Tags:** webservice-connector, provisioning, sailpoint-identity-security, apis\
**Created:** [March 27, 2024, 1:33pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998 "2024-03-27T13:33:44Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![hranjan3](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hranjan3](https://developer.sailpoint.com/discuss/u/hranjan3)\
**Post date:** [March 27, 2024, 1:33pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998/1 "2024-03-27T13:33:45Z")

</div>

Hi, I am configuring one WebService connector first time in Sandbox environment. I am able to fetch accounts from target source using webservice connector in Sailpoint, but I am not able to create account. Could you please suggest if I am missing any steps.

Here are the steps I have completed:

1. Sailpoint Webservice application configuration, test connection fine,

2. Configure http operations - Test connection, Account Aggregation, Create Account  

3. Created two rules -  
“description”: “IDN\_BeforeOperation\_App\_Rule\_Add\_and\_Remove\_Entitlement”,  
“type”: “WebServiceBeforeOperationRule”,

“description”: “IDN\_AfterOperation\_App\_Rule\_Add\_and\_Remove\_Entitlement”,  
“type”: “WebServiceAfterOperationRule”,

1. I am trying to add rule as beforeProvisioningRule but I am getting below error.  
 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/0/0a04a1e36b4ea20fbcf7b4194e12a075a0176a24.png)

---

<div class="post-metadata">

**Author:** ![hranjan3](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hranjan3](https://developer.sailpoint.com/discuss/u/hranjan3)\
**Post date:** [March 27, 2024, 1:42pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998/2 "2024-03-27T13:42:59Z")

</div>

This WebService Connector just require FirstName, LastName, Email and EmployeeId to create an account on target system.

---

<div class="post-metadata">

**Author:** ![zachm117](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/zachm117/32/3883_2.png) [@zachm117](https://developer.sailpoint.com/discuss/u/zachm117)\
**Post date:** [March 27, 2024, 2:25pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998/3 "2024-03-27T14:25:52Z")

</div>

Hi Himanshu,

It looks like you are trying to use an After Operation rule but your Postman body is trying to update the beforeProvisioningRule field. Assuming you are trying to use the After Operation rule on a Web Services connector, you will want to use this body where X is the sequenceNumberForEndpoint value for the operation you are trying to apply this rule to.

You can get this value by calling a GET on your source, look under /connectorAttributes/connectionParameters, find the operation you are trying to add this rule to, and copying the “sequenceNumberForEndpoint” value to replace X in the ‘path’ field of the below body.

```auto
[
  {
    "op" : "add",
    "path" : "/connectorAttributes/connectionParameters/X/afterRule",
    "value" : "Your After Operation Rule Name"
  }
]

```

Additionally, that error message seems to actually be caused by Content-Type in the header of your request not being correct. Ensure that the [Content-Type value](https://developer.sailpoint.com/docs/api/v3/update-source) in your header is set to “application/json-patch+json”.

Please let me know if this helps fix your issue!

- Zach

---

<div class="post-metadata">

**Author:** ![hranjan3](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hranjan3](https://developer.sailpoint.com/discuss/u/hranjan3)\
**Post date:** [April 2, 2024, 4:55pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998/4 "2024-04-02T16:55:24Z")

</div>

@zachm117 - hope you are doing good! I am still struggling to get my web service application working. I have attached exported version of my test webservice from test env. Could you please have a look on it and suggest me which info is missing.

I tried to attach rule but I don’t see beforeRule and afterRule in my exported service json file.

Actually as per my use case I just need to call one API URL - [https://appconnect.com/external/api/rest/v2/users](https://appconnect.com/external/api/rest/v2/users)  
method - post  
body -

```auto
{
  "lastName": "get it from Sailpoint user profile",
  "firstName": "get it from Sailpoint user profile",
   "employeeId":"get it from Sailpoint user profile",
   "email": "get id from Sailpoint user profile",
   "role":"CUSTOMER"      
}

```

I am able to connect to application using webservice connect api and able to aggregation accounts. But not able to create account.

Others are welcome to provide their input here.  
[mytestWebService.json](https://developer.sailpoint.com/discuss/uploads/short-url/10xyTbjLnCQdV7balw7xh4S4z8P.json) (36.4 KB)

---

<div class="post-metadata">

**Author:** ![hranjan3](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hranjan3](https://developer.sailpoint.com/discuss/u/hranjan3)\
**Post date:** [April 2, 2024, 5:00pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998/5 "2024-04-02T17:00:36Z")

</div>

@iamnithesh - Hi Nithesh, could you also please review my issue and suggest fix.

---

<div class="post-metadata">

**Author:** ![iamnithesh](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/iamnithesh/32/42445_2.png) [@iamnithesh](https://developer.sailpoint.com/discuss/u/iamnithesh)\
**Post date:** [April 2, 2024, 6:47pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998/6 "2024-04-02T18:47:43Z")

</div>

@hranjan3  
Please share the “Create Account” configuration under “Accounts” tab as well as how are you populating the request body for the Create account API call

---

<div class="post-metadata">

**Author:** ![jrossicare](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@jrossicare](https://developer.sailpoint.com/discuss/u/jrossicare)\
**Post date:** [April 2, 2024, 10:36pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998/7 "2024-04-02T22:36:48Z")

</div>

Hi

Have you already created the Provisioning Policy for Create operation?

`POST /beta/sources/<source id>/provisioning-policies`

```auto
    {
        "name": "MY_CREATE_PP",
        "description": null,
        "usageType": "CREATE",
        "fields": [
            {
                "name": "UserID",
                ...

```

---

<div class="post-metadata">

**Author:** ![hranjan3](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hranjan3](https://developer.sailpoint.com/discuss/u/hranjan3)\
**Post date:** [April 3, 2024, 3:58am UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998/8 "2024-04-03T03:58:15Z")

</div>

Hi Nitesh,  
Thanks for your response. Here is the screenshot from Create Account tab

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/d/d38239104c45f396939d7d57e4d8dc3d8e24abc6.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/7/709a29bde2b95faed279140c7fafc9c0b02d441c.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/5/581614df5cceb8dd69e431c0a2e0803a42f0310c.png)

please let me know if you need any further info.

---

<div class="post-metadata">

**Author:** ![hranjan3](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hranjan3](https://developer.sailpoint.com/discuss/u/hranjan3)\
**Post date:** [April 3, 2024, 4:00am UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998/9 "2024-04-03T04:00:08Z")

</div>

@jrossicare Thanks for your response.

Here is the provisioning policy I have applied for my test webservice

```auto
{
    "name": "Account",
    "description": null,
    "usageType": "CREATE",
    "fields": [
        {
            "name": "MAIL",
            "transform": {
                "type": "identityAttribute",
                "attributes": {
                    "name": "email"
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        },
		{
            "name": "MAIL",
            "transform": {
                "type": "identityAttribute",
                "attributes": {
                    "name": "userName"
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        },
        {
            "name": "WORKFORCEID",
            "transform": {
                "type": "identityAttribute",
                "attributes": {
                    "name": "workforceId"
                }
            },
            "attributes": {},
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        },
		{
                "name": "employeeID",
                "transform": {
                    "type": "identityAttribute",
                    "attributes": {
                        "name": "workforceId"
                    }
                },
                "attributes": {},
                "isRequired": false,
                "type": "string",
                "isMultiValued": false
            },
			{
                "name": "employeeNumber",
                "transform": {
                    "type": "identityAttribute",
                    "attributes": {
                        "name": "workforceId"
                    }
                },
                "attributes": {},
                "isRequired": false,
                "type": "string",
                "isMultiValued": false
            },
			{
                "name": "givenName",
                "transform": {
                    "type": "identityAttribute",
                    "attributes": {
                        "name": "firstname"
                    }
                },
                "attributes": {},
                "isRequired": false,
                "type": "string",
                "isMultiValued": false
            },
			{
                "name": "sn",
                "transform": {
                    "type": "identityAttribute",
                    "attributes": {
                        "name": "lastname"
                    }
                },
                "attributes": {},
                "isRequired": false,
                "type": "string",
                "isMultiValued": false
            },
    ]
}

```

Could you please review it and let me know if anything need to change/add

---

<div class="post-metadata">

**Author:** ![jrossicare](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@jrossicare](https://developer.sailpoint.com/discuss/u/jrossicare)\
**Post date:** [April 3, 2024, 4:21am UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998/10 "2024-04-03T04:21:17Z")

</div>

looks OK.

in your Before Operation rule, you should be able to write out all your variables etc, so you can see in the CCG log what information you are passing (This isnt the full script, just a section. I have left out the imports and also setting logPrefix, which I just set to ‘source\_name WSBO’ so I can find it easier when grepping the logs)

```auto
            if (provisioningPlan != null) {
                //This part is just info dump:
                for (int i = 0 ; i < this.variables.length ; i++) {
                   String varName = this.variables[i];
                   Object varValue = null;
                   try {
                      if ("transient".equals(varName))
                         varValue = "[reserved word]";
                      else
                         varValue = eval(varName);
                   } catch (Exception ex) {
                      varValue = "[eval exception]";
                   }
                   String varClass = "void";
                   
                   if ((void != varValue) && (null != varValue))
                      varClass = varValue.getClass().getSimpleName();

                   if (void == varValue)
                       log.error(logPrefix + "x " + varName + " = void");
                   else if (null == varValue)
                       log.error(logPrefix + "x " + varName + " = null");
                   else
                       log.error(logPrefix + "x " + varName + " (" + varClass + ") = " + varValue);
                }
...
                for (AccountRequest accReq : Util.iterate(provisioningPlan.getAccountRequests())) {
                    log.error(logPrefix + "AccountRequest Operation: " + accReq.getOperation().toString() );
                    for (ProvisioningPlan.AttributeRequest attReq : Util.iterate(accReq.getAttributeRequests())) {
                        log.error(logPrefix + "attReq: " + attReq.getName() + " => " + attReq.getValue() + " (" + attReq.getValue().getClass() + ")");

```

---

<div class="post-metadata">

**Author:** ![hranjan3](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hranjan3](https://developer.sailpoint.com/discuss/u/hranjan3)\
**Post date:** [April 3, 2024, 6:36am UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998/11 "2024-04-03T06:36:15Z")

</div>

@jrossicare Thanks for your response. To attach before provisioning rule I am not able to see attribute beforeRule in my webservice. I have attached the exported version of my webservice in above communication. Could you please suggest on this.

---

<div class="post-metadata">

**Author:** ![jrossicare](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@jrossicare](https://developer.sailpoint.com/discuss/u/jrossicare)\
**Post date:** [April 3, 2024, 10:14pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998/12 "2024-04-03T22:14:12Z")

</div>

Hi

1. Upload your connector rule [create-connector-rule | SailPoint Developer Community](https://developer.sailpoint.com/docs/api/beta/create-connector-rule)

2. `GET /v3/sources/<source ID>` and look at connectorAttributes/connectionParameters part

3. Attach your rule to the HTTP Operation that needs to use it. The number ‘xxx’ should be the `connectionParameters` array position number (as it is array, starting at zero). you could just get the `sequenceNumberForEndpoint` then subtract 1

`PATCH /beta/sources/<sourceid>`

```auto
[
    {
        "op": "add",
        "path": "/connectorAttributes/connectionParameters/xxx/beforeRule",
        "value": "My Source WSBO"
    }
]

```

---

<div class="post-metadata">

**Author:** ![hranjan3](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hranjan3](https://developer.sailpoint.com/discuss/u/hranjan3)\
**Post date:** [April 4, 2024, 2:44pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998/13 "2024-04-04T14:44:07Z")

</div>

@jrossicare thanks for your response. I am successfully able to attached beforeRule to my webservice. I think now I am on last step i.e. to test create account but I found one issue. In my test webservice there is no entitlement and somewhere I read that there should be some entitlement to test webservice, so I added one more http operation for entitlement aggregation. When I did entitlement aggregation, in ccg log I saw one error:

`"message":"No paging steps defined for endpoint ''Entitlement Aggregation'', terminating paging...",`

I did some documentation read and found that I need to mention something in paging section, so I tried with this:

```auto
TERMINATE_IF $responseHeaders.link.next$ == NULL

$endpoint.fullUrl$ = $responseHeaders.link.next$

```

Now the error message is :

`"message":"PAGING: Termination triggered! Unable to evaluate paging step: $endpoint.fullUrl$ = $responseHeaders.link.next$",`

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/1/1f571d03e031875a5fe84cebc9671b420ac2b75e.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/0/09f8d23c1c57464daec3b1bf4aba36f28d7aecd1.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/6/6d2cc6ccd865d44fbd90deedd88b6dd0e2c438a5.png)

but still its not fixed.

Could you please suggest on this.

---

<div class="post-metadata">

**Author:** ![hranjan3](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hranjan3](https://developer.sailpoint.com/discuss/u/hranjan3)\
**Post date:** [April 4, 2024, 2:55pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998/14 "2024-04-04T14:55:30Z")

</div>

I tried one more option to add value in paging box:

```auto
$limit$ = 50
TERMINATE_IF $RECORDS_COUNT$ < $limit$
$offset$ = $offset$ + 1
$endpoint.fullUrl$ = $application.baseUrl$ + "/centers"
$request.PageIndex$ = $offset$

```

but its giving me below error:

```auto
"message":"PAGING: Termination triggered! Unable to evaluate paging step: $offset$ = $offset$ + 1",

"message":"==> Paging logic processing ended for endpoint ''Entitlement Aggregation''. Paging terminated: true",

```

---

<div class="post-metadata">

**Author:** ![hranjan3](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hranjan3](https://developer.sailpoint.com/discuss/u/hranjan3)\
**Post date:** [April 4, 2024, 5:27pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998/15 "2024-04-04T17:27:45Z")

</div>

here are few more update I have.

in ccg I see this message:

```auto
"message":"processEndpoint: Parsed 43 resource objects from response of endpoint: Entitlement Aggregation",

"message":"procesEndpoint: Attempting to process paging logic for endpoint: Entitlement Aggregation"

"message":"No paging steps defined for endpoint ''Entitlement Aggregation'', terminating paging..."

"message":"processEndpoint: Paging logic for endpoint 'Entitlement Aggregation' will terminate?: true"

{"exception":{"stacktrace":"java.lang.RuntimeException: Identity attribute [role] was not found.\n\tat

"message":"Error while RO transformation - Identity attribute [role] was not found.: {EntName=[]}"

```

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/5/566330d9876b848f9c3ea27af34de2069af903ff.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/2/2429c723131e244e2ee7d9cd732c3bc9ec0b7631.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/d/d52d58b8be9af2a1cd2a1f1cd6c22838aa6a8e78.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/3/312cc66a29406bb83cf74373470b63dabb7a731d.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/a/a9563e1ad8edbff68528a1b7ca0446736589e213.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/9/94ad52d17a5b7a205c71b8bb66585063cdafdb8e.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/e/e0d27d6215c9f8cb418fec3fdf7c54d8ec1ff4c4.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/b/baf417d880057e06f940bdb63f697d26b9e0ec1c.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/5/583663b78ed19a109e293889a90210b59f2e9ab2.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/c/c9c832b91e94ce9edfadd483a67cb77a052e7aee.png)

---

<div class="post-metadata">

**Author:** ![hranjan3](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hranjan3](https://developer.sailpoint.com/discuss/u/hranjan3)\
**Post date:** [April 5, 2024, 12:41pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998/16 "2024-04-05T12:41:12Z")

</div>

Hi All, I am now able to do entitlement aggregation.

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/b/b05739ef864a619b1eae6c922d648acd51b3ff56.png)

now I need to check Create Account test. I will update you if I find new issue.

---

<div class="post-metadata">

**Author:** ![hranjan3](https://avatars.discourse-cdn.com/v4/letter/h/ecb155/32.png) [@hranjan3](https://developer.sailpoint.com/discuss/u/hranjan3)\
**Post date:** [April 9, 2024, 7:37am UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998/17 "2024-04-09T07:37:10Z")

</div>

Issue is fixed now. Thanks all for your help!

---

<div class="post-metadata">

**Author:** ![jrossicare](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@jrossicare](https://developer.sailpoint.com/discuss/u/jrossicare)\
**Post date:** [April 9, 2024, 11:13pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998/18 "2024-04-09T23:13:28Z")

</div>

Hi @hranjan3 do you want to post the details of the actual solution, to help others with the same problem?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [June 8, 2024, 11:13pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-rule-add-error/37998/19 "2024-06-08T23:13:50Z")

</div>

Closed on June 8, 2024, 11:13pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
