You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Laurent CELLA <la...@inexbee.com> on 2006/05/29 15:04:59 UTC

SOAP With Attachments - MIME Part Content Transfer Encoding

Hi dear Axis Users.

I am developing a Service with SOAP with attachments ( axis 2 rel 1.0 )
I dont use MTOM so I prefer retrieve the attachments content by their 
dataHandlers with the technic showed in the example
http://ws.apache.org/axis2/1_0/mtom-guide.html

I have some questions about the way Axis Handles the Parts it receives, 
especially when "Content Transfer Encoding" is set as a Part Header and 
not using MTOM.

1.
 
For instance, if I submit a attachment at client side base64 encoded, 
and specifying "Content-Transfer-Encoding = base64" in the Header, the 
result is not automatically decoded at server side, I must call 
Base64.decode( ... ) explicitely ).

Is it a normal behaviour ? Can we configure the service so it will 
decode on its own ?

2.

I have noticed the same thing with encoding "quoted-printable" in an 
attachment : looks like it is up to me to do the decode Work.
Is it a normal behaviour ? Or I miss something ?

3.
Encoding of the SOAP part of request.
The SOAP enveloppe is the first MimePart itself.

Here is an example wich uses "quoted-printable" encoding for the SOAP Body.

------=_Part_1_20639876.1146648323575
Content-Type: application/xop+xml; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Content-ID: </doc-access-soap/process-request>

<?xml version=3D"1.0" encoding=3D"utf-8"?>
<soapenv:Envelope xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope=
/">
<soapenv:Body xmlns:types=3D"http://www.inexbee.com/m2doc/m2doc">
<processRequest xmlns=3D"http://www.inexbee.com/m2doc/m2doc"
     mailProcessRequest=3D"=
true">
( ... )
</processRequest>
</soapenv:Body></soapenv:Envelope>

Such a request cause Axis Exceptions such this one ( release 0.95 ) :
It seems the AXIS Api tries to parse XML prior to apply 
"quoted-printable" decoding. Is it a good interpretation ?

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope 
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Header 
/><soapenv:Body><soapenv:Fault><soapenv:Code><soapenv:Value>soapenv:Sender</soapenv:Value></soapenv:Code><soapenv:Reason><soapenv:Text 
xml:lang="en-US">Unexpected character '3' (code 51); expected a quote 
character enclosing value for 'version'
 at [row,col {unknown-source}]: [1,15]; nested exception is:
       com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected 
character '3' (code 51); expected a quote character enclosing value for 
'version'
 at [row,col {unknown-source}]: 
[1,15]</soapenv:Text></soapenv:Reason><soapenv:Detail><Exception 
xmlns="">org.apache.axis2.AxisFault: Unexpected character '3' (code 51); 
expected a quote character enclosing value for 'version'
 at [row,col {unknown-source}]: [1,15]; nested exception is:
       com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected 
character '3' (code 51); expected a quote character enclosing value for 
'version'
 at [row,col {unknown-source}]: [1,15]
       at 
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:297)
       at 
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:160)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
       at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
       at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
       at java.lang.Thread.run(Thread.java:595)
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected 
character '3' (code 51); expected a quote character enclosing value for 
'version'
 at [row,col {unknown-source}]: [1,15]
       at 
com.ctc.wstx.io.InputBootstrapper.reportUnexpectedChar(InputBootstrapper.java:430)
       at 
com.ctc.wstx.io.InputBootstrapper.handleEq(InputBootstrapper.java:344)
       at 
com.ctc.wstx.io.InputBootstrapper.readXmlVersion(InputBootstrapper.java:243)
       at 
com.ctc.wstx.io.InputBootstrapper.readXmlDecl(InputBootstrapper.java:205)
       at 
com.ctc.wstx.io.ReaderBootstrapper.bootstrapInput(ReaderBootstrapper.java:139)
       at 
com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:503)
       at 
com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:558)

***

Laurent CELLA
Inexbee Software





---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [Axis2] Fwd: SOAP With Attachments - MIME Part Content Transfer Encoding

Posted by Laurent CELLA <la...@inexbee.com>.
Hi Thilina.

As I said The use of SUN Javamail 1.4 in AXIS2 replacing 
geronimo-spec-javamail solves my problem.

