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 Interchange Server + Adapters » polling a zip file using an email adapter

Post new topic  Reply to topic
 polling a zip file using an email adapter « View previous topic :: View next topic » 
Author Message
Vinayak.Satapute
PostPosted: Mon May 12, 2008 11:03 pm    Post subject: polling a zip file using an email adapter Reply with quote

Acolyte

Joined: 20 Dec 2006
Posts: 70

Hi,

Currently I am polling an Email account for mails with attachment Using WBI Email Adapter.
Whenever a Adapter instance polls the INBOX for new mail with attachment,it fetches the mail body into one message and attachment as another message to a queue.

But when the attachment is in .txt form,it successfully sends the attachment as a message to a queue.But in case of zip attachment I receive a message without attachment content into queue.

I have set the mime type to "application/octet-stream" in a custom Data Handler in a Meta Object MO_DataHandler_Default.

***********************Sample Polled mail with zip attachment*****
A194 OK FETCH completed
Return-Path: <ibm.akshay@mas.com.my>
Received: from IBM-KPZANKL ([127.0.0.1])
by localhost
with hMailServer ; Tue, 13 May 2008 14:58:38 +0800
Message-ID: <653464998.1210661917405.JavaMail.my550873@IBM-KPZANKL>
Date: Tue, 13 May 2008 14:58:37 +0800 (SGT)
From: ibm.akshay@mas.com.my
To: test@IBM-KPZANKL.my.ibm.com
Subject: Hi
Mime-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_6_453514662.1210661917245"

------=_Part_6_453514662.1210661917245
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

test the message body
------=_Part_6_453514662.1210661917245
Content-Type: application/octet-stream; name=sendmail.zip
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=sendmail.zip

UEsDBAoAAAAAAId0kDhZ7omTJAAAACQAAAAMAAAAc2VuZG1haWwudHh0SGksDQoNCkhvdyBhcmUg
eW91IGRvaW5nIE1BUz8NCg0KQnllUEsBAhQACgAAAAAAh3SQOFnuiZMkAAAAJAAAAAwAAAAAAAAA
AQAgAAAAAAAAAHNlbmRtYWlsLnR4dFBLBQYAAAAAAQABADoAAABOAAAAAAA=

------=_Part_6_453514662.1210661917245--
*********************************************************
I am suppose to receive the above highlighted data which is zip content into my queue.Which is not happening(Receiving message without above data to queue).

Your suggestions are highly appreciated.

Regards,
Vinayak Satapute.
Back to top
View user's profile Send private message
Gaya3
PostPosted: Mon May 12, 2008 11:15 pm    Post subject: Re: polling a zip file using an email adapter Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

Vinayak.Satapute wrote:

Content-Type: application/octet-stream; name=sendmail.zip
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=sendmail.zip

[b]UEsDBAoAAAAAAId0kDhZ7omTJAAAACQAAAAMAAAAc2VuZG1haWwudHh0SGksDQoNCkhvdyBhcmUg
eW91IGRvaW5nIE1BUz8NCg0KQnllUEsBAhQACgAAAAAAh3SQOFnuiZMkAAAAJAAAAAwAAAAAAAAA
AQAgAAAAAAAAAHNlbmRtYWlsLnR4dFBLBQYAAAAAAQABADoAAABOAAAAAAA=[/
b]
------=_Part_6_453514662.1210661917245--
*********************************************************
I am suppose to receive the above highlighted data which is zip content into my queue.Which is not happening(Receiving message without above data to queue).


are you getting the above message in queue. If so thats the attachment i guess.

Let me know whats your target location,
Using file nodes will help you to write the zip file in any location
Using JCN also you can compress and decompress Zip files
Support pacs are also available

Regards
Gayathri
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
Vinayak.Satapute
PostPosted: Tue May 13, 2008 1:44 am    Post subject: Reply with quote

Acolyte

Joined: 20 Dec 2006
Posts: 70

Hi,

I am suppose to receive the attachement as a message to queue,the message will be in BO format.

