Proxy Chaining

I created two proxy names is PAN Status and Data SET. Now from the PAN Status I am getting the below response from this proxy:

{
    "trackingId": "",
    "status": 1,
    "pan": "123456",
    "panStatus": "N",
    "lastName": "",
    "firstName": "",
    "middleName": " ",
    "panTitle": "",
    "returnCode": "1"
}

Now I want to extract the PAN number and PAN name and set this data into the other proxy name is DATA SET. How to do this part?

Solved Solved
0 1 101
1 ACCEPTED SOLUTION

Not applicable

first you need to use service callout in Data set proxy and call to PAN proxy. Once you get the response back to the Data set proxy. Here use extract variable policy over the response from service callout and extract the variable pan using the json extraction as $.pan and store to a variable. Use that in your proxy request to Data set proxy.

first service callout to PAN proxy from the Data set proxy as below.

<ServiceCallout async="false" continueOnError="false" enabled="true" name="service-callout">
    <DisplayName>service-callout</DisplayName>
    <Properties/>
    
    <Response>myResponse</Response>
    <LocalTargetConnection>
	    <APIProxy>PAN-Status</APIProxy>
	    <ProxyEndpoint>default</ProxyEndpoint>
    </LocalTargetConnection>
</ServiceCallout>

Then next policy is extract variable

<ExtractVariables name="ExtractVariables-3">
   <Source>myResponse</Source>
   <JSONPayload>
      <Variable name="panid" type="float">
         <JSONPath>$.pan</JSONPath>
      </Variable>
   </JSONPayload>
</ExtractVariables>

you can extract other information related to Name as above in the same policy.

Then you can append the first name, medium name and last name in a javascript to get full name.

Next you can use assign message policy to configure the request to the backend of Data set proxy.

View solution in original post

1 REPLY 1

Not applicable

first you need to use service callout in Data set proxy and call to PAN proxy. Once you get the response back to the Data set proxy. Here use extract variable policy over the response from service callout and extract the variable pan using the json extraction as $.pan and store to a variable. Use that in your proxy request to Data set proxy.

first service callout to PAN proxy from the Data set proxy as below.

<ServiceCallout async="false" continueOnError="false" enabled="true" name="service-callout">
    <DisplayName>service-callout</DisplayName>
    <Properties/>
    
    <Response>myResponse</Response>
    <LocalTargetConnection>
	    <APIProxy>PAN-Status</APIProxy>
	    <ProxyEndpoint>default</ProxyEndpoint>
    </LocalTargetConnection>
</ServiceCallout>

Then next policy is extract variable

<ExtractVariables name="ExtractVariables-3">
   <Source>myResponse</Source>
   <JSONPayload>
      <Variable name="panid" type="float">
         <JSONPath>$.pan</JSONPath>
      </Variable>
   </JSONPayload>
</ExtractVariables>

you can extract other information related to Name as above in the same policy.

Then you can append the first name, medium name and last name in a javascript to get full name.

Next you can use assign message policy to configure the request to the backend of Data set proxy.