So Before I submit a JIRA, could you tell me if geronimo-spec-javamail 
was supposed to do the same for now,
or if it is still active developpement ?

Let me explain myself :

When I Used geronimo-spec as javamail API on my AXIS server, it appears 
to me text/plain was directed to String,
and all others contents mapped to "ByteArrayInputStream".

This stream however, was never implicitly decoded by this javamail 
implementation if Base64 or quoted printable in the source for instance.

I Had another problems with this geronimo-spec javamail API, wich makes 
me submit another JIRA :

http://issues.apache.org/jira/browse/GERONIMO-2041


MimeUtility class was not fully implemented.
We told me there that geronimo-spec-javamail-SNAPSHOT.jar was a complete 
implementation.
However this jar does not contain nor mailcap neither content handler 
classes... and MimeUtility does not work yet  ( I will comment the JIRA 
again soon )

All That makes me thinks that should be a "future implemented issue" 
rather than a bug ?

I prefer to be clear in my mind before to submit a JIRA. I dont want to 
bother you for bugs wich are not bugs... :p


Thilina Gunarathne a écrit :
> Hi Laurent,
> Can you please log a JIRA at gerenimo as Dr.Sanjiva suggested.... Give 
> us the JIRA number too, so that we too can track it...
>
> Always Welcome :)
> ~Thilina
> On 5/31/06, *Laurent CELLA* <laurent.cella@inexbee.com 
> <ma...@inexbee.com>> wrote:
>
>     Hi Thilina.
>
>     I was reluctant at the beginning to use SUN javamail API cause there
>     were already geronimo-spec-javamail given with AXIS 2 libs and the
>     sun
>     mailcap seemed to me "a bit too complex" compared to geronimo mailcap.
>     But I downloaded and installed java mail 1.4, and modified a bit
>     my code
>     to fit the new content handlers and the result is :
>
>     It  implicitly decodes Base64 and quoted printable stream ( the
>     contentHandler I retrieve at server side becomes an
>     InputFilterStream in
>     those 2 cases ) in Attachments ( the stream i Retrieve is decoded )
>
>     So the replacing you suggested to me solves most of my problems :)
>     Thanks !
>
>     Thilina Gunarathne a écrit :
>     > Hi Luarent,
>     > Can you try it again by replacing the geronimo-spec-javamail-XXX.jar
>     > with sun's mail jar[1].
>     > Please log a JIRA if the things are not working well even after
>     > replacing them.
>     >
>     > Thanks,
>     > ~Thilina
>     >
>     > [1] http://java.sun.com/products/javamail/downloads/index.html
>     >
>     >
>     > On 5/30/06, *Sanjiva Weerawarana* <sanjiva@opensource.lk
>     <ma...@opensource.lk>
>     > <mailto:sanjiva@opensource.lk <ma...@opensource.lk>>>
>     wrote:
>     >
>     >     On Tue, 2006-05-30 at 10:38 +0600, Thilina Gunarathne wrote:
>     >     > Adding [Axis2]prefix..
>     >     > Moving the conversation over to Axis2-dev list...Please
>     post your
>     >     > replies to dev list..
>     >     >
>     >     > Hi Laurent and devs,
>     >     > Currently [1],[2] are the intended behavior. Do you have a
>     use case
>     >     > which makes it mandatory to send the base64 as an attachment,
>     >     without
>     >     > embedding in the SOAP message...
>     >     >
>     >     > I'm not sure whether we need to support the [3].
>     >
>     >     Ignoring Content-Transfer-Encoding is a bug .. we can refuse to
>     >     process
>     >     certain CTEs, but we cannot ignore it. Is this a JavaMail
>     bug or a
>     >     problem in our code?? (I agree JavaMail should be doing the
>     work!)
>     >
>     >     Sanjiva.
>     >     >
>     >
>     >
>     >    
>     ---------------------------------------------------------------------
>     >     To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
>     <ma...@ws.apache.org>
>     >     <mailto:axis-dev-unsubscribe@ws.apache.org
>     <ma...@ws.apache.org>>
>     >     For additional commands, e-mail: axis-dev-help@ws.apache.org
>     <ma...@ws.apache.org>
>     >     <mailto:axis-dev-help@ws.apache.org
>     <ma...@ws.apache.org>>
>     >
>     >
>     >
>     >
>     > --
>     > "May the SourcE be with u"
>     > http://webservices.apache.org/~thilina/
>     <http://webservices.apache.org/%7Ethilina/>
>     > <http://webservices.apache.org/%7Ethilina/>
>     > http://thilinag.blogspot.com/ <http://thilinag.blogspot.com/>
>     > http://www.bloglines.com/blog/Thilina
>
>
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
>     <ma...@ws.apache.org>
>     For additional commands, e-mail: axis-dev-help@ws.apache.org
>     <ma...@ws.apache.org>
>
>
>
>
> -- 
> "May the SourcE be with u"            
> http://webservices.apache.org/~thilina/ 
> <http://webservices.apache.org/%7Ethilina/>
> http://thilinag.blogspot.com/                 
> http://www.bloglines.com/blog/Thilina               


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: [Axis2] Fwd: SOAP With Attachments - MIME Part Content Transfer Encoding

