7 Replies Latest reply: Apr 5, 2013 1:18 AM by Eric Elzinga RSS

    OSB mail read from inbox Content type problem

    859275
      Hi,
      I have configured oneosb proxy service,reading mails with attachments from inbox.Local environment it is working fine.It is properly assigning Inbound as well as attachments variable:
      Inbound:

      <con:endpoint name="ProxyService$consuming-emails$proxy$EmailConsumer" xmlns:con="http://www.bea.com/wli/sb/context">
      <con:service/>
      <con:transport>
      <con:uri>mailfrom:localhost:110</con:uri>
      <con:mode>request</con:mode>
      <con:qualityOfService>exactly-once</con:qualityOfService>
      <con:request xsi:type="ema:EmailRequestMetaData" xmlns:ema="http://www.bea.com/wli/sb/transports/email" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <tran:headers xsi:type="ema:EmailRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
      <ema:To>osbadmin@localhost</ema:To>
      <ema:From>manuser &lt;manuser@localhost></ema:From>
      <ema:Date>Wed Mar 20 12:06:33 IST 2013</ema:Date>
      <ema:Subject>iy</ema:Subject>
      *<ema:Content-Type>multipart/mixed;*
      boundary="------------080509050605040807050701"</ema:Content-Type> </tran:headers>
      <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">iso-8859-1</tran:encoding>
      </con:request>
      </con:transport>
      <con:security>
      <con:transportClient>
      <con:username>&lt;anonymous></con:username>
      </con:transportClient>
      </con:security>
      </con:endpoint>>

      Attachments:

      <ALSB Logging> <01HW453173> <AdminServer> <[ACTIVE] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-1430066486C5DC40207D> <0000Jq6Sv14F4ED_V9S4yc1HILJR000002> <1363761448495> <BEA-000000> < [MailConsumerPipelinePair, MailConsumerPipelinePair_request, LogStage, REQUEST] +++++++++Attachments++++++: <con:attachments xmlns:con="http://www.bea.com/wli/sb/context">
      <con:attachment>
      <con:Content-Type>text/plain; charset=windows-1252;
      name="10032013M03.csv"</con:Content-Type>
      <con:Content-Disposition>attachment;
      filename="10032013M03.csv"</con:Content-Disposition>
      <con:Content-Transfer-Encoding>base64</con:Content-Transfer-Encoding>
      <con:body>SerialNumber, Manufacturer, Model, Size, Rating(QN), Class, Mech/MeterComplete, Cost, Dials, Multiplier, CustomerOrderNo, DeliveryNote, Connection, AssociatedSerialNumber, TransactionDate, PurchasingCompany,Purchaser’s Name, Flow Range Rating, Connector Size, Material Type, Encoder Unit Supplied, Barcode Identifier
      12W710234,ELSTER,Helix4000,50,50,B,C,121.51,6,1,Y4Y002621,1739968,FLANGED,12M216701,31/03/2013,,Burdens,1233111,70,Polymer,N,12345678
      12M215701,Nihar1,MSM,25,3.5,D,C,54,5,1,Y4Y002388,1740034,MANIFOLD,12M216701,1/4/2013,,Burdens,1233112,70,Polymer,N,12345679
      12M215701,Nihar2,MSM,25,3.5,D,C,54,5,1,Y4Y002388,1740035,MANIFOLD,12M216701,1/4/2013,,Burdens,1233112,70,Polymer,N,12345679
      12M215701,Nihar3,MSM,25,3.5,D,C,54,5,1,Y4Y002388,1740036,MANIFOLD,12M216701,1/4/2013,,Burdens,1233112,70,Polymer,N,12345679
      DATE:02042013 RECORDS:4</con:body>
      </con:attachment>
      </con:attachments>>



      But in Test environment,I found that it is not populating attchments variable properly.
      when I enabled tracing I found the below message:
      <BEA-398079> <
      [OSB Tracing] Entering pipeline pair MailConsumerPipelinePair with message context:
      [MessageContextImpl  body="<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">SerialNumber, Manufacturer, Model, Size, Rating(QN), Class, Mech/MeterComplete, Cost, Dials, Multiplier, CustomerOrderNo, DeliveryNote, Connection, AssociatedSerialNumber, TransactionDate, PurchasingCompany,Purchaser?s Name, Flow Range Rating, Connector Size, Material Type, Encoder Unit Supplied, Barcode Identifier
      12W710234,ELSTER,Helix4000,50,50,B,C,121.51,6,1,Y4Y002621,1739968,FLANGED,12M216701,31/03/2013,,Burdens,1233111,70,Polymer,N,12345678
      12M215701,Nihar1,MSM,25,3.5,D,C,54,5,1,Y4Y002388,1740034,MANIFOLD,12M216701,1/4/2013,,Burdens,1233112,70,Polymer,N,12345679
      12M215701,Nihar2,MSM,25,3.5,D,C,54,5,1,Y4Y002388,1740035,MANIFOLD,12M216701,1/4/2013,,Burdens,1233112,70,Polymer,N,12345679
      12M215701,Nihar3,MSM,25,3.5,D,C,54,5,1,Y4Y002388,1740036,MANIFOLD,12M216701,1/4/2013,,Burdens,1233112,70,Polymer,N,12345679
      DATE:02042013 RECORDS:4</soapenv:Body>"
      AttachmentName=""
      senderID="Sanjit.Panja@scottishwater.co.uk"
      fault="null"
      SenderName=""
      header="<soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>"
      operation="null"
      AttachMentExt=""
      messageID="4642239957297460405--1089add7.13da1533394.-7f71"
      outbound="null"
      attachments="<con:attachments xmlns:con="http://www.bea.com/wli/sb/context"/>"
      inbound="<con:endpoint name="ProxyService$consuming-emails$proxy$EmailConsumer" xmlns:con="http://www.bea.com/wli/sb/context">
        <con:service/>
        <con:transport>
          <con:uri>mailfrom:10.100.3.24:110</con:uri>
          <con:mode>request</con:mode>
          <con:qualityOfService>exactly-once</con:qualityOfService>
          <con:request xsi:type="ema:EmailRequestMetaData" xmlns:ema="http://www.bea.com/wli/sb/transports/email" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <tran:headers xsi:type="ema:EmailRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
              <ema:To>Metering Services Test &lt;MeteringServicesTest@scottishwater.co.uk></ema:To>
              <ema:From>Sanjit Panja &lt;Sanjit.Panja@scottishwater.co.uk></ema:From>
              <ema:Date>Mon Mar 25 12:22:48 GMT 2013</ema:Date>
              <ema:Subject/>
              *<ema:Content-Type>application/octet-stream;*
      *     name="10032013M03.csv"</ema:Content-Type>*      </tran:headers>
            <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">iso-8859-1</tran:encoding>
          </con:request>
        </con:transport>
        <con:security>
          <con:transportClient>
            <con:username>&lt;anonymous></con:username>
          </con:transportClient>
        </con:security>
      </con:endpoint>"
      ContentType="null"
      ]>

      I found difference that Content Type(Marked in Bold) is not same for those two cases.

      Edited by: 856272 on Mar 25, 2013 5:27 AM
        • 1. Re: OSB mail read from inbox Content type problem
          859275
          In addition to that I am using apache james server for local and Microsoft Mail Exchange server for test.
          • 2. Re: OSB mail read from inbox Content type problem
            859275
            The message I am getting in local env after enable tracing:

            body="<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"></soapenv:Body>"
            operation="null"
            messageID="3167003703233945829-3f4c5489.13d867377d6.-7ee3"
            attachments="<con:attachments xmlns:con="http://www.bea.com/wli/sb/context">
            <con:attachment>
            <con:Content-Type>text/plain; charset=windows-1252;
            name="10032013M03.csv"</con:Content-Type>
            <con:Content-Disposition>attachment;
            filename="10032013M03.csv"</con:Content-Disposition>
            <con:Content-Transfer-Encoding>base64</con:Content-Transfer-Encoding>
            <con:body>SerialNumber, Manufacturer, Model, Size, Rating(QN), Class, Mech/MeterComplete, Cost, Dials, Multiplier, CustomerOrderNo, DeliveryNote, Connection, AssociatedSerialNumber, TransactionDate, PurchasingCompany,Purchaser’s Name, Flow Range Rating, Connector Size, Material Type, Encoder Unit Supplied, Barcode Identifier
            12W710234,ELSTER,Helix4000,50,50,B,C,121.51,6,1,Y4Y002621,1739968,FLANGED,12M216701,31/03/2013,,Burdens,1233111,70,Polymer,N,12345678
            12M215701,Nihar1,MSM,25,3.5,D,C,54,5,1,Y4Y002388,1740034,MANIFOLD,12M216701,1/4/2013,,Burdens,1233112,70,Polymer,N,12345679
            12M215701,Nihar2,MSM,25,3.5,D,C,54,5,1,Y4Y002388,1740035,MANIFOLD,12M216701,1/4/2013,,Burdens,1233112,70,Polymer,N,12345679
            12M215701,Nihar3,MSM,25,3.5,D,C,54,5,1,Y4Y002388,1740036,MANIFOLD,12M216701,1/4/2013,,Burdens,1233112,70,Polymer,N,12345679
            DATE:02042013 RECORDS:4</con:body>
            </con:attachment>
            </con:attachments>"
            outbound="null"
            fault="null"
            inbound="<con:endpoint name="ProxyService$consuming-emails$proxy$EmailConsumer" xmlns:con="http://www.bea.com/wli/sb/context">
            <con:service/>
            <con:transport>
            <con:uri>mailfrom:localhost:110</con:uri>
            <con:mode>request</con:mode>
            <con:qualityOfService>exactly-once</con:qualityOfService>
            <con:request xsi:type="ema:EmailRequestMetaData" xmlns:ema="http://www.bea.com/wli/sb/transports/email" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <tran:headers xsi:type="ema:EmailRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
            <ema:To>osbadmin@localhost</ema:To>
            <ema:From>manuser &lt;manuser@localhost></ema:From>
            <ema:Date>Mon Mar 25 19:04:50 IST 2013</ema:Date>
            <ema:Subject>abc</ema:Subject>
            <ema:Content-Type>multipart/mixed;
            boundary="------------000406070103040207010400"</ema:Content-Type>
            </tran:headers>
            <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">iso-8859-1</tran:encoding>
            </con:request>
            </con:transport>
            <con:security>
            <con:transportClient>
            <con:username>&lt;anonymous></con:username>
            </con:transportClient>
            </con:security>
            </con:endpoint>"
            header="<soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>"
            ]>


            The message I am getting in Test env after enable tracing:

            body="<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">SerialNumber, Manufacturer, Model, Size, Rating(QN), Class, Mech/MeterComplete, Cost, Dials, Multiplier, CustomerOrderNo, DeliveryNote, Connection, AssociatedSerialNumber, TransactionDate, PurchasingCompany,Purchaser?s Name, Flow Range Rating, Connector Size, Material Type, Encoder Unit Supplied, Barcode Identifier
            12W710234,ELSTER,Helix4000,50,50,B,C,121.51,6,1,Y4Y002621,1739968,FLANGED,12M216701,31/03/2013,,Burdens,1233111,70,Polymer,N,12345678
            12M215701,Nihar1,MSM,25,3.5,D,C,54,5,1,Y4Y002388,1740034,MANIFOLD,12M216701,1/4/2013,,Burdens,1233112,70,Polymer,N,12345679
            12M215701,Nihar2,MSM,25,3.5,D,C,54,5,1,Y4Y002388,1740035,MANIFOLD,12M216701,1/4/2013,,Burdens,1233112,70,Polymer,N,12345679
            12M215701,Nihar3,MSM,25,3.5,D,C,54,5,1,Y4Y002388,1740036,MANIFOLD,12M216701,1/4/2013,,Burdens,1233112,70,Polymer,N,12345679
            DATE:02042013 RECORDS:4</soapenv:Body>"
            AttachmentName=""
            senderID="Sanjit.Panja@scottishwater.co.uk"
            fault="null"
            SenderName=""
            header="<soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>"
            operation="null"
            AttachMentExt=""
            messageID="6167577018374881777-8b144fb.13da1cef585.-7f99"
            outbound="null"
            attachments="<con:attachments xmlns:con="http://www.bea.com/wli/sb/context"/>"
            inbound="<con:endpoint name="ProxyService$consuming-emails$proxy$EmailConsumer" xmlns:con="http://www.bea.com/wli/sb/context">
            <con:service/>
            <con:transport>
            <con:uri>mailfrom:10.100.3.24:110</con:uri>
            <con:mode>request</con:mode>
            <con:qualityOfService>exactly-once</con:qualityOfService>
            <con:request xsi:type="ema:EmailRequestMetaData" xmlns:ema="http://www.bea.com/wli/sb/transports/email" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <tran:headers xsi:type="ema:EmailRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
            <ema:To>Metering Services Test &lt;MeteringServicesTest@scottishwater.co.uk></ema:To>
            <ema:From>Sanjit Panja &lt;Sanjit.Panja@scottishwater.co.uk></ema:From>
            <ema:Date>Mon Mar 25 14:34:50 GMT 2013</ema:Date>
            <ema:Subject/>
            <ema:Content-Type>application/octet-stream;
                 name="10032013M03.csv"</ema:Content-Type>
            </tran:headers>
            <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">ISO-8859-1</tran:encoding>
            </con:request>
            </con:transport>
            <con:security>
            <con:transportClient>
            <con:username>&lt;anonymous></con:username>
            </con:transportClient>
            </con:security>
            </con:endpoint>"
            ContentType="null"
            ]>
            • 3. Re: OSB mail read from inbox Content type problem
              vladodias
              The content is coming in $attachments on local but in $body on test... What's different? The issue probably is the way the mail is being generated, it can even be related to the email client being used... Is the same mail server in both envs?

              Cheers,
              Vlad
              • 4. Re: OSB mail read from inbox Content type problem
                859275
                We are using apache james server for local and microsoft exchange server for test environment.Also if we write something in the body of mail then the content of the csv file is getting lost.
                Below is the log when there is something written in the body of the mail:

                body="<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">Thanks and Regards,
                </soapenv:Body>"
                operation="null"
                messageID="4652300389587554150-18818a19.13dc47a45c0.-7f0a"
                attachments="<con:attachments xmlns:con="http://www.bea.com/wli/sb/context">
                <con:attachment>
                <con:Content-Type>application/octet-stream;
                name="01042013M08.csv"</con:Content-Type>
                <con:Content-Description>01042013M08.csv</con:Content-Description>
                <con:Content-Disposition>attachment;
                filename="01042013M08.csv"</con:Content-Disposition>
                <con:Content-Transfer-Encoding>base64</con:Content-Transfer-Encoding>
                <con:body>
                <con:binary-content ref="cid:18818a19:13dc47a45c0:-7f07"/>
                </con:body>
                </con:attachment>
                </con:attachments>"
                outbound="null"
                fault="null"
                inbound="<con:endpoint name="ProxyService$consuming-emails$proxy$EmailConsumer" xmlns:con="http://www.bea.com/wli/sb/context">
                <con:service/>
                <con:transport>
                <con:uri>mailfrom:exchange-cl01.scotwat.net:110</con:uri>
                <con:mode>request</con:mode>
                <con:qualityOfService>exactly-once</con:qualityOfService>
                <con:request xsi:type="ema:EmailRequestMetaData" xmlns:ema="http://www.bea.com/wli/sb/transports/email" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <tran:headers xsi:type="ema:EmailRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
                <ema:To>Metering Services Test &lt;MeteringServicesTest@scottishwater.co.uk></ema:To>
                <ema:From>Sanjit Panja &lt;Sanjit.Panja@scottishwater.co.uk></ema:From>
                <ema:Date>Tue Apr 02 13:37:01 BST 2013</ema:Date>
                <ema:Subject/>
                <ema:Content-Type>multipart/mixed;
                boundary="----_=_NextPart_001_01CE2F9E.C8DA920E"</ema:Content-Type>
                </tran:headers>
                <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">iso-8859-1</tran:encoding>
                </con:request>
                </con:transport>
                <con:security>
                <con:transportClient>
                <con:username>&lt;anonymous></con:username>
                </con:transportClient>
                </con:security>
                </con:endpoint>"
                header="<soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/%22/>"
                ]>
                • 5. Re: OSB mail read from inbox Content type problem
                  vladodias
                  The content is not lost, the content is here... Sent as reference...
                  <con:binary-content ref="cid:18818a19:13dc47a45c0:-7f07"/>

                  You can not use different configurations and expect the same results... It will be very difficult to cover all the cases... Set up the environment that you will actually use in PROD and stick to it, also educate the users to send the e-mail the way you expect, otherwise you will be ending up nowhere...

                  Cheers,
                  Vlad
                  • 6. Re: OSB mail read from inbox Content type problem
                    859275
                    Is there any way to retrive the csv file from that binary content?
                    • 7. Re: OSB mail read from inbox Content type problem
                      Eric Elzinga
                      for some usecase i was struggling with the same
                      and if i remember correctly a created a new proxy service which received the binary data, and in there i used a sync file adapter to write it to file system
                      not sure if you want to end up on filesystem

                      but the reference data can only be read by use of java callout or 'write' it to for example file system

                      see:
                      http://docs.oracle.com/cd/E23943_01/admin.1111/e15867/context.htm#i1104505
                      how to read byte[] in OSB
                      http://docs.oracle.com/cd/E14571_01/doc.1111/e15867/pojo.htm