cancel
Showing results for 
Search instead for 
Did you mean: 

REST Receiver xPath expression does not work for iDoc

Former Member
0 Kudos

Right now I cannot get the REST Receiver adapter to work like I expect in SAP PO 7.5

The scenario consists out of an outbound iDoc and an inbound REST Message.

When I send out an idoc I keep getting the error below.

Transmitting the message to endpoint <local> using connection IDoc_AAE_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.adapter.rest.ejb.parse.InvalidXPathExpression: Invalid XPath expression "//PERNR"; Message: "Expression did not match."

Here's a screenshot of the REST Receiver adapter configuration:

I do not have the complete xPath above because I was advised not to. But with complete xPath in the configuration is still does not work.

Below is the payload of the incoming iDoc, where field PERNR is available in the last segment of the iDoc.

Any ideas? Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Snavi
Active Participant
0 Kudos

Hi,

do you have any mapping from IDoc to rest inbound message?

how does the message type of your inbound service interface looks like.

if you are mapping the IDoc to some other xml, you would need to put the xpath expression from that receiver xml structure

Former Member
0 Kudos

Thank you for you reply Naveep.

I have tried it like you said, but unfortunately I still get an error.

Transmitting the message to endpoint <local> using connection IDoc_AAE_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.adapter.rest.ejb.parse.InvalidXPathExpression: Invalid XPath expression "//globalEmpNo"; Message: "Expression did not match."

See below for the structure of the incoming message and the updated receiver channel settings.

Snavi
Active Participant
0 Kudos

Hi,

It is not able to find the globalEmpNo in your payload.

can you post the xml formed after mapping, get the payload from message logs. check is there are no namespace prefix to the elements.

former_member194786
Active Contributor
0 Kudos

Hi,

I would recommend you take the output payload after mapping and test it on this site, and see if the XPATH works:

Free Online XPath Tester / Evaluator - FreeFormatter.com

Alternately, post your XML (after mapping here) and we can have a look to see what is the problem.

Regards,

Sanjeev

Answers (0)