As I said, the MIME specs specifically require CRLF. Therefore Axiom
is correct, but one can argue that it should trigger a clearer error
message if the client uses incorrect line endings. You need to fix
your ZSI client to use CRLF (10+13).

Andreas

On Tue, Jan 13, 2009 at 10:14, SivaKrishna Kumar <[email protected]> wrote:
> Hi Andreas,
> Thank you for the reply.
> What you said is exactly correct. I built Axiom src locally on my laptop in
> my eclipse and started debugging where exactly I am getting this error with
> more debug prints. I have captured o/p of Axis2 console with this
> instrumented Axiom, when I ran my ZSI client and soapUI client. Please see
> the attached console outputs.
> If we observe keenly, while parsing the MIME message for headers, when I ran
> my ZSI client, Axis is unable to read the headers from the message. In the
> "readHeaders" method of org.apache.axiom.attachments.impl.PartFactory, Axiom
> is checking for Characted 10 and 13 for new line and blank line. As these
> were not detected in the MIME message, it is unable to parse MIME message
> for header and there by throwing this error.
> My fingers crossed on how to fix this ? :(
> Any suggestion in this regard would be highly helpful to me.
> Thanks & Regards
> Siva
>
> On Tue, Jan 13, 2009 at 4:46 AM, Andreas Veithen <[email protected]>
> wrote:
>>
>> The problem is very probably due to incorrect line endings. The MIME
>> spec requires CRLF (Windows style) line endings. I just checked what
>> happens if Axiom received a MIME message with Unix style line endings,
>> and it gives exactly the message you got.
>>
>> Andreas
>>
>> On Fri, Jan 9, 2009 at 16:25, SivaKrishna Kumar <[email protected]> wrote:
>> > Hi Thillina,
>> > Thank you for your suggestion.
>> > Are you using any well known library for MIME?...
>> > Ans. I am trying to write the library itself. I am trying to add MTOM
>> > support to the opensource API ZSI ( Python based API for Web Services,
>> > like
>> > Axis).
>> > As on date, ZSI does not support attachment upload/download using MTOM.
>> > Then try decoding it using a MIME library (eg: java mail) and try to
>> > access
>> > the part header fields like Content-ID. IF there is a error in your
>> > message
>> > format, this will make your debug life much easier.
>> >
>> > As you suggested, I need to do this. But I am not aware, how to validate
>> > my
>> > MIME message itself. The one that I constructed in ZSI. I will explore
>> > using
>> > java mail as you suggesdted. Any points in this regard will be greatly
>> > helpful to me.
>> > Best Regards
>> > Siva
>> >
>> >
>> > On Fri, Jan 9, 2009 at 7:16 PM, Thilina Gunarathne <[email protected]>
>> > wrote:
>> >>
>> >> If it's working with the same message from SOAPUI, then the reason can
>> >> be
>> >> a formatting issue in the MIME message (EG; bad line break) . Are you
>> >> using
>> >> any well known library for MIME?...
>> >>
>> >> If possible first try to do a local test to verify your MIME
>> >> generation.
>> >> Eg:You can create the MIME using your client and save it directly to
>> >> the
>> >> file system. Then try decoding it using a MIME library (eg: java mail)
>> >> and
>> >> try to access the part header fields like Content-ID. IF there is a
>> >> error in
>> >> your message format, this will make your debug life much easier.
>> >>
>> >> thanks,
>> >> Thilina
>> >>
>> >> On Fri, Jan 9, 2009 at 5:33 AM, SivaKrishna Kumar <[email protected]>
>> >> wrote:
>> >>>
>> >>> Hi Andreas,
>> >>> Thank you for your kind reply.
>> >>> 1. By setting log level to DEBUG, I ran my MTOM Sample Python Client
>> >>> and
>> >>> captured log.
>> >>> 2. Using soapUI I ran the MTOMSample and captured the log.
>> >>> The idea is to do a diff of these two logs to understand where is the
>> >>> problem. I noticed that
>> >>> 1. When I ran my client, Axis2 is not able to find
>> >>> 'Content-Transfer-Encoding' and 'Content-ID' headers.
>> >>> 2. Noticed that the content-length is idfferent in both the cases for
>> >>> the
>> >>> same file :(
>> >>> I am attaching all the three files for your reference.
>> >>> Thanks & Regards
>> >>> Siva
>> >>>
>> >>> On Fri, Jan 9, 2009 at 12:54 AM, Andreas Veithen
>> >>> <[email protected]> wrote:
>> >>>>
>> >>>> Can you set the log level for org.apache.axiom.attachments to DEBUG,
>> >>>> run this again and post the logs? That should allow us to identify
>> >>>> the
>> >>>> problem.
>> >>>>
>> >>>> Andreas
>> >>>>
>> >>>> On Thu, Jan 8, 2009 at 11:41, SivaKrishna Kumar <[email protected]>
>> >>>> wrote:
>> >>>> > Hello All:
>> >>>> > This is Siva from Hyderabad, India. Can you please help me in an
>> >>>> > issue. Here
>> >>>> > is what I am stuck at.
>> >>>> > Zolera SOAP Infrastructure (ZSI) is an open source API written in
>> >>>> > Python for
>> >>>> > Web Services. ZSI doesn't support MTOM for attachment
>> >>>> > uploads/downloads over
>> >>>> > web services. I am trying to add this functionality to ZSI.
>> >>>> > For this I have modified ZSI to send attachments using MTOM. My
>> >>>> > developement
>> >>>> > environment is
>> >>>> > I am using Apache's Axis2 server for testing attachment upload. As
>> >>>> > you
>> >>>> > are
>> >>>> > aware, Axis2 comes with an example for attachments uploading using
>> >>>> > MTOM. I
>> >>>> > have written a client in Python which will talk to Axis2 server
>> >>>> > using
>> >>>> > ZSI.
>> >>>> > When I tried to run the MTOM Sample client that is written in
>> >>>> > Python
>> >>>> > with
>> >>>> > the changes made to ZSI for MTOM, I am getting the below error.
>> >>>> > "Part content ID cannot be blank for non root MIME parts"
>> >>>> > Here is the MTOMized SOAP message and the headers I am sending to
>> >>>> > the
>> >>>> > Axis2.
>> >>>> >
>> >>>> >
>> >>>> > *************************************************************************************************************************************************************************************************************************************************************************
>> >>>> > MIME SOAP Message:
>> >>>> > --==ZSI_MIME_BOUNDARY==
>> >>>> > Content-Transfer-Encoding: 7bit
>> >>>> > Content-Type: application/xop+xml; type="text/xml"
>> >>>> > Content-ID: <soaplibEnvelope>
>> >>>> > <ns0:Envelope
>> >>>> > xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/";><ns0:Header
>> >>>> > /><ns0:Body><ns1:AttachmentRequest
>> >>>> >
>> >>>> >
>> >>>> > xmlns:ns1="http://ws.apache.org/axis2/mtomsample/";><ns1:fileName>w:\WirelessDiagLog_axis_mtomexample_saved.rar</ns1:fileName><ns1:binaryData><ns2:Include
>> >>>> > href="cid:ZSIAttachment_1"
>> >>>> > xmlns:ns2="http://www.w3.org/2004/08/xop/include";
>> >>>> >
>> >>>> > /></ns1:binaryData></ns1:AttachmentRequest></ns0:Body></ns0:Envelope>
>> >>>> > --==ZSI_MIME_BOUNDARY==
>> >>>> > Content-Type: application/octet-stream
>> >>>> > Content-Transfer-Encoding: 8bit
>> >>>> > Content-ID: <ZSIAttachment_1>
>> >>>> > //binary conent of the file
>> >>>> > --==ZSI_MIME_BOUNDARY==--
>> >>>> >
>> >>>> >
>> >>>> > *************************************************************************************************************************************************************************************************************************************************************************
>> >>>> > Headers:
>> >>>> > SOAPAction: '"attachment"'
>> >>>> > Content-Length: 1213
>> >>>> > Content-Type: 'multipart/related; boundary="==ZSI_MIME_BOUNDARY==";
>> >>>> > type="application/xop+xml"; start-info="text/xml";
>> >>>> > start="<soaplibEnvelope>"'
>> >>>> >
>> >>>> >
>> >>>> > *************************************************************************************************************************************************************************************************************************************************************************
>> >>>> > I am not able to understand where is the problem in the changes I
>> >>>> > made
>> >>>> > to
>> >>>> > ZSI for adding MTOM support.
>> >>>> > Can you please help me out in this regard ?
>> >>>> > Thank you in advance,
>> >>>> > Regards
>> >>>> > Siva
>> >>>
>> >>
>> >>
>> >>
>> >> --
>> >> Thilina Gunarathne  - http://thilinag.blogspot.com
>> >
>> >
>
>

Reply via email to