cancel
Showing results for 
Search instead for 
Did you mean: 

Text being sent, need to handle with PI

Former Member
0 Kudos

Hi,

I have a mobile application that uploads orders to PI. Everything is working except for a test function. It sends a payload to PI to confirm the 'network' is functioning. However, the payload of the call is text. When viewing the payload in the PI logs the text 'TEST' appears. PI then generates an error for this call. I'd like to be able handle this payload without having to ask the developer to send an XML document. I could get the developer to change the code but it would mean $$$$ and deploying the update to a lot of devices. Is there any way I can deal with this in PI.

Many thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Sorry - I should have made that clear.

The text is being sent as part of the payload of a HTTP request.

Former Member
0 Kudos

... and you are using the plain http adapter, correct?

Can you copy&paste the whole HTTP message you receive?

Where exactly do you get problems? In the Communication Channel? What does the PI say?

Regards,

Volker

Former Member
0 Kudos

The test function is using the same interface we use for delivery uploads (which work perfectly). It's a plain HTTP interface. The payload being sent is shown below.

bold Test Connectionbold

That is it, nothing more. The interface gets to PI but fails with a mapping error which is to be expected.Obviously I could ask the developer to change the payload and send an XML document and then deal with it in the interface mapping but that would cost $$$.

So what I need to be able to do is handle it in the interface mapping. Is there any way I can do this?

Former Member
0 Kudos

Hi Rob!

Tr it with an XSLT Mapping instead of or before you use a graphical Message Mapping.

XSLT mapping creates valid XML and Message Mappping then makes the "real" mapping - if any mapping shopuld be required.

Regards,

Volker

Former Member
0 Kudos

>>The interface gets to PI but fails with a mapping error which is to be expected

Well if you really want to do some message mapping,then you need to use either java or XSLT mappings,graphical mapping wont work here since the payload is not XML .

If you don't have any need for mapping,then just develop a dummy scenario without mapping.

Thanks

Aamir

Former Member
0 Kudos

Gentlemen - thank you for your replies. I think we are agreed I need to do XSLT mapping to convert a text string into an XML document. I just have one more question.

I mentioned earlier this interface is used for deliveries and that the test message (the text message) is sent on this interface. My question is am I able to use conditions in the interface determination to check to see if the message is a delivery or a test message so I can redirect it to the appropriate mapping?

former_member200962
Active Contributor
0 Kudos

check it here:

http://help.sap.com/saphelp_nw70/helpdata/EN/e9/67a63d7af20450e10000000a114084/frameset.htm

From above link:
If you specify more than one inbound interface, you can specify conditions for forwarding the message to 
the inbound interfaces. These conditions are evaluated at runtime.

Regards,

Abhishek.

Former Member
0 Kudos

Hi Rob!

Yes you can ... by using the feature of content-based routing. In your interface determination you can define boolean rules and check message content. Based on these rules you can direct the message to one or more different receiver (interfaces).

Good luck!

Regards,

Volker

Answers (3)

Answers (3)

Former Member
0 Kudos

I'm having problems defining a condition in the interface determination. Let me recap.

I have a very simple HTTP interface. The application using this interface can send a request with a valid XML document in the payload OR a simple text string. Using the interface determination I need to be able to map the valid XML document to one RFC and the test string to another RFC. The condition for the XML document is simple but defining a condition for the text string is proving to be next to impossible. According to the condition & expression editor documentation I have to use an Xpath expression to refer to the element I want to u2018testu2019. How can I use an Xpath expression when the document Iu2019m referring to isnu2019t a valid XML document.

Any advice you can offer would be appreciated.

Former Member
0 Kudos

Hi Brian!

It is some kind of "unusual" to work with Non-XML messages within the PI. So some behaviour might be unpredictable, because - as per definition - PI internally always works with XML files.

But for the textstring you may try to use a Dummy XPath expression with NOT, which always gets the value "TRUE".

Try it.

Regards,

Volker

Former Member
0 Kudos

Volker,

Many thanks for the reply, looks like I have all the information I need.

Former Member
0 Kudos

Hi!

It depends on the adapter you use to get the message from the mobile device. E.g. a SOAP Adapter expects to get a SOAP message. A File Adapter can work with almost everything as long as it comes in a flat file.

So what is the Config. Scenario you use?

Regards,

Volker