cancel
Showing results for 
Search instead for 
Did you mean: 

REST Sender adapter - multiple dynamic parameters

nicolas_p
Explorer
0 Kudos

Dear

We are currently configuring a sender REST adapter which be called as such:

http://host:port/RESTAdapter/pi/query/jira/solman/getsystems?sap-client=001&cust=00009999

(even encoding the question url or only question mark and ampersand doesn't help)

However whenever we try this, we can see following error returned by PI:

The sender adapter is configured properly according to the documentation on SAP Help:

Has anyone encountered this issue before?

We might think this is a bug, as the interface works fine when we use following pattern:

But only when we use the url as follows:

http://host:port/RESTAdapter/pi/query/jira/solman/getsystems%3Fsap-client=001&cust=00009999

We had to encode the question mark in the URL (%3F) in order for PI to pick the right channel with the correct parameters.

When using the normal question mark (e.g. used with the Chrome Advanced REST Client), we basically receive the same error as above:

Have any of you encountered this before, or have any of you used multiple parameters before in the sender REST adapter.

Thanks for any feedback.

Accepted Solutions (1)

Accepted Solutions (1)

alex_bundschuh
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Nicolas,

you need to choose GET Variable as value source instead of URL pattern element, in this case you must not specify the GET variables in the pattern url

I have described an examle in the following blog although I just noticed that I have missed to add a screenshot of the pattern url, my GET variable is called mode, my pattern is /{service_part}

http://scn.sap.com/docs/DOC-60865

For your specific requirement, you need to maintain the following:

Pattern: /getsystems

define two custom attributes for sapcustnr and sapclient, both of value source GET Variable

Hope this helps

Alex

Former Member
0 Kudos

Hi Alex,

Using your suggestion, I was able to pass dynamic URL query parameters to a Sender endpoint. However, we want some of the query parameters as optional. But when we don't pass all the query parameters, Rest Sender adapter is throwing following error.

Any thoughts?. Here 'name' is one the GET variable defined in "REST Resources" tab and we get below error when 'name' is not passed in the REST URL endpoint.

<html>

<head>
<title>
Error

</title>
</head>

<body>

<h1>
Error

</h1>

<pre>

GET Variable name not found

</pre>
</body>

</html>

alex_bundschuh
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Pradeep,

flagging an attribute as optional has been introduced in 7.31 SP15 / 7.4 SP10 only

Alex

Former Member
0 Kudos

Hi Alexander,

Thanks for the quick response. By any chance would you know whether JSON reponse supports JSON arrays? Currently I don't think REST Sender adapter can return json array when a XML node has 0 to unbounded. Several users have raised this question. Any reply is greatly appreciated.

Thanks

-Pradeep

alex_bundschuh
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Pradeep,

this is not supported right now but on our backlog

Alex

Former Member
0 Kudos

Hi Alex,

Thank for the response. Yesterday BASIS upgraded PI 7.4 SP8 to PI 7.4 SP10 as we are interested in newer options available in SP10. After the upgrade, I get Nullpointer exception when i select REST adapter. After clicking ok button. Screen still shows only the SP8 options i don't see any of the newer options. Are we missing something? May updated Adapter metadata?

-Pradeep

alex_bundschuh
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Pradeep,

yes, most likely you have missed to update adapter metadata

Alex

Former Member
0 Kudos

Alex,

Can you please suggest where we can get this adapter metadata?

-Pradeep

nicolas_p
Explorer
0 Kudos

Pradeep

it's the TPZ file which you need to import after an upgrade.

It's found in the SCA file the basis team uses for the update.

Former Member
0 Kudos

Thank you!

Basis upgraded PI Advanced Adapter Engine Extended (AEX). I think they also updated REST adapter metadata.

In Integration Builder I see below version.

Version
Service Pack: 10
Release: NW731EXT_15_REL
Last Change: 537804
Sync Time: 2015/02/21 00:04:20

I still don't see Optional Check box that Alex has mentioned in REST Sender adapter configuration. However I see the new "Error Handling" tab. Can you please suggest what could be wrong.

-pradeep

Former Member
0 Kudos

Hi Alex,

We updated PI to 7.4 SP10, However we don't see the checkbox option for attributes. Can you please suggest what could be missing. We are not getting null pointer exception anymore.  I see the Error Handling tab though.

alex_bundschuh
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Pradeep,

sorry, I made a mistake in the first place, I actually checked an internal system where obviously the adapter metadata were mixed up, the optional flag only comes with 7.31 SP16 / 7.4 SP11, shipment is planned for end of May 2015.

Alex

Former Member
0 Kudos

Alex,

Thanks for clarifying this. Please let me know when SP11 is available.

-Pradeep

Former Member
0 Kudos

Alex,

Is there somewhere where it is documented that SP11 has the optional flag for the REST adapter. I have had a look on help.sap.com below for SP11 and it doesn't mention the optional parameter anywhere...not even on the info links for the download files.

What's New in SAP NetWeaver 7.4 (Release Notes) - SAP Library

Thanks,

  Peter

alex_bundschuh
Product and Topic Expert
Product and Topic Expert
0 Kudos

Sorry Peter, we missed to put this into the documentation, but it has been definitely shipped already

Alex

Former Member
0 Kudos

Hi Alex,

I am using the REST Polling adapter where my URL is

https://crust.impl.com/API/Employee?End_Date=2016-03-03-08:00&Start_Date=2016-01-01-08:00

Here my End Date is current date and Start Date is when my interface last ran, so I can use {IncrementalToken} for Start_Date which can be configured thru Incremental token of last run, how do I pass current date timestamp for End_Date ?

Could you suggest how to use current datetimestamp and interface last run datetimestamp ?

Thx in advance

Ravijeet

alex_bundschuh
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Ravijeet,

this is currently not possible out of the box, we only support one variable for keeping the timestamp

Alex

Former Member
0 Kudos

Hi Alex,

I was trying to see in the log what was the incremental token passed to the URL, do you know where we can see the actual URL that was used in the polling API call ? I went to the logs and traces but I was unable to see that.

So when you say not available out of the box, what are other custom options ?

Say instead of last run I just want to use the current datetimestamp, is that possible using the incrementaltoken in the URL ?

Thx in advance

Ravijeet

Answers (2)

Answers (2)

nicolas_p
Explorer
0 Kudos

Hi Alexander

indeed this is what solved the trick.

However we had run into some issues when a variable wasn't passed along as it was empty. We logged an OSS ticket for this and it seems this issue will be solved in the next SP that will soon be released.

Currently we have a workaround where empty values are filled in with a dummy value, so that the interface doesn't go into error.

Thanks for your helpful answer.

Nicolas

Former Member
0 Kudos

Hi Nicolas,

Were you able to resolve this issue. We are also facing similar issue. We are try to specify multiple dynamic query parameter in PI RFC Sender adapter endpoint and getting similar errors. Please let me know if you have found any solution.

Thanks

-Pradeep