Following is the trace details from my adapter instance,showing how it is interpreting my zip file and also it suppose to assign the zipped message content to "field1" data which it is not doing and I am receiving balnk BO message in my queue.

*********************Trace file*******************************
[Mesg: :class com.ibm.custom.ApplicationOctetStream :getBO(Reader, Object) set mBOCharBuffer to the following:
PK
‡t�8Y$ $ sendmail.txtHi,
How are you doing MAS?
ByePK
‡t�8Y$ $  sendmail.txtPK  
: N ]
[Time: 2008/05/13 17:12:14.563] [System: ConnectorAgent] [SS: RecvMail] [Thread: appPolling (#1299689626)] [Type: Trace] [Mesg: :class com.ibm.custom.ApplicationOctetStream :getBO(Reader, Object) calling getBOFromString]
[Time: 2008/05/13 17:12:14.563] [System: ConnectorAgent] [SS: RecvMail] [Thread: appPolling (#1299689626)] [Type: Trace] [Mesg: :class com.ibm.custom.ApplicationOctetStream :Entering getBOFromString(String)]
[Time: 2008/05/13 17:12:14.563] [System: ConnectorAgent] [SS: RecvMail] [Thread: appPolling (#1299689626)] [Type: Trace] [Mesg: :class com.ibm.custom.ApplicationOctetStream :Vinayak testing getBO5: ]
[Time: 2008/05/13 17:12:14.563] [System: ConnectorAgent] [SS: RecvMail] [Thread: appPolling (#1299689626)] [Type: Trace] [Mesg: :class com.ibm.custom.ApplicationOctetStream :BusinessObject name from the message contents: Customer1_data]
[Time: 2008/05/13 17:12:14.563] [System: ConnectorAgent] [SS: RecvMail] [Thread: appPolling (#1299689626)] [Type: Trace] [Mesg: :class com.ibm.custom.ApplicationOctetStream :BusinessObject verb from the message contnents: Create]
[Time: 2008/05/13 17:12:14.563] [System: ConnectorAgent] [SS: RecvMail] [Thread: appPolling (#1299689626)] [Type: Trace] [Mesg: :class com.ibm.custom.ApplicationOctetStream :Exiting getBOFromString(String)]
[Time: 2008/05/13 17:12:14.563] [System: ConnectorAgent] [SS: RecvMail] [Thread: appPolling (#1299689626)] [Type: Trace] [Mesg: :class com.ibm.custom.ApplicationOctetStream :Exiting getBO(Reader, Object)]
[Time: 2008/05/13 17:12:14.563] [System: ConnectorAgent] [SS: RecvMail] [Thread: appPolling (#1299689626)] [Type: Trace] [Mesg: :Delivering business object: Customer1_data]
[Time: 2008/05/13 17:12:14.563] [System: ConnectorAgent] [SS: RecvMail] [Thread: appPolling (#1299689626)] [Type: Trace] [Mesg: :<StartHeader>
<Version = 3.0>
<EndHeader>
<StartBO:Customer1_data>
BusinessObject = Customer1_data
Verb = Create
Locale = en_US
field1 = CxIgnore(Shoud have assigned zip content data here)
field2 = CxIgnore
field3 = CxIgnore
field4 = CxIgnore
ObjectEventId = CxIgnore
<EndBO:Customer1_data>]
[Time: 2008/05/13 17:12:14.563] [System: ConnectorAgent] [SS: RecvMail] [Thread: appPolling (#1299689626)] [Type: Trace] [Mesg: :Received BusObj from App Connector.]
[Time: 2008/05/13 17:12:14.563] [System: ConnectorAgent] [SS: RecvMail] [Thread: appPolling (#1299689626)] [Type: Trace] [Mesg: :Posting BusObj to Interchange.]
[Time: 2008/05/13 17:12:14.563] [System: ConnectorAgent] [SS: RecvMail] [Thread: appPolling (#1299689626)] [Type: Trace] [Mesg: :Business Object before delivering to the ICS :<StartHeader>
<Version = 3.0>
<EndHeader>
<StartBO:Customer1_data>
BusinessObject = Customer1_data
Verb = Create
Locale = en_US
field1 = CxIgnore
field2 = CxIgnore
field3 = CxIgnore
field4 = CxIgnore
ObjectEventId = CxIgnore
<EndBO:Customer1_data>]

*******************************************************
So I need to just receive a proper BO message to my queue that is my target.Hope you have understood the scenario.
Please update further on solution.

Thank You,
Vinayak Satapute.
Back to top
View user's profile Send private message
Gaya3
PostPosted: Tue May 13, 2008 8:37 pm    Post subject: Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

sorry, i couldnt able to make out the issue.

1. Are you getting any messages in your target queue?
(If so, in which format you are getting)

2. How you created a BO for a ZIP file format?

Regards
Gayathri
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
Vinayak.Satapute
PostPosted: Tue May 13, 2008 11:49 pm    Post subject: Reply with quote

Acolyte

Joined: 20 Dec 2006
Posts: 70

Hi,

1. Yes, I am getting the message to my target queue.Whenever adapter instance polls a mail with attached file,I receive two messages to my target queue.

First message will be holding the mail body content.See below the received message.
************************************************************
RFH  ¤  µMQSTR ¸ T<mcd><Msd>xml</Msd><Set>504</Set><Type>Customer1_data</Type><Fmt>CwXML</Fmt></mcd> X<jms><Dst>queue:///EMAIL1/DELIVERYQUEUE</Dst><Tms>1210747796059</Tms><Dlv>2</Dlv></jms> È<usr><WSDLBinding>Customer1_dataAgentDeliveryBinding</WSDLBinding><WSDLOperation>Customer1_dataCreate</WSDLOperation><PrivacyLevel>None</PrivacyLevel><MessageType>Customer1_data</MessageType></usr> <?xml version="1.0" encoding="UTF-8"?>
<Q1:Customer1_data
xmlns:Q1="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/Customer1_data" version="3.0.0" verb="Create" locale="en_US" delta="false">
<Q1:field1>Sending a file. </Q1:field1>
<Q1:ObjectEventId>RecvMail_1210747796059_3</Q1:ObjectEventId>
</Q1:Customer1_data>
*********************************************************
where above highlighted part is body of the mail.

Second message suppose to hold attachment content but i am receiving blank BO message.

*********************************************************
RFH  ¤  µMQSTR ¸ T<mcd><Msd>xml</Msd><Set>504</Set><Type>Customer1_data</Type><Fmt>CwXML</Fmt></mcd> X<jms><Dst>queue:///EMAIL1/DELIVERYQUEUE</Dst><Tms>1210747796099</Tms><Dlv>2</Dlv></jms> È<usr><WSDLBinding>Customer1_dataAgentDeliveryBinding</WSDLBinding><WSDLOperation>Customer1_dataCreate</WSDLOperation><PrivacyLevel>None</PrivacyLevel><MessageType>Customer1_data</MessageType></usr> <?xml version="1.0" encoding="UTF-8"?>
<Q1:Customer1_data
xmlns:Q1="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/Customer1_data" version="3.0.0" verb="Create" locale="en_US" delta="false">
<Q1:ObjectEventId>RecvMail_1210747796099_4</Q1:ObjectEventId>
</Q1:Customer1_data>
***********************************************************
you can see the message is not having "field" data as in first message.

Following is the BO structure for a zip file format.
********************************************************
RecipientName String 1 0 0 255 ibm.vinayak@mas.com.my
MimeType String 0 0 0 24 application\octet-stream
MessageSubject String 0 0 0 255 Hi
MessageContent String 0 0 0 255 text
FromAddress String 0 0 0 22 ibm.akshay@mas.com.my
AttachmentExtension String 0 0 0 255 zip
File String 0 0 0 255 c:\sendmail.zip
ContentType String 0 0 0 255
DataEncoding String 0 0 0 255 text
*********************************************************
please update further.

Thank you,
Vinayak Satapute.
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 Interchange Server + Adapters » polling a zip file using an email adapter
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.