Posted by Thilina Gunarathne <cs...@gmail.com>.
Hi Laurent,
Can you please log a JIRA at gerenimo as Dr.Sanjiva suggested.... Give us
the JIRA number too, so that we too can track it...

Always Welcome :)
~Thilina
On 5/31/06, Laurent CELLA <la...@inexbee.com> wrote:
>
> Hi Thilina.
>
> I was reluctant at the beginning to use SUN javamail API cause there
> were already geronimo-spec-javamail given with AXIS 2 libs and the sun
> mailcap seemed to me "a bit too complex" compared to geronimo mailcap.
> But I downloaded and installed java mail 1.4, and modified a bit my code
> to fit the new content handlers and the result is :
>
> It  implicitly decodes Base64 and quoted printable stream ( the
> contentHandler I retrieve at server side becomes an InputFilterStream in
> those 2 cases ) in Attachments ( the stream i Retrieve is decoded )
>
> So the replacing you suggested to me solves most of my problems :) Thanks
> !
>
> Thilina Gunarathne a écrit :
> > Hi Luarent,
> > Can you try it again by replacing the geronimo-spec-javamail-XXX.jar
> > with sun's mail jar[1].
> > Please log a JIRA if the things are not working well even after
> > replacing them.
> >
> > Thanks,
> > ~Thilina
> >
> > [1] http://java.sun.com/products/javamail/downloads/index.html
> >
> >
> > On 5/30/06, *Sanjiva Weerawarana* <sanjiva@opensource.lk
> > <ma...@opensource.lk>> wrote:
> >
> >     On Tue, 2006-05-30 at 10:38 +0600, Thilina Gunarathne wrote:
> >     > Adding [Axis2]prefix..
> >     > Moving the conversation over to Axis2-dev list...Please post your
> >     > replies to dev list..
> >     >
> >     > Hi Laurent and devs,
> >     > Currently [1],[2] are the intended behavior. Do you have a use
> case
> >     > which makes it mandatory to send the base64 as an attachment,
> >     without
> >     > embedding in the SOAP message...
> >     >
> >     > I'm not sure whether we need to support the [3].
> >
> >     Ignoring Content-Transfer-Encoding is a bug .. we can refuse to
> >     process
> >     certain CTEs, but we cannot ignore it. Is this a JavaMail bug or a
> >     problem in our code?? (I agree JavaMail should be doing the work!)
> >
> >     Sanjiva.
> >     >
> >
> >
> >
> ---------------------------------------------------------------------
> >     To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> >     <ma...@ws.apache.org>
> >     For additional commands, e-mail: axis-dev-help@ws.apache.org
> >     <ma...@ws.apache.org>
> >
> >
> >
> >
> > --
> > "May the SourcE be with u"
> > http://webservices.apache.org/~thilina/
> > <http://webservices.apache.org/%7Ethilina/>
> > http://thilinag.blogspot.com/
> > http://www.bloglines.com/blog/Thilina
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>


-- 
"May the SourcE be with u"
http://webservices.apache.org/~thilina/
http://thilinag.blogspot.com/
http://www.bloglines.com/blog/Thilina

Re: [Axis2] Fwd: SOAP With Attachments - MIME Part Content Transfer Encoding

Posted by Laurent CELLA <la...@inexbee.com>.
Hi Thilina.

