# Web Services API: CompleteActivityInstance error : System.NullReferenceException: Object reference not set to an instance of an object

**URL:** <https://discuss.workflowgen.com/t/web-services-api-completeactivityinstance-error-system-nullreferenceexception-object-reference-not-set-to-an-instance-of-an-object/325>\
**Category:** Web API\
**Created:** [June 14, 2014, 2:53am UTC](https://discuss.workflowgen.com/t/web-services-api-completeactivityinstance-error-system-nullreferenceexception-object-reference-not-set-to-an-instance-of-an-object/325 "2014-06-14T02:53:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wfg-admin](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/wfg-admin/32/714_2.png) [@wfg-admin](https://discuss.workflowgen.com/u/wfg-admin)\
**Post date:** [June 14, 2014, 2:53am UTC](https://discuss.workflowgen.com/t/web-services-api-completeactivityinstance-error-system-nullreferenceexception-object-reference-not-set-to-an-instance-of-an-object/325/1 "2014-06-14T02:53:08Z")

</div>

### Issue

When calling the complete activity instance web service I get the following error:

```auto
System.NullReferenceException: Object reference not set to an instance of an object.  
at Advantys.My.Globalization.TimeZoneInformation.GetTimeZone(Int32 timezoneIdentifier)  
at Advantys.Workflow.Web.Services.Processes.Runtime.RuntimeService.CompleteActivityInstance(Int32 processInstanceId, Int32 activityInstanceId, String workflowContext)

```

#### Configuration

- The `wfgen_admin` username is entered as `mydomain/wfgen_admin`

- The `ApplicationSecurityRemoveDomainPrefix` entry in the `web.config` file has been set to `_all`.

- If we remove the `web.config` setting we will get a user is not a participant error when trying to call `completeactivity`.

### Cause

The `_all` value in the `ApplicationSecurityRemoveDomainPrefix` parameter removes the domain name in the login name, which is why you are getting the error message, because the user is no longer found in the database after the domain name was removed from the login name:

1. The user’s username is stored as `mydomain\wfgen_admin` in the database.

2. `ApplicationSecurityRemoveDomainPrefix` is set to `_all`, which removes the domain name from login name

3. When you log in with `mydomain\wfgen_admin`, this will become `wfgen_admin` once `ApplicationSecurityRemoveDomainPrefix` is applied.

4. WorkflowGen then tries to find a user where username is equal to `wfgen_admin`, but couldn’t find it because the username is stored as `mydomain\wfgen_admin`.

### Solution

The solution is to **not** skip the domain name for users whose usernames are prefixed by a domain name.
