Getting Null Point Exception Error While Calling Webservice In Custom Object For An User

(Doc ID 2101782.1)

Last updated on FEBRUARY 28, 2018

Applies to:

Oracle Fusion Sales Cloud Service - Version and later
Information in this document applies to any platform.


When attempting to call a WS from groovy script the following error occurs

Exception in expression "UnitInventory_c.UnitBlockingService_ATTR": java.lang.NullPointerException : Cannot invoke method holdUnit() on null object
at "UnitInventory_c.UnitBlockingService_ATTR" expression line 21

The issue can be reproduced at will with the following steps:
1. Go to Navigator >> Application composer.
2. Add the following script on object Unit Inventory
3. if(isAttributeChanged('UI_UnitBlocked_c'))
def OutCome = '';
def Status = nvl(UI_UnitBlocked_c,'');
def UnitNumber = nvl(UI_EBSUnitID_c,'');
def UnitHoldFor = nvl(UI_UnitBlockedFor_c,'');
def UnitBlockedBy = nvl(adf.context.getSecurityContext()?.getUserProfile()?.getEmployeeNumber(),'');
if(Status == 'Y')
OutCome = adf.webServices.CreamOSCIntWebServices.holdUnit('P3197', UnitNumber, UnitHoldFor)
setAttribute('UI_UnitBlockingSuccess_c', OutCome)
4. Save the changes.

WSDL is: https://xxxxxxx/

The weird part is, that this method that the error says is failing due to null point is working fine in Server Scripts, it is actually doing what is suppose to be doing, to create a record in the customer external database.
Also the web-service itself has been tested via SOAP ui and woks.

And also this issue happens for only 1 user


Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms