ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » XML AND ATTACH PDF

Post new topic  Reply to topic
 XML AND ATTACH PDF « View previous topic :: View next topic » 
Author Message
gagan.maverick
PostPosted: Thu Jan 08, 2015 11:41 pm    Post subject: XML AND ATTACH PDF Reply with quote

Acolyte

Joined: 30 Sep 2014
Posts: 50

Hi guys , i have a requirement that after unzipping the the zip file in JCN i have to split the xml file into the number of INVOICES in it . and then i have to attach each invoice xml wit the pdf file in the incoming zip file , with the reference it has in its tag <imagename>. Any suggestions on how to proceed.

The sturcture of the zip file is
123.xml
abc.pdf
dcf.pdf
kjh.pdf
and these names are given as references inside the xml file like
<Invoices>
<Invoice>
<imagename>abc.pdf<imagename>
Back to top
View user's profile Send private message
gagan.maverick
PostPosted: Thu Jan 08, 2015 11:42 pm    Post subject: Reply with quote

Acolyte

Joined: 30 Sep 2014
Posts: 50

So, basically my output zip file will contain a splitted xml invoice and its referenced pdf file
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Jan 09, 2015 5:31 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

So you have to create more than one output file.

Each output file has to have a single document, of different types. Some of them are XML and some of them are PDF.
Back to top
View user's profile Send private message
gagan.maverick
PostPosted: Mon Jan 12, 2015 1:54 am    Post subject: Reply with quote

Acolyte

Joined: 30 Sep 2014
Posts: 50

Yes i need to create more than 1 output zip file , each with one invoice from the XML INVOICE, along with the pdf files which each invoice has a reference to
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Jan 12, 2015 5:55 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

gagan.maverick wrote:
Yes i need to create more than 1 output zip file , each with one invoice from the XML INVOICE, along with the pdf files which each invoice has a reference to


So you need to construct more than one output message, each of which has the necessary contents. This output message is then sent to something that creates the actual files and then creates the necessary zip file of those files.
Back to top
View user's profile Send private message
gagan.maverick
PostPosted: Wed Feb 04, 2015 12:49 am    Post subject: Reply with quote

Acolyte

Joined: 30 Sep 2014
Posts: 50

Yes .. some xml tags .. its referenced pdf files
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Feb 04, 2015 5:37 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

gagan.maverick wrote:
Yes .. some xml tags .. its referenced pdf files


So what's the problem?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
VishnuPrasadS
PostPosted: Thu Feb 05, 2015 2:14 am    Post subject: Reply with quote

Apprentice

Joined: 22 Feb 2013
Posts: 28
Location: Pune, India

Hi

I have assumed that you would
1. get zip file in some folder.
2. use jcn to read Zip file.
3. zip file contains multiple invoice.xml files
4. zip file contains multiple attachment.pdf files corresponding to invoice.xml
5. Have to create multiple 'xml messages with attachment in the xml' and push them to a queue.

With these assumptions i have created a sample flow, refer link : https://drive.google.com/folderview?id=0B4qbySw4DAiQfk5hM1pscHZIa2NTb2hXSS12VFRtcXNmOGhXRlZycENCYVRsdnZxRWI0MVE&usp=sharing

Java classes present in IBM-WMB jre were used.
1. 'java.util.zip.ZipFile' was used to read xml file
2. 'org.w3c.dom.Document' was used to work with xml.
3. 'sun.misc.BASE64Encoder' was used for Base64 conversion.
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Thu Feb 05, 2015 5:18 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

That's what you're doing. You still don't say what the problem is.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Feb 05, 2015 5:54 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

VishnuPrasadS wrote:
Hi

I have assumed that you would
1. get zip file in some folder.
2. use jcn to read Zip file.
3. zip file contains multiple invoice.xml files
4. zip file contains multiple attachment.pdf files corresponding to invoice.xml
5. Have to create multiple 'xml messages with attachment in the xml' and push them to a queue.

With these assumptions i have created a sample flow, refer link : https://drive.google.com/folderview?id=0B4qbySw4DAiQfk5hM1pscHZIa2NTb2hXSS12VFRtcXNmOGhXRlZycENCYVRsdnZxRWI0MVE&usp=sharing

Java classes present in IBM-WMB jre were used.
1. 'java.util.zip.ZipFile' was used to read xml file
2. 'org.w3c.dom.Document' was used to work with xml.
3. 'sun.misc.BASE64Encoder' was used for Base64 conversion.


So why did you use a dom Document for your xml and not parse it with the XMLNSC parser of the broker?? The same way the broker has 64bit encode and decode facilities. Why not use those?
Just because you can is no good reason to treat the broker as a java server...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
gagan.maverick
PostPosted: Tue Feb 10, 2015 4:10 am    Post subject: Reply with quote

Acolyte

Joined: 30 Sep 2014
Posts: 50

Hey Vishnu

Actaully in one zip file there is only one xml file with multiple invoice tags and each of those tags have reference to some pdf files .. i mean like this

<xml file>
<Invoice 1>
<PDF ref1>
<Pdf ref2>
</Invoice 1>
<Invoice2>
<Pdf ref 3>
</invoice2>
</xml file> I have to split all the invoices with their respective attachments, but the problem is where to store all the pdfs in the flow in order to make the search ..
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » XML AND ATTACH PDF
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.