ExtractVariables returns "Unresolved variable : urielement.userID"

policy

<ExtractVariables name="Extract-Variables-USERID">
  <Source> request </Source>
  <VariablePrefix> urielement </VariablePrefix>
  <URIPath>
    <Pattern ignoreCase="true"> /userID/{userID} </Pattern>
  </URIPath>
</ExtractVariables>

receiving:

{ "fault": { "faultstring": "Unresolved variable : urielement.userID", "detail": { "errorcode": "entities.UnresolvedVariable" } } }

for api proxy:

0 16 2,081
16 REPLIES 16

Not applicable

urielement.userID is missing or not available. can you explain more on the error and if possible attach the proxy code?

Please see attached.

See below:

10169-proxy.png

how your request url looks like and also how the extract variable policy looks like. Also the trace may give where the error is ?

https://api-gw-rnd.pncint.net/acbsdateinfoinq/userID/PP38018

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<ExtractVariables name="Extract-Variables-USERID">

<Source> request </Source>

<VariablePrefix> urielement </VariablePrefix>

<URIPath> <Pattern ignoreCase="true"> /userID/{userID} </Pattern> </URIPath> </ExtractVariables>

Hello. Not expected from the backend...Looking into...

can you attach trace screenshot? From backend or where the error comes?

Looks like its not connecting to backend...

you can attch the trace.

Not applicable

I see in the Extract Variable you have space in variable prefix and Pattern.

Can you try below code. It worked for me.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables name="Extract-Variables-USERID">
<Source>request</Source>
<VariablePrefix>urielement</VariablePrefix>
<URIPath> 
	<Pattern ignoreCase="true">/userID/{userID}</Pattern>
</URIPath>
</ExtractVariables>

Hello. Thank you. Removed spaces and now getting...

<HTML>
<BODY> <P> <B>JSMDirect transaction did not complete</B> </P> </BODY>
</HTML>

is this the expected response? Are you getting this from backend?

If you are getting this response from the upstream (target) system then the problem is no longer in ExtractVariables.

It sounds to me that you are not quite fully comfortable using Apigee trace to help diagnose problems.

If that's the case, you may want to watch a quick screencast that introduces Apigee trace. Try this one.

Hello. The trace is not showing anything. I'm getting the error immediately.

trace-1597252809604.zip

Looks to be getting:

RaiseFaultUnknownAuthType401 Unknown Auth Type - Not Secure

Not applicable

In the policy GetAuthType you are setting the PNC.AUTH_TOKEN_TYPE and is showing in the trace as undefined.

Because of that the raise fault is getting executed. Can you show the javascript code, how you are setting that varibale?