I was reluctant at the beginning to use SUN javamail API cause there 
were already geronimo-spec-javamail given with AXIS 2 libs and the sun 
mailcap seemed to me "a bit too complex" compared to geronimo mailcap.
But I downloaded and installed java mail 1.4, and modified a bit my code 
to fit the new content handlers and the result is :

It  implicitly decodes Base64 and quoted printable stream ( the 
contentHandler I retrieve at server side becomes an InputFilterStream in 
those 2 cases ) in Attachments ( the stream i Retrieve is decoded )

So the replacing you suggested to me solves most of my problems :) Thanks !

Thilina Gunarathne a écrit :
> Hi Luarent,
> Can you try it again by replacing the geronimo-spec-javamail-XXX.jar 
> with sun's mail jar[1].
> Please log a JIRA if the things are not working well even after 
> replacing them.
>  
> Thanks,
> ~Thilina
>  
> [1] http://java.sun.com/products/javamail/downloads/index.html
>
>  
> On 5/30/06, *Sanjiva Weerawarana* <sanjiva@opensource.lk 
> <ma...@opensource.lk>> wrote:
>
>     On Tue, 2006-05-30 at 10:38 +0600, Thilina Gunarathne wrote:
>     > Adding [Axis2]prefix..
>     > Moving the conversation over to Axis2-dev list...Please post your
>     > replies to dev list..
>     >
>     > Hi Laurent and devs,
>     > Currently [1],[2] are the intended behavior. Do you have a use case
>     > which makes it mandatory to send the base64 as an attachment,
>     without
>     > embedding in the SOAP message...
>     >
>     > I'm not sure whether we need to support the [3].
>
>     Ignoring Content-Transfer-Encoding is a bug .. we can refuse to
>     process
>     certain CTEs, but we cannot ignore it. Is this a JavaMail bug or a
>     problem in our code?? (I agree JavaMail should be doing the work!)
>
>     Sanjiva.
>     >
>
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
>     <ma...@ws.apache.org>
>     For additional commands, e-mail: axis-dev-help@ws.apache.org
>     <ma...@ws.apache.org>
>
>
>
>
> -- 
> "May the SourcE be with u"            
> http://webservices.apache.org/~thilina/ 
> <http://webservices.apache.org/%7Ethilina/>
> http://thilinag.blogspot.com/                 
> http://www.bloglines.com/blog/Thilina               



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: [Axis2] Fwd: SOAP With Attachments - MIME Part Content Transfer Encoding

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
On Tue, 2006-05-30 at 22:20 +0600, Thilina Gunarathne wrote:
> Hi Luarent,
> Can you try it again by replacing the geronimo-spec-javamail-XXX.jar
> with sun's mail jar[1].
> Please log a JIRA if the things are not working well even after
> replacing them.

And if it is working after replacing them please log a JIRA with
Geronimo :).

Sanjiva.



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: [Axis2] Fwd: SOAP With Attachments - MIME Part Content Transfer Encoding

Posted by Thilina Gunarathne <cs...@gmail.com>.
Hi Luarent,
Can you try it again by replacing the geronimo-spec-javamail-XXX.jar with
sun's mail jar[1].
Please log a JIRA if the things are not working well even after replacing
them.

Thanks,
~Thilina

[1] http://java.sun.com/products/javamail/downloads/index.html


On 5/30/06, Sanjiva Weerawarana <sa...@opensource.lk> wrote:
>
> On Tue, 2006-05-30 at 10:38 +0600, Thilina Gunarathne wrote:
> > Adding [Axis2]prefix..
> > Moving the conversation over to Axis2-dev list...Please post your
> > replies to dev list..
> >
> > Hi Laurent and devs,
> > Currently [1],[2] are the intended behavior. Do you have a use case
> > which makes it mandatory to send the base64 as an attachment, without
> > embedding in the SOAP message...
> >
> > I'm not sure whether we need to support the [3].
>
> Ignoring Content-Transfer-Encoding is a bug .. we can refuse to process
> certain CTEs, but we cannot ignore it. Is this a JavaMail bug or a
> problem in our code?? (I agree JavaMail should be doing the work!)
>
> Sanjiva.
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>


-- 
"May the SourcE be with u"
http://webservices.apache.org/~thilina/
http://thilinag.blogspot.com/
http://www.bloglines.com/blog/Thilina

