cancel
Showing results for 
Search instead for 
Did you mean: 

ERP --> PI --> REST in sync scenario - Operation Rules concept unclear / not working

JaySchwendemann
Active Contributor
0 Kudos
813

Dear all,

Situation

  • I have such a scenario: ERP (ABAP Proxy) --> PI --> 3rdParty (REST) with synchronous GET.
  • The 3rd Party rest service provides two resources like so
    https://<host>/MailService/GetZip?id=1234
    https://<host>/MailService/GetMetadata?id=1234
  • I have two Operations in the service interface "getEmail" and "getEmailMetadata" on the ERP side with Message Types "getEmailReq" and "getEmaiMetadataReq"
  • I have the same setup on the 3rd Party side with "deliverEmail" and "provideEmailMetadata" with Message Types "deliverEmailReq" and "provideEmailMetadataReq"
  • I have a single iFlow with two operations and two mappings in between using a single receiver rest channel

What I want to achieve

  • I would like to use a single rest receiver channel for both operations In other words, I would not like split the two operations to two different service interfaces on the 3rd party side)

What I already tried

  • Using rest receiver channel tab "Operation Rules" I would assume, that this will let me map the request message type of my operations to an (arbitrary or pre-defined) variable with my desired values "GetZip" and "GetMetadata"
  • This is my current setup

  • I also tried giving the ERP side of the message types, so "getEmailReq" / "getEmaiMetadataReq" with the respective namespaces
  • I also tried not to use curly braces in Variables, so "resource" instead of "{resource}".
  • I also tried using non-pre defined variable names like "myResource" or "{myResource}"
  • I wanted to use that variable in the "REST URL" tabl for the dynamic part of my URL like so

Where I fail

  • I cannot for the live of me get this to work. When I look into log in message monitoring I see that the endpoint URL is simply "https://<host>/MailService/?id=1234" so the "resource" path is missing. The id is sucessfully taken from the payload, though.
  • XPI inspector is of no help. It doesn't show anything about operation rules

My questions

  • Is my understanding correct that my intention would normally be solved via "Operation Rules"? If so how to use them properly. I know about the help file and I also saw this quite sophisticated blog, but they seem to lack proper "end-to-end" configuration, at least for Operation Rules
  • Would I need to go for another approach if my understanding about "Operation Rules" is wrong? Could you give me a hint which direction that might be? I could e.g. think of using dynamic configuration of routing "InterfaceFromOperation" but since that is in NS "http://sap.com/xi/XI/Message/30/routing" it is not readily available to the receiver rest adapter.
  • Any other things I messed up while configuring my scenario?

Many(!) Thanks and sorry for the lengthy OP.

Cheers

Jens

Accepted Solutions (0)

Answers (1)

Answers (1)

holakac
Explorer
0 Kudos

Hello,

I know it's a one year-old question, but did you managed somehow ? I have very similar requirement, but I ended up with same problem - it seems that for REST receiver I'm unable to setup a variable with Operation Rules tab. The problem is I want to use the variable for REST operation as well, and since it's not created, the message fails with error:

com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.lang.NullPointerException: while trying to invoke the method java.lang.CharSequence.length() of a null object loaded from field java.util.regex.Matcher.text of an object loaded from local variable 'this'...

This seems to be worthy to raise to OSS.

Thx

Jan