on 08-31-2011 6:50 AM
Hello Experts,
I have an incoming XML coming through HTTP protocol which consiste of Header and the data is like below.
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xsi:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/
<?xml version="1.0" encoding="utf-8"?>
<PurchaseOrder>
</PurchaseOrder>
Footer
I need only the lines in bold.
Can any one help
Regards,
Arijit
Hi,
Why don't you use Sender SOAP Channel instead of HTTP Sender, that will automatically remove the soap envelope and you will just receive the actual xml in your payload. This will avoid the use of XSLT mapping.
Thanks
Rajeev Gupta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arijit,
You cannot use XSLT mapping for this input payload. Reason: this XML is not well formed: XML declaration <? ?> should occur only once, there should be only one root element. XSLT cannot take not well formed XML as input.
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xsi:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/
<?xml version="1.0" encoding="utf-8"?>
<PurchaseOrder>
</PurchaseOrder>
So I suggest you to use Java Mapping and do String manipulations to remove the extra wrapper.
Regards,
Raghu_Vamsee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> Actually the partner want to send this file to PI with"xx.msgdata" extension not ".xml" and the data inside it what I posted. I am not sure whether PI would be able to accept this kind of file with Sender HTTP connection.
Arijit,
SAP PI can handle any kind of file txt, xml, csv, pdf, doc, jpg. Most of the cases with pdf and jgp will be pass through scenario.
So PI can handle xx.msgdata, if it has text characters, we can perform transformation, if required.
Regards,
Raghu_Vamsee
To get only the message body, you can use the follow xslt code:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output encoding="UTF-8" method="xml"/>
<xsl:template match="*">
<xsl:copy-of select="soap:Body/*"/>
</xsl:template>
</xsl:stylesheet>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arijit,
This is an invalid XML. Parser is producing errors for this XML.
Please check.
regards
Anupam
_______________________________________________________________________________________________________
Hi Arijit,
Could you please kindly post the complete target structure? Here you need java mapping to remove the extra envelop, then put the result in the target XML. Could you please specify what version of PI you are working with?
The sender communication channel will consist of File adapter. The contents of the file will directly flow to java mapping and no need to use FCC. The java mapping code with remove the envelop and produce the target XML. To do this follow the blog http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/4018. [original link is broken] [original link is broken] [original link is broken]
If you need help in java mapping code. Please post the complete target XML and your PI version since java mapping is different in PI 7.0 and PI 7.1.Alternatively you can follow these links for java mapping help (if required)
http://wiki.sdn.sap.com/wiki/display/XI/ParametrizedJavaMappinginPI+7.1
http://wiki.sdn.sap.com/wiki/display/XI/BeginnersguidetoJavamappingusingDOMparserinSAPXI
regards
Anupam
__________________________________________________________________________________________________________
Edited by: anupamsap on Sep 1, 2011 8:59 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arijit,
Your scenario is therfore File to idoc. In the sender side you need sender file adapter and in receiver side you need idoc adapter. (I am not sure why you have mentioned as sender HTTP connection, I was expecting an FTP etc).
Secondly i had two queries in my earlier post.
1. what is the version of the PI you are working?
2. what is the target xml?
Now here the data flows in this way
File with soap envelop -
> java mapping----
>XML without SOAP(Target XML) -
> java/ message mapping -
> idoc.
In my earlier post I have pointed out what should be the method to create the target XML. Once you are able to do that other steps wont be that difficult. You have provided as answer the final idoc details and you did not mention the version of PI you are working on. One small request, as we are unable to see the screen you are working on, it will be nice if you are able to present complete details, so that the forum members can assist you further. By complete details I do not mean unnecessary information but relevant ones so that the scenario is clear to the members.
regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.