Re: [Axis2] Fwd: SOAP With Attachments - MIME Part Content Transfer Encoding

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
On Tue, 2006-05-30 at 10:38 +0600, Thilina Gunarathne wrote:
> Adding [Axis2]prefix..
> Moving the conversation over to Axis2-dev list...Please post your
> replies to dev list..
>  
> Hi Laurent and devs,
> Currently [1],[2] are the intended behavior. Do you have a use case
> which makes it mandatory to send the base64 as an attachment, without
> embedding in the SOAP message...
>  
> I'm not sure whether we need to support the [3].

Ignoring Content-Transfer-Encoding is a bug .. we can refuse to process
certain CTEs, but we cannot ignore it. Is this a JavaMail bug or a
problem in our code?? (I agree JavaMail should be doing the work!)

Sanjiva.
>         


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[Axis2] Fwd: SOAP With Attachments - MIME Part Content Transfer Encoding

Posted by Thilina Gunarathne <cs...@gmail.com>.
Adding [Axis2]prefix..
 Moving the conversation over to Axis2-dev list...Please post your replies
to dev list..

Hi Laurent and devs,
 Currently [1],[2] are the intended behavior. Do you have a use case which
makes it mandatory to send the base64 as an attachment, without embedding in
the SOAP message...

I'm not sure whether we need to support the [3].

On the other hand we use java mail to parse the contents inside the mime
part(Contents after ripping off the boundaries). IMHO java mail should parse
it if the encoding is intended to be decoded...

Thoughts????

~Thilina

On 5/29/06, Laurent CELLA <la...@inexbee.com> wrote:
>
> Hi dear Axis Users.
>
> I am developing a Service with SOAP with attachments ( axis 2 rel 1.0 )
> I dont use MTOM so I prefer retrieve the attachments content by their
> dataHandlers with the technic showed in the example
> http://ws.apache.org/axis2/1_0/mtom-guide.html
>
> I have some questions about the way Axis Handles the Parts it receives,
> especially when "Content Transfer Encoding" is set as a Part Header and
> not using MTOM.
>
> 1.
>
> For instance, if I submit a attachment at client side base64 encoded,
> and specifying "Content-Transfer-Encoding = base64" in the Header, the
> result is not automatically decoded at server side, I must call
> Base64.decode( ... ) explicitely ).
>
> Is it a normal behaviour ? Can we configure the service so it will
> decode on its own ?
>
2.
>
> I have noticed the same thing with encoding "quoted-printable" in an
> attachment : looks like it is up to me to do the decode Work.
> Is it a normal behaviour ? Or I miss something ?
>
> 3.
> Encoding of the SOAP part of request.
> The SOAP enveloppe is the first MimePart itself.
>
> Here is an example wich uses "quoted-printable" encoding for the SOAP
> Body.
>
> ------=_Part_1_20639876.1146648323575
> Content-Type: application/xop+xml; charset=utf-8
> Content-Transfer-Encoding: quoted-printable
> Content-ID: </doc-access-soap/process-request>
>
> <?xml version=3D" 1.0" encoding=3D"utf-8"?>
> <soapenv:Envelope xmlns:soapenv=3D"
> http://schemas.xmlsoap.org/soap/envelope=
> /">
> <soapenv:Body xmlns:types=3D" http://www.inexbee.com/m2doc/m2doc">
> <processRequest xmlns=3D"http://www.inexbee.com/m2doc/m2doc"
>     mailProcessRequest=3D"=
> true">
> ( ... )
> </processRequest>
> </soapenv:Body></soapenv:Envelope>
>
> Such a request cause Axis Exceptions such this one ( release 0.95 ) :
> It seems the AXIS Api tries to parse XML prior to apply
> "quoted-printable" decoding. Is it a good interpretation ?
>
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
> xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope "><soapenv:Header
>
> /><soapenv:Body><soapenv:Fault><soapenv:Code><soapenv:Value>soapenv:Sender</soapenv:Value></soapenv:Code><soapenv:Reason><soapenv:Text
> xml:lang="en-US">Unexpected character '3' (code 51); expected a quote
> character enclosing value for 'version'
> at [row,col {unknown-source}]: [1,15]; nested exception is:
>       com.ctc.wstx.exc.WstxUnexpectedCharException : Unexpected
> character '3' (code 51); expected a quote character enclosing value for
> 'version'
> at [row,col {unknown-source}]:
> [1,15]</soapenv:Text></soapenv:Reason><soapenv:Detail><Exception
> xmlns="">org.apache.axis2.AxisFault: Unexpected character '3' (code 51);
> expected a quote character enclosing value for 'version'
> at [row,col {unknown-source}]: [1,15]; nested exception is:
>        com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected
> character '3' (code 51); expected a quote character enclosing value for
> 'version'
> at [row,col {unknown-source}]: [1,15]
>       at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
> HTTPTransportUtils.java:297)
>       at
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:160)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>       at javax.servlet.http.HttpServlet.service (HttpServlet.java:802)
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:252)
>       at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java :173)
>       at
> org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:213)
>       at
> org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:178)
>       at
> org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java
> :126)
>       at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
> :105)
>       at
> org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:107)
>       at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
> :148)
>       at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>       at
>
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(
> Http11BaseProtocol.java:664)
>       at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
> PoolTcpEndpoint.java:527)
>       at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
> LeaderFollowerWorkerThread.java :80)
>       at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:684)
>       at java.lang.Thread.run(Thread.java:595)
> Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected
> character '3' (code 51); expected a quote character enclosing value for
> 'version'
> at [row,col {unknown-source}]: [1,15]
>       at
> com.ctc.wstx.io.InputBootstrapper.reportUnexpectedChar(
> InputBootstrapper.java :430)
>       at
> com.ctc.wstx.io.InputBootstrapper.handleEq(InputBootstrapper.java:344)
>       at
> com.ctc.wstx.io.InputBootstrapper.readXmlVersion(InputBootstrapper.java
> :243)
>       at
> com.ctc.wstx.io.InputBootstrapper.readXmlDecl (InputBootstrapper.java:205)
>       at
> com.ctc.wstx.io.ReaderBootstrapper.bootstrapInput(ReaderBootstrapper.java
> :139)
>       at
> com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:503)
>       at
> com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:558)
>
> ***
>
> Laurent CELLA
> Inexbee Software
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>

