on 09-12-2016 2:21 PM
Hi Experts,
We are working on SAP PI 7.31 dual stack where the scenario is SOAP to Proxy synchronous, in which the request comes from Webservice as SOAP and response is triggered from SAP ECC via Proxy. The data structure is same for request for both source & target and response data structure also same for both source & target here. Hence, we have developed the interface using pass-through scenario where no mappings are involved. The interface developed works fine with single line item in request but Web service team requested the response XML message should be sorted out based on contexts in case of multiple line items in request. For example as of now the response for multi-line items[here two line items where first material does not exist and for second material quote created successfully] which looks like below:
<ACK>
<MESSAGE>Added Material Does not exists</MESSAGE>
</ACK>
<ACK>
<MESSAGE>Quotation created successfully</MESSAGE>
<QUOTATION_NO>0020003692</QUOTATION_NO>
</ACK>
But above is creating issue on Predix side. They need successfully created Quote messages to appear on top in response message and other next like below:
<ACK>
<MESSAGE>Quotation created successfully</MESSAGE>
<QUOTATION_NO>0020003692</QUOTATION_NO>
</ACK>
<ACK>
<MESSAGE>Added Material Does not exists</MESSAGE>
</ACK>
Please guide me on how to achieve this in pass-through scenario, if not possible in pass-through then in case of graphical mappings which node functions or UDF to be used to achieve the above.
Thanks,
Ramu G.
Hi Ramu!
Is there any other status texts available in your response? If yes and text is something like: "Something went wrong", sorting the nodes becomes useless.
You can use MessageTransformBean in your pass-through scenario with XSL transformation like this:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/*">
<MT_Message>
<xsl:copy-of select="ACK[starts-with(MESSAGE/text(), 'Quotation')]"/>
<xsl:copy-of select="ACK[not (starts-with(MESSAGE/text(), 'Quotation'))]"/>
</MT_Message>
</xsl:template>
</xsl:stylesheet>
Source:
<?xml version="1.0" encoding="UTF-8"?>
<MT_Message>
<ACK>
<MESSAGE>Added Material Does not exists</MESSAGE>
</ACK>
<ACK>
<MESSAGE>Quotation created successfully</MESSAGE>
<QUOTATION_NO>0020003692</QUOTATION_NO>
</ACK>
<ACK>
<MESSAGE>Something went wrong</MESSAGE>
</ACK>
</MT_Message>
Result:
<?xml version="1.0" encoding="utf-8"?>
<MT_Message>
<ACK>
<MESSAGE>Quotation created successfully</MESSAGE>
<QUOTATION_NO>0020003692</QUOTATION_NO>
</ACK>
<ACK>
<MESSAGE>Added Material Does not exists</MESSAGE>
</ACK>
<ACK>
<MESSAGE>Something went wrong</MESSAGE>
</ACK>
</MT_Message>
Regards, Evgeniy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ramu,
I would say that's not a particularly helpful set of response messages as it does not indicate which item was successful vs. which item failed because the material did not exist. If item number data were included in the response information then the receiving application could easily discern context and sort the output as required.
Regards,
Ryan Crosby
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.