cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
michealeseecc
Level 4

GetEntitlementLineItemPropertiesQuery - "9999:java.lang.NullPointerException

Jump to solution

Hi All,

Good days!

I have a skeleton code as below using sandbox account:-

searchActivatableItemDataType searchtype = new searchActivatableItemDataType();
Flexnet.Entitlement.SimpleQueryType qtype = new Flexnet.Entitlement.SimpleQueryType();
qtype.searchType = Flexnet.Entitlement.simpleSearchType.EQUALS;
qtype.value = "YH6D-SJIN-5GSH-8RPR";
searchtype.activationId = qtype;

searchEntitlementLineItemPropertiesRequestType request = new searchEntitlementLineItemPropertiesRequestType();
request.batchSize = "1";
request.pageNumber = "1";
request.queryParams = searchtype;
searchEntitlementLineItemPropertiesResponseType SearchResponse2 = new searchEntitlementLineItemPropertiesResponseType();
using (var eos = new EntitlementOrderClient())
{
eos.Open(ConfigurationManager.AppSettings["FNOODlogin"], ConfigurationManager.AppSettings["FNOODpassword"], ConfigurationManager.AppSettings["FNOCBaseURL"]);

try
{
SearchResponse2 = eos.GetEntitlementLineItemPropertiesQuery(request);
if (SearchResponse2.statusInfo.status == Flexnet.Entitlement.StatusType.SUCCESS)
{
:
:
:

***********************************************************************************

/// <summary>
/// Returns entitlements that match the query parameters in the request.
/// </summary>
/// <param name="request">
/// The request that contains query parameters.
/// </param>
/// <returns>
/// The entitlements.
/// </returns>
public virtual searchEntitlementLineItemPropertiesResponseType GetEntitlementLineItemPropertiesQuery(searchEntitlementLineItemPropertiesRequestType request)
{
CheckOpenAndNotDisposed();
return Client.getEntitlementLineItemPropertiesQuery(request);
}

Above code returned status => "FAILURE" with reason => 9999:java.lang.NullPointerException

Refer to sandbox Revenera Portal Line Item screenshot >> https://ibb.co/c6c4XRV

I need a guidance or any sample code for this? Basically I am trying to retrieve line item state status using ActivationID.

Please advise.

Regards,
Micheale

 

0 Kudos
1 Solution

Hi @michealeseecc ,

The issue may be that Authorization should be Basic, not Bearer Basic.  I have attached  a Postman collection containing this API, try putting in your FNO Credentials for Authorization, site and Activation ID.   You'll just need to unzip and then import the collection. 

Thx,

Jim  

View solution in original post

6 Replies
jberthold
Revenera Moderator Revenera Moderator
Revenera Moderator

HI @michealeseecc , Here's a working example of the getEntitlementLineItemPropertiesQuery that returns the line item state:

 

lineitemstate.jpg

Thx,

Jim

0 Kudos

Hi Jim,

Thanks for your great help.

I managed to run my code as below, but I getting the STATE as DRAFT instead INACTIVE:-

searchActivatableItemDataType searchtype = new searchActivatableItemDataType();
Flexnet.Entitlement.SimpleQueryType qtype = new Flexnet.Entitlement.SimpleQueryType();

qtype.searchType = Flexnet.Entitlement.simpleSearchType.EQUALS;
qtype.value = serialNumber;
searchtype.activationId = qtype;

entitlementLineItemResponseConfigRequestType respConfig = new entitlementLineItemResponseConfigRequestType();
respConfig.activationId = true;
respConfig.state = true;

searchEntitlementLineItemPropertiesRequestType request = new searchEntitlementLineItemPropertiesRequestType();
request.batchSize = "1";
request.pageNumber = "1";
request.entitlementLineItemResponseConfig = respConfig;
request.queryParams = searchtype;

searchEntitlementLineItemPropertiesResponseType SearchResponse2 = new searchEntitlementLineItemPropertiesResponseType();
using (var eos = new EntitlementOrderClient())
{
eos.Open(ConfigurationManager.AppSettings["FNOODlogin"], ConfigurationManager.AppSettings["FNOODpassword"], ConfigurationManager.AppSettings["FNOCBaseURL"]);
try
{
SearchResponse2 = eos.GetEntitlementLineItemPropertiesQuery(request);
if (SearchResponse2.statusInfo.status == Flexnet.Entitlement.StatusType.SUCCESS)
{
:
:

******************************************************************************

The status returned => SUCCESS
The state returned =>DRAFT but my actual line item state is "Inactive". I tried edit my lineitem state to Obselete. And the code above still returned state as DRAFT.

https://ibb.co/Q6sCh4k

Please advise.

Thanks.


Regards,
Micheale

0 Kudos

Hi @michealeseecc ,

Are you sure you are looking at the state of the Entitlement line "state" vs the state of the Entitlement "entitlementState"?   In the example below I have the state of the Entitlement line for the provided activation ID set to Inactive and the state of the Entitlement set to Deployed.   The API correctly returns both:

states.jpg

Your screenshot leads me to believe you are looking at entitlementState instead of state.  If this is not the case please submit a support ticket so someone can work with you directly to resolve.

Thanks,

Jim

0 Kudos

Hi Jim,

Many thanks for your respond. Would you able to share your Headers for POSTMAN screenshot? I am trying out using POSTMAN, but still no luck.

My POSTMAN Body Code:<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:v5.webservices.operations.flexnet.com">

 <soapenv:Header/>
    <soapenv:Body>
        <urn:searchEntitlementLineItemPropertiesRequest>
            <urn:queryParams>
                <urn:activationId>
                    <urn:value>SVQ1-E7EP-RCPQ-GUCS</urn:value>
                    <urn:searchType>EQUALS</urn:searchType>
                </urn:activationId>
            </urn:queryParams>
            <urn:entitlementLineItemResponseConfig>
                <urn:activationId>TRUE</urn:activationId>
                <urn:state>TRUE</urn:state>
                 <urn:entitlementState>TRUE</urn:entitlementState>
            </urn:entitlementLineItemResponseConfig>
            <urn:batchSize>1</urn:batchSize>
            <urn:pageNumber>1</urn:pageNumber>
        </urn:searchEntitlementLineItemPropertiesRequest>
    </soapenv:Body>
</soapenv:Envelope>
 
 
My POSTMAN Header:
https://ibb.co/3mL9Nc5
 
MY POSTMAN Authorization:
Bearer : Basic xxxleGVyYWFwaUXxxmV2XYXXb206RmxleFNXXXxx
Not sure what is missing, I am getting Responses failure
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><searchEntitlementLineItemPropertiesResponse xmlns="urn:v5.webservices.operations.flexnet.com"><statusInfo><status>FAILURE</status></statusInfo></searchEntitlementLineItemPropertiesResponse></soapenv:Body></soapenv:Envelope>


Last try, If not I will log support ticket on Monday.

Many thanks.

Regards,
Micheale
0 Kudos

Hi @michealeseecc ,

The issue may be that Authorization should be Basic, not Bearer Basic.  I have attached  a Postman collection containing this API, try putting in your FNO Credentials for Authorization, site and Activation ID.   You'll just need to unzip and then import the collection. 

Thx,

Jim  

Awesome Jim. Happy Friday. 😇

I changed my Authorization 
Type : Bearer Token to Basic Auth.

Now, I will figure out on my C# code to make it work, will share the solution once I did it.

Thanks.

Regards,
Micheale

0 Kudos