on 10-12-2006 4:25 PM
Hi Guys,
I have scenario wherein there is whole XML in a single element and i want to retrieve it to target XML structure. How do i do it?
Source message is:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<SubmitBatchPwResponse xmlns="http://AltInn.no/webservices/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<SubmitBatchPwResult<b>><?xml version="1.0"?><DataBatchInReceipt schemaVersion="1.0" batchId="sap2" enterpriseSystemId="826" status="OK"><DataUnitInReceipt sendersReference="2sap" submissionReference="{F1554C97-2D71-437C-B0E0-F0F89D95A43A}" status="OK" timeReceived="2006-10-12T16:48:42"><Message><MessageEntry type="Default" logged="2006-10-12T16:48:42">Sendt til Altinn</MessageEntry></Message></DataUnitInReceipt></DataBatchInReceipt></b></SubmitBatchPwResult>
</SubmitBatchPwResponse>
Whatever is between <SubmitBatchPwResponse>... </SubmitBatchPwResponse> is a string (data).
The target structure is:
<?xml version="1.0" encoding="UTF-8"?>
<!Sample XML file generated by XMLSpy v2006 rel. 3 sp2 (http://www.altova.com)>
<DataBatchInReceipt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\Documents and Settings\c5082452\Desktop\Altin\DataExchangeReceipt_v1.3.xsd" batchId="String" status="OK" schemaVersion="3.1415926535897932384626433832795" enterpriseSystemId="0">
<Message>String</Message>
<DataUnitInReceipt workflowReference="String" status="String" receiversReference="String" timeReceived="Text" archiveReference="String" sendersReference="String" submissionReference="String">
<Message>
<MessageEntry logged="2001-12-17T09:30:47.0Z" type="Default"/>
</Message>
</DataUnitInReceipt>
</DataBatchInReceipt>
Pls advice
Regards,
Ashish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ashish,
A few more thoughts apart from the discussions above, how are you receiving the message into XI, which adapter are you using for that? Check if the source structure is validated before you can parse the message to build your target structure.
Regards,
Chandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, I am receiving the message from SOAP adpater froma web service.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<SubmitBatchPwResponse xmlns="http://AltInn.no/webservices/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<SubmitBatchPwResult><?xml version="1.0"?><DataBatchInReceipt schemaVersion="1.0" batchId="sap6" enterpriseSystemId="826" status="OK"><DataUnitInReceipt sendersReference="sap6" submissionReference="{13FFF023-F1BD-4DF8-B742-9BC77BB4A687}" status="OK" timeReceived="2006-10-13T10:15:09"><Message><MessageEntry type="Default" logged="2006-10-13T10:15:10">Sendt til Altinn</MessageEntry></Message></DataUnitInReceipt></DataBatchInReceipt></SubmitBatchPwResult>
</SubmitBatchPwResponse>
Regards,
Ashish.
Hi,
Is the sender structure being validated by the sending application?, if not i doubt handling the parsing at the source end, you will not be able to use your own modules with the sender SOAP adapter.
If this is not the case, you can use any of the above said approaches to parse the message and build the target structure.
Regards,
Chandra
Hi Ashish,
As I said before the XML that is given is not a well formed XML <?xml version="1.0"?> this process instruction cannot appear twice in a XML and it can onl be the first li.e May be you can open in IE or some browser but this is not a proper XML. XML parser will not be able to parse it and it will throw you an error. Any mapping that check for well formed XML will not work in this case. You have to go for Adapter module/Java Mapping/ABAP Mapping. But in all the above three methods you cannot use any parsers, you have to strip off those unwanted part of XML only by string manipulation.
The other option is convince the source system that is sending the message to send it in a proper XML I mean with only one processing instruction.
All you have to do is somehow try to remove that second processing instruction from the XML or go for Adapter module/Java/Abap mapping with string functions.
Thanks,
Prakash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ashish,
As Prakash pointed out, the second <?xml version="1.0"?> makes the incoming structure invalid, thus causing any xsl mapping to fail. Is it possible to tweak the process that is generating this xml, to remove the second copy from the script? I think the fact that this file is invalid would be a pretty strong argument in favour of this.
If not, maybe you can write a piece of script/code to first remove the <?xml?> tag before processing it using xsl.
Regards,
Harsh
Hi,
How comfort your are in ABAP? If you are fine in ABAP are get some help from some ABAP guy to do the same in ABAP mapping.
Regardng Adapter Module you can go thru this
Regarding ABAP mapping
Check this thread
If you are comfortable with Java then you can also go for Java mapping.
Thanks,
Prakash
User | Count |
---|---|
84 | |
10 | |
10 | |
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.