Re: SOAP With Attachments - MIME Part Content Transfer Encoding

Posted by Thilina Gunarathne <cs...@gmail.com>.
Moving the conversation over to Axis2-dev list...Please post your replies to
dev list..

Hi Laurent and devs,
 Currently [1],[2] are the intended behavior. Do you have a use case which
makes it mandatory to send the base64 as an attachment, without embedding in
the SOAP message...

I'm not sure whether we need to support the [3].

On the other hand we use java mail to parse the contents inside the mime
part(Contents after ripping off the boundaries). IMHO java mail should parse
it if the encoding is intended to be decoded...

Thoughts????

~Thilina

On 5/29/06, Laurent CELLA <la...@inexbee.com> wrote:
>
> Hi dear Axis Users.
>
> I am developing a Service with SOAP with attachments ( axis 2 rel 1.0 )
> I dont use MTOM so I prefer retrieve the attachments content by their
> dataHandlers with the technic showed in the example
> http://ws.apache.org/axis2/1_0/mtom-guide.html
>
> I have some questions about the way Axis Handles the Parts it receives,
> especially when "Content Transfer Encoding" is set as a Part Header and
> not using MTOM.
>
> 1.
>
> For instance, if I submit a attachment at client side base64 encoded,
> and specifying "Content-Transfer-Encoding = base64" in the Header, the
> result is not automatically decoded at server side, I must call
> Base64.decode( ... ) explicitely ).
>
> Is it a normal behaviour ? Can we configure the service so it will
> decode on its own ?
>
2.
>
> I have noticed the same thing with encoding "quoted-printable" in an
> attachment : looks like it is up to me to do the decode Work.
> Is it a normal behaviour ? Or I miss something ?
>
> 3.
> Encoding of the SOAP part of request.
> The SOAP enveloppe is the first MimePart itself.
>
> Here is an example wich uses "quoted-printable" encoding for the SOAP
> Body.
>
> ------=_Part_1_20639876.1146648323575
> Content-Type: application/xop+xml; charset=utf-8
> Content-Transfer-Encoding: quoted-printable
> Content-ID: </doc-access-soap/process-request>
>
> <?xml version=3D"1.0" encoding=3D"utf-8"?>
> <soapenv:Envelope xmlns:soapenv=3D"
> http://schemas.xmlsoap.org/soap/envelope=
> /">
> <soapenv:Body xmlns:types=3D"http://www.inexbee.com/m2doc/m2doc">
> <processRequest xmlns=3D"http://www.inexbee.com/m2doc/m2doc"
>     mailProcessRequest=3D"=
> true">
> ( ... )
> </processRequest>
> </soapenv:Body></soapenv:Envelope>
>
> Such a request cause Axis Exceptions such this one ( release 0.95 ) :
> It seems the AXIS Api tries to parse XML prior to apply
> "quoted-printable" decoding. Is it a good interpretation ?
>
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
> xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Header
>
> /><soapenv:Body><soapenv:Fault><soapenv:Code><soapenv:Value>soapenv:Sender</soapenv:Value></soapenv:Code><soapenv:Reason><soapenv:Text
> xml:lang="en-US">Unexpected character '3' (code 51); expected a quote
> character enclosing value for 'version'
> at [row,col {unknown-source}]: [1,15]; nested exception is:
>       com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected
> character '3' (code 51); expected a quote character enclosing value for
> 'version'
> at [row,col {unknown-source}]:
> [1,15]</soapenv:Text></soapenv:Reason><soapenv:Detail><Exception
> xmlns="">org.apache.axis2.AxisFault: Unexpected character '3' (code 51);
> expected a quote character enclosing value for 'version'
> at [row,col {unknown-source}]: [1,15]; nested exception is:
>       com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected
> character '3' (code 51); expected a quote character enclosing value for
> 'version'
> at [row,col {unknown-source}]: [1,15]
>       at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
> HTTPTransportUtils.java:297)
>       at
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:160)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:252)
>       at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:173)
>       at
> org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:213)
>       at
> org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:178)
>       at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
> :126)
>       at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
> :105)
>       at
> org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:107)
>       at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
> :148)
>       at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>       at
>
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
> (Http11BaseProtocol.java:664)
>       at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
> PoolTcpEndpoint.java:527)
>       at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
> LeaderFollowerWorkerThread.java:80)
>       at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:684)
>       at java.lang.Thread.run(Thread.java:595)
> Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected
> character '3' (code 51); expected a quote character enclosing value for
> 'version'
> at [row,col {unknown-source}]: [1,15]
>       at
> com.ctc.wstx.io.InputBootstrapper.reportUnexpectedChar(
> InputBootstrapper.java:430)
>       at
> com.ctc.wstx.io.InputBootstrapper.handleEq(InputBootstrapper.java:344)
>       at
> com.ctc.wstx.io.InputBootstrapper.readXmlVersion(InputBootstrapper.java
> :243)
>       at
> com.ctc.wstx.io.InputBootstrapper.readXmlDecl(InputBootstrapper.java:205)
>       at
> com.ctc.wstx.io.ReaderBootstrapper.bootstrapInput(ReaderBootstrapper.java
> :139)
>       at
> com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:503)
>       at
> com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:558)
>
> ***
>
> Laurent CELLA
> Inexbee Software
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
"May the SourcE be with u"
http://webservices.apache.org/~thilina/
http://thilinag.blogspot.com/
http://www.bloglines.com/blog/Thilina

Re: SOAP With Attachments - MIME Part Content Transfer Encoding

Posted by Thilina Gunarathne <cs...@gmail.com>.
Moving the conversation over to Axis2-dev list...Please post your replies to
dev list..

Hi Laurent and devs,
 Currently [1],[2] are the intended behavior. Do you have a use case which
makes it mandatory to send the base64 as an attachment, without embedding in
the SOAP message...

I'm not sure whether we need to support the [3].

On the other hand we use java mail to parse the contents inside the mime
part(Contents after ripping off the boundaries). IMHO java mail should parse
it if the encoding is intended to be decoded...

Thoughts????

~Thilina

On 5/29/06, Laurent CELLA <la...@inexbee.com> wrote:
>
> Hi dear Axis Users.
>
> I am developing a Service with SOAP with attachments ( axis 2 rel 1.0 )
> I dont use MTOM so I prefer retrieve the attachments content by their
> dataHandlers with the technic showed in the example
> http://ws.apache.org/axis2/1_0/mtom-guide.html
>
> I have some questions about the way Axis Handles the Parts it receives,
> especially when "Content Transfer Encoding" is set as a Part Header and
> not using MTOM.
>
> 1.
>
> For instance, if I submit a attachment at client side base64 encoded,
> and specifying "Content-Transfer-Encoding = base64" in the Header, the
> result is not automatically decoded at server side, I must call
> Base64.decode( ... ) explicitely ).
>
> Is it a normal behaviour ? Can we configure the service so it will
> decode on its own ?
>
2.
>
> I have noticed the same thing with encoding "quoted-printable" in an
> attachment : looks like it is up to me to do the decode Work.
> Is it a normal behaviour ? Or I miss something ?
>
> 3.
> Encoding of the SOAP part of request.
> The SOAP enveloppe is the first MimePart itself.
>
> Here is an example wich uses "quoted-printable" encoding for the SOAP
> Body.
>
> ------=_Part_1_20639876.1146648323575
> Content-Type: application/xop+xml; charset=utf-8
> Content-Transfer-Encoding: quoted-printable
> Content-ID: </doc-access-soap/process-request>
>
> <?xml version=3D"1.0" encoding=3D"utf-8"?>
> <soapenv:Envelope xmlns:soapenv=3D"
> http://schemas.xmlsoap.org/soap/envelope=
> /">
> <soapenv:Body xmlns:types=3D"http://www.inexbee.com/m2doc/m2doc">
> <processRequest xmlns=3D"http://www.inexbee.com/m2doc/m2doc"
>     mailProcessRequest=3D"=
> true">
> ( ... )
> </processRequest>
> </soapenv:Body></soapenv:Envelope>
>
> Such a request cause Axis Exceptions such this one ( release 0.95 ) :
> It seems the AXIS Api tries to parse XML prior to apply
> "quoted-printable" decoding. Is it a good interpretation ?
>
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
> xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Header
>
> /><soapenv:Body><soapenv:Fault><soapenv:Code><soapenv:Value>soapenv:Sender</soapenv:Value></soapenv:Code><soapenv:Reason><soapenv:Text
> xml:lang="en-US">Unexpected character '3' (code 51); expected a quote
> character enclosing value for 'version'
> at [row,col {unknown-source}]: [1,15]; nested exception is:
>       com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected
> character '3' (code 51); expected a quote character enclosing value for
> 'version'
> at [row,col {unknown-source}]:
> [1,15]</soapenv:Text></soapenv:Reason><soapenv:Detail><Exception
> xmlns="">org.apache.axis2.AxisFault: Unexpected character '3' (code 51);
> expected a quote character enclosing value for 'version'
> at [row,col {unknown-source}]: [1,15]; nested exception is:
>       com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected
> character '3' (code 51); expected a quote character enclosing value for
> 'version'
> at [row,col {unknown-source}]: [1,15]
>       at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
> HTTPTransportUtils.java:297)
>       at
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:160)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:252)
>       at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:173)
>       at
> org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:213)
>       at
> org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:178)
>       at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
> :126)
>       at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
> :105)
>       at
> org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:107)
>       at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
> :148)
>       at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>       at
>
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
> (Http11BaseProtocol.java:664)
>       at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
> PoolTcpEndpoint.java:527)
>       at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
> LeaderFollowerWorkerThread.java:80)
>       at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:684)
>       at java.lang.Thread.run(Thread.java:595)
> Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected
> character '3' (code 51); expected a quote character enclosing value for
> 'version'
> at [row,col {unknown-source}]: [1,15]
>       at
> com.ctc.wstx.io.InputBootstrapper.reportUnexpectedChar(
> InputBootstrapper.java:430)
>       at
> com.ctc.wstx.io.InputBootstrapper.handleEq(InputBootstrapper.java:344)
>       at
> com.ctc.wstx.io.InputBootstrapper.readXmlVersion(InputBootstrapper.java
> :243)
>       at
> com.ctc.wstx.io.InputBootstrapper.readXmlDecl(InputBootstrapper.java:205)
>       at
> com.ctc.wstx.io.ReaderBootstrapper.bootstrapInput(ReaderBootstrapper.java
> :139)
>       at
> com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:503)
>       at
> com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:558)
>
> ***
>
> Laurent CELLA
> Inexbee Software
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
"May the SourcE be with u"
http://webservices.apache.org/~thilina/
http://thilinag.blogspot.com/
http://www.bloglines.com/blog/Thilina