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 sam wang <sa...@yahoo.com> on 2006/09/29 04:38:38 UTC

about Axis2's binary attachment

Hi, there,

I have a question about transferring binary attachment through Axis2. I want to transfer binary
attachment from server side to client side. My question is that if I can attach any kind of binary
data? from Axis2's api, I see there are only two datasource: file and image. theoritically, Axis2
can transfer any kind of object because we can first serialize any object to disk, save it as a
file, and then construct file datasource to attach into soap as binary attachment. but it will not
be efficient. so my question is that if there is a way to attach the object (for example,
CachedRowSet) to soap directly and return to client, instead of saving as file first. if it can,
could anyone give me a java snippet?

thank you very much!
Sam

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: about Axis2's binary attachment

Posted by sam wang <sa...@yahoo.com>.
thanks, Robert! it works for me. I am using RedHat Linux. and my mouse has middle scroll button.
the way working for me is to always use middle scroll button. that is, first, choosing content,
second clicking middle scroll button, then getting into a text editor and clicking middle scroll
button again to past the text.

thanks again,
Sam



--- robert lazarski <ro...@gmail.com> wrote:

> In linux you can double click in the pane and then use - the mouse
> middle scroll button / three button mouse middle button / click left
> and right button at same time - in another window such as a text
> editor to capture the message.
> 
> Not sure how that works on other platforms. Not sure how to do a
> classic ctrl-c ctrl-v in an applet either.
> 
> Robert
> 
> On 10/3/06, sam wang <sa...@yahoo.com> wrote:
> > thanks, Robert. in fact, I have already configed SOAPMonitor to capture soap message. the
> problem
> > is that I can't select and copy/paste the soap message as text file. and I don't know if there
> is
> > a way to save the soap message into file.
> >
> > thanks,
> > Sam
> >
> >
> >
> > --- robert lazarski <ro...@gmail.com> wrote:
> >
> > > You can try the soap monitor which will also allow you to capture the
> > > request / repsonse:
> > >
> > >
> http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/xdocs/1_1/soapmonitor-module.html
> > >
> > > Robert
> > >
> > > On 10/3/06, sam wang <sa...@yahoo.com> wrote:
> > > > thank you very much, Thilina. I tried to use TCPMon to capture network traffic but failed.
> I
> > > don't
> > > > know why, I just download TCPMon 1.0 and unzip it, then run the sh file, I can't capture
> > > anything
> > > > after I config it according to the tutorial. I don't know why there needs two ports. it
> seems
> > > only
> > > > the target port is enough. anyway, I tried for one and half hour and finally gave up.
> please
> > > check
> > > > the soap request screenshot at the attachment (ScreenShotRequest.png). sorry for the
> > > inconvenient.
> > > >
> > > > along the screenshot, I also paste three files you want, WDKWS is the server side
> > > implementation
> > > > with some simplicity. WDKWSClient.java is client invokation code which produces a LOT of
> debug
> > > > information redirected to the txt file wdkwsclient.output.
> > > >
> > > > thanks again,
> > > > Sam
> > > >
> > > >
> > > > --- Thilina Gunarathne <cs...@gmail.com> wrote:
> > > >
> > > > > Hi,
> > > > > Please post your server implementation class...
> > > > >
> > > > > > since I can't copy and paste the soap message from SOAPMonitor, I save the soap
> >message
> > > as
> > > > > > screenshot pictures. please refer them to the attachment. the followings are my
> > > >questions:
> > > > >
> > > > > You can use the http://ws.apache.org/commons/tcpmon/ to capture the
> > > > > messages.. Please post your request as well...
> > > > >
> > > > > > 3. whenever there is a stream parsing, there will be a LOT of debug output. I use
> Eclipse
> > > > > >3.2, but
> > > > > > I don't think those are debug info like outputting to log4j, it seems those are
> standard
> > > > > >output.
> > > > >
> > > > > Please post these messages too...
> > > > >
> > > > > Thilina
> > > > >
> > > > > --
> > > > > http://webservices.apache.org/~thilina/
> > > > > http://thilinag.blogspot.com/
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > > >
> > > > >
> > > >
> > > > __________________________________________________
> > > > Do You Yahoo!?
> > > > Tired of spam?  Yahoo! Mail has the best spam protection around
> > > > http://mail.yahoo.com
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > >
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: about Axis2's binary attachment

Posted by robert lazarski <ro...@gmail.com>.
In linux you can double click in the pane and then use - the mouse
middle scroll button / three button mouse middle button / click left
and right button at same time - in another window such as a text
editor to capture the message.

Not sure how that works on other platforms. Not sure how to do a
classic ctrl-c ctrl-v in an applet either.

Robert

On 10/3/06, sam wang <sa...@yahoo.com> wrote:
> thanks, Robert. in fact, I have already configed SOAPMonitor to capture soap message. the problem
> is that I can't select and copy/paste the soap message as text file. and I don't know if there is
> a way to save the soap message into file.
>
> thanks,
> Sam
>
>
>
> --- robert lazarski <ro...@gmail.com> wrote:
>
> > You can try the soap monitor which will also allow you to capture the
> > request / repsonse:
> >
> > http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/xdocs/1_1/soapmonitor-module.html
> >
> > Robert
> >
> > On 10/3/06, sam wang <sa...@yahoo.com> wrote:
> > > thank you very much, Thilina. I tried to use TCPMon to capture network traffic but failed. I
> > don't
> > > know why, I just download TCPMon 1.0 and unzip it, then run the sh file, I can't capture
> > anything
> > > after I config it according to the tutorial. I don't know why there needs two ports. it seems
> > only
> > > the target port is enough. anyway, I tried for one and half hour and finally gave up. please
> > check
> > > the soap request screenshot at the attachment (ScreenShotRequest.png). sorry for the
> > inconvenient.
> > >
> > > along the screenshot, I also paste three files you want, WDKWS is the server side
> > implementation
> > > with some simplicity. WDKWSClient.java is client invokation code which produces a LOT of debug
> > > information redirected to the txt file wdkwsclient.output.
> > >
> > > thanks again,
> > > Sam
> > >
> > >
> > > --- Thilina Gunarathne <cs...@gmail.com> wrote:
> > >
> > > > Hi,
> > > > Please post your server implementation class...
> > > >
> > > > > since I can't copy and paste the soap message from SOAPMonitor, I save the soap >message
> > as
> > > > > screenshot pictures. please refer them to the attachment. the followings are my
> > >questions:
> > > >
> > > > You can use the http://ws.apache.org/commons/tcpmon/ to capture the
> > > > messages.. Please post your request as well...
> > > >
> > > > > 3. whenever there is a stream parsing, there will be a LOT of debug output. I use Eclipse
> > > > >3.2, but
> > > > > I don't think those are debug info like outputting to log4j, it seems those are standard
> > > > >output.
> > > >
> > > > Please post these messages too...
> > > >
> > > > Thilina
> > > >
> > > > --
> > > > http://webservices.apache.org/~thilina/
> > > > http://thilinag.blogspot.com/
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > >
> > > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam protection around
> > > http://mail.yahoo.com
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

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


Re: about Axis2's binary attachment

Posted by sam wang <sa...@yahoo.com>.
thanks, Robert. in fact, I have already configed SOAPMonitor to capture soap message. the problem
is that I can't select and copy/paste the soap message as text file. and I don't know if there is
a way to save the soap message into file.

thanks,
Sam



--- robert lazarski <ro...@gmail.com> wrote:

> You can try the soap monitor which will also allow you to capture the
> request / repsonse:
> 
> http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/xdocs/1_1/soapmonitor-module.html
> 
> Robert
> 
> On 10/3/06, sam wang <sa...@yahoo.com> wrote:
> > thank you very much, Thilina. I tried to use TCPMon to capture network traffic but failed. I
> don't
> > know why, I just download TCPMon 1.0 and unzip it, then run the sh file, I can't capture
> anything
> > after I config it according to the tutorial. I don't know why there needs two ports. it seems
> only
> > the target port is enough. anyway, I tried for one and half hour and finally gave up. please
> check
> > the soap request screenshot at the attachment (ScreenShotRequest.png). sorry for the
> inconvenient.
> >
> > along the screenshot, I also paste three files you want, WDKWS is the server side
> implementation
> > with some simplicity. WDKWSClient.java is client invokation code which produces a LOT of debug
> > information redirected to the txt file wdkwsclient.output.
> >
> > thanks again,
> > Sam
> >
> >
> > --- Thilina Gunarathne <cs...@gmail.com> wrote:
> >
> > > Hi,
> > > Please post your server implementation class...
> > >
> > > > since I can't copy and paste the soap message from SOAPMonitor, I save the soap >message
> as
> > > > screenshot pictures. please refer them to the attachment. the followings are my
> >questions:
> > >
> > > You can use the http://ws.apache.org/commons/tcpmon/ to capture the
> > > messages.. Please post your request as well...
> > >
> > > > 3. whenever there is a stream parsing, there will be a LOT of debug output. I use Eclipse
> > > >3.2, but
> > > > I don't think those are debug info like outputting to log4j, it seems those are standard
> > > >output.
> > >
> > > Please post these messages too...
> > >
> > > Thilina
> > >
> > > --
> > > http://webservices.apache.org/~thilina/
> > > http://thilinag.blogspot.com/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: about Axis2's binary attachment

Posted by robert lazarski <ro...@gmail.com>.
You can try the soap monitor which will also allow you to capture the
request / repsonse:

http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/xdocs/1_1/soapmonitor-module.html

Robert

On 10/3/06, sam wang <sa...@yahoo.com> wrote:
> thank you very much, Thilina. I tried to use TCPMon to capture network traffic but failed. I don't
> know why, I just download TCPMon 1.0 and unzip it, then run the sh file, I can't capture anything
> after I config it according to the tutorial. I don't know why there needs two ports. it seems only
> the target port is enough. anyway, I tried for one and half hour and finally gave up. please check
> the soap request screenshot at the attachment (ScreenShotRequest.png). sorry for the inconvenient.
>
> along the screenshot, I also paste three files you want, WDKWS is the server side implementation
> with some simplicity. WDKWSClient.java is client invokation code which produces a LOT of debug
> information redirected to the txt file wdkwsclient.output.
>
> thanks again,
> Sam
>
>
> --- Thilina Gunarathne <cs...@gmail.com> wrote:
>
> > Hi,
> > Please post your server implementation class...
> >
> > > since I can't copy and paste the soap message from SOAPMonitor, I save the soap >message as
> > > screenshot pictures. please refer them to the attachment. the followings are my >questions:
> >
> > You can use the http://ws.apache.org/commons/tcpmon/ to capture the
> > messages.. Please post your request as well...
> >
> > > 3. whenever there is a stream parsing, there will be a LOT of debug output. I use Eclipse
> > >3.2, but
> > > I don't think those are debug info like outputting to log4j, it seems those are standard
> > >output.
> >
> > Please post these messages too...
> >
> > Thilina
> >
> > --
> > http://webservices.apache.org/~thilina/
> > http://thilinag.blogspot.com/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>

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


Re: about Axis2's binary attachment

Posted by sam wang <sa...@yahoo.com>.
Hi, guys, 

I just solved this problem :-)  in fact, I didn't do anything except restarting linux. I guess my
tomcat messed up for some reason that I didn't realize at first. until I can't control my mouse, I
restarted the machine and everything is ok now :-)

thanks again for all your great help!
Sam



--- sam wang <sa...@yahoo.com> wrote:

> thanks, Thilina. but I don't think that is client's problem. I found out a way to work around
> finally. that is, specifying the EndpointReference appending with method name! usually the
> EndpointReference is the part till to service name, but I found for binary attachment, we need
> specify EndpointReference with the method name. did anyone meet this problem before? why?
> 
> although I can retrieve the binary data from server which wraps the object through
> ByteArrayDataSource, I can't reconstruct the object at the client side. the error message is:
> 
> java.io.InvalidClassException: com.sun.rowset.internal.CachedRowSetWriter; local class
> incompatible: stream classdesc serialVersionUID = -8506030970299413976, local class
> serialVersionUID = 1032179177453674122[SimpleHTTPServer] Stop called
>  
> 
> I think this error occurs as a result of the class that was serialized and deserialized having
> been changed at some point. since I can reconstruct at server side through main method, that is,
> without actually transferring through online. so I guess maybe there is something changed during
> transferring? for example, preparing transfer or receiving binary data at client side? since I
> can't manually change SUID because it's an Oracle class, could anyone please help me to fix it?
> 
> thanks!
> Sam
> 
> 
> 
> 
> 
> --- Thilina Gunarathne <cs...@gmail.com> wrote:
> 
> > Sam,
> > I still feel that it's a client side problem. For me it seems like the
> > server receives a 500 error  while  trying to send the response in a
> > different channel(Since you are using non blocking invocation) ...
> > 
> > Try debugging your client at the pointer given by me..
> > You can also try doing this with blocking invocation to see the outcome...
> > 
> > ~Thilina
> > 
> > On 10/3/06, sam wang <sa...@yahoo.com> wrote:
> > > thanks, Thilina. but the debug output is from client side, which is caused by server side
> > problem.
> > > you can check the detailed information from SOAP message returned from server side which I
> > have
> > > attached as screenshot pictures in my previous email. the reason why I show you the debug
> > > information is that I want to know if there is a way to disable those debug output in the
> > client
> > > side.
> > >
> > > thanks,
> > > Sam
> > >
> > >
> > > --- Thilina Gunarathne <cs...@gmail.com> wrote:
> > >
> > > > Please note the following in your debug output...
> > > >       at wuBlast.WDKWSClient.queryBinaryAsynchronize(WDKWSClient.java:295)
> > > >       at wuBlast.WDKWSClient.main(WDKWSClient.java:605)
> > > >
> > > > Please look for this in your original client code....
> > > >
> > > > ~Thilina
> > > >
> > > > On 10/3/06, sam wang <sa...@yahoo.com> wrote:
> > > > > thank you very much, Thilina. I tried to use TCPMon to capture network traffic but
> failed.
> > I
> > > > don't
> > > > > know why, I just download TCPMon 1.0 and unzip it, then run the sh file, I can't capture
> > > > anything
> > > > > after I config it according to the tutorial. I don't know why there needs two ports. it
> > seems
> > > > only
> > > > > the target port is enough. anyway, I tried for one and half hour and finally gave up.
> > please
> > > > check
> > > > > the soap request screenshot at the attachment (ScreenShotRequest.png). sorry for the
> > > > inconvenient.
> > > > >
> > > > > along the screenshot, I also paste three files you want, WDKWS is the server side
> > > > implementation
> > > > > with some simplicity. WDKWSClient.java is client invokation code which produces a LOT of
> > debug
> > > > > information redirected to the txt file wdkwsclient.output.
> > > > >
> > > > > thanks again,
> > > > > Sam
> > > > >
> > > > >
> > > > > --- Thilina Gunarathne <cs...@gmail.com> wrote:
> > > > >
> > > > > > Hi,
> > > > > > Please post your server implementation class...
> > > > > >
> > > > > > > since I can't copy and paste the soap message from SOAPMonitor, I save the soap
> > >message
> > > > as
> > > > > > > screenshot pictures. please refer them to the attachment. the followings are my
> > > > >questions:
> > > > > >
> > > > > > You can use the http://ws.apache.org/commons/tcpmon/ to capture the
> > > > > > messages.. Please post your request as well...
> > > > > >
> > > > > > > 3. whenever there is a stream parsing, there will be a LOT of debug output. I use
> > Eclipse
> > > > > > >3.2, but
> > > > > > > I don't think those are debug info like outputting to log4j, it seems those are
> > standard
> > > > > > >output.
> > > > > >
> > > > > > Please post these messages too...
> > > > > >
> > > > > > Thilina
> > > > > >
> > > > > > --
> > > > > > http://webservices.apache.org/~thilina/
> > > > > > http://thilinag.blogspot.com/
> > > > > >
> > > > > > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > > > >
> > > > > >
> > > > >
> > > > > __________________________________________________
> > > > > Do You Yahoo!?
> > > > > Tired of spam?  Yahoo! Mail has the best spam protection around
> > > > > http://mail.yahoo.com
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > http://webservices.apache.org/~thilina/
> > > > http://thilinag.blogspot.com/
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > >
> > > >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam protection around
> > > http://mail.yahoo.com
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> > 
> > 
> > -- 
> > http://webservices.apache.org/~thilina/
> > http://thilinag.blogspot.com/
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: about Axis2's binary attachment

Posted by sam wang <sa...@yahoo.com>.
thanks, Thilina. but I don't think that is client's problem. I found out a way to work around
finally. that is, specifying the EndpointReference appending with method name! usually the
EndpointReference is the part till to service name, but I found for binary attachment, we need
specify EndpointReference with the method name. did anyone meet this problem before? why?

although I can retrieve the binary data from server which wraps the object through
ByteArrayDataSource, I can't reconstruct the object at the client side. the error message is:

java.io.InvalidClassException: com.sun.rowset.internal.CachedRowSetWriter; local class
incompatible: stream classdesc serialVersionUID = -8506030970299413976, local class
serialVersionUID = 1032179177453674122[SimpleHTTPServer] Stop called
 

I think this error occurs as a result of the class that was serialized and deserialized having
been changed at some point. since I can reconstruct at server side through main method, that is,
without actually transferring through online. so I guess maybe there is something changed during
transferring? for example, preparing transfer or receiving binary data at client side? since I
can't manually change SUID because it's an Oracle class, could anyone please help me to fix it?

thanks!
Sam





--- Thilina Gunarathne <cs...@gmail.com> wrote:

> Sam,
> I still feel that it's a client side problem. For me it seems like the
> server receives a 500 error  while  trying to send the response in a
> different channel(Since you are using non blocking invocation) ...
> 
> Try debugging your client at the pointer given by me..
> You can also try doing this with blocking invocation to see the outcome...
> 
> ~Thilina
> 
> On 10/3/06, sam wang <sa...@yahoo.com> wrote:
> > thanks, Thilina. but the debug output is from client side, which is caused by server side
> problem.
> > you can check the detailed information from SOAP message returned from server side which I
> have
> > attached as screenshot pictures in my previous email. the reason why I show you the debug
> > information is that I want to know if there is a way to disable those debug output in the
> client
> > side.
> >
> > thanks,
> > Sam
> >
> >
> > --- Thilina Gunarathne <cs...@gmail.com> wrote:
> >
> > > Please note the following in your debug output...
> > >       at wuBlast.WDKWSClient.queryBinaryAsynchronize(WDKWSClient.java:295)
> > >       at wuBlast.WDKWSClient.main(WDKWSClient.java:605)
> > >
> > > Please look for this in your original client code....
> > >
> > > ~Thilina
> > >
> > > On 10/3/06, sam wang <sa...@yahoo.com> wrote:
> > > > thank you very much, Thilina. I tried to use TCPMon to capture network traffic but failed.
> I
> > > don't
> > > > know why, I just download TCPMon 1.0 and unzip it, then run the sh file, I can't capture
> > > anything
> > > > after I config it according to the tutorial. I don't know why there needs two ports. it
> seems
> > > only
> > > > the target port is enough. anyway, I tried for one and half hour and finally gave up.
> please
> > > check
> > > > the soap request screenshot at the attachment (ScreenShotRequest.png). sorry for the
> > > inconvenient.
> > > >
> > > > along the screenshot, I also paste three files you want, WDKWS is the server side
> > > implementation
> > > > with some simplicity. WDKWSClient.java is client invokation code which produces a LOT of
> debug
> > > > information redirected to the txt file wdkwsclient.output.
> > > >
> > > > thanks again,
> > > > Sam
> > > >
> > > >
> > > > --- Thilina Gunarathne <cs...@gmail.com> wrote:
> > > >
> > > > > Hi,
> > > > > Please post your server implementation class...
> > > > >
> > > > > > since I can't copy and paste the soap message from SOAPMonitor, I save the soap
> >message
> > > as
> > > > > > screenshot pictures. please refer them to the attachment. the followings are my
> > > >questions:
> > > > >
> > > > > You can use the http://ws.apache.org/commons/tcpmon/ to capture the
> > > > > messages.. Please post your request as well...
> > > > >
> > > > > > 3. whenever there is a stream parsing, there will be a LOT of debug output. I use
> Eclipse
> > > > > >3.2, but
> > > > > > I don't think those are debug info like outputting to log4j, it seems those are
> standard
> > > > > >output.
> > > > >
> > > > > Please post these messages too...
> > > > >
> > > > > Thilina
> > > > >
> > > > > --
> > > > > http://webservices.apache.org/~thilina/
> > > > > http://thilinag.blogspot.com/
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > > >
> > > > >
> > > >
> > > > __________________________________________________
> > > > Do You Yahoo!?
> > > > Tired of spam?  Yahoo! Mail has the best spam protection around
> > > > http://mail.yahoo.com
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > http://webservices.apache.org/~thilina/
> > > http://thilinag.blogspot.com/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> 
> 
> -- 
> http://webservices.apache.org/~thilina/
> http://thilinag.blogspot.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: about Axis2's binary attachment

Posted by Thilina Gunarathne <cs...@gmail.com>.
Sam,
I still feel that it's a client side problem. For me it seems like the
server receives a 500 error  while  trying to send the response in a
different channel(Since you are using non blocking invocation) ...

Try debugging your client at the pointer given by me..
You can also try doing this with blocking invocation to see the outcome...

~Thilina

On 10/3/06, sam wang <sa...@yahoo.com> wrote:
> thanks, Thilina. but the debug output is from client side, which is caused by server side problem.
> you can check the detailed information from SOAP message returned from server side which I have
> attached as screenshot pictures in my previous email. the reason why I show you the debug
> information is that I want to know if there is a way to disable those debug output in the client
> side.
>
> thanks,
> Sam
>
>
> --- Thilina Gunarathne <cs...@gmail.com> wrote:
>
> > Please note the following in your debug output...
> >       at wuBlast.WDKWSClient.queryBinaryAsynchronize(WDKWSClient.java:295)
> >       at wuBlast.WDKWSClient.main(WDKWSClient.java:605)
> >
> > Please look for this in your original client code....
> >
> > ~Thilina
> >
> > On 10/3/06, sam wang <sa...@yahoo.com> wrote:
> > > thank you very much, Thilina. I tried to use TCPMon to capture network traffic but failed. I
> > don't
> > > know why, I just download TCPMon 1.0 and unzip it, then run the sh file, I can't capture
> > anything
> > > after I config it according to the tutorial. I don't know why there needs two ports. it seems
> > only
> > > the target port is enough. anyway, I tried for one and half hour and finally gave up. please
> > check
> > > the soap request screenshot at the attachment (ScreenShotRequest.png). sorry for the
> > inconvenient.
> > >
> > > along the screenshot, I also paste three files you want, WDKWS is the server side
> > implementation
> > > with some simplicity. WDKWSClient.java is client invokation code which produces a LOT of debug
> > > information redirected to the txt file wdkwsclient.output.
> > >
> > > thanks again,
> > > Sam
> > >
> > >
> > > --- Thilina Gunarathne <cs...@gmail.com> wrote:
> > >
> > > > Hi,
> > > > Please post your server implementation class...
> > > >
> > > > > since I can't copy and paste the soap message from SOAPMonitor, I save the soap >message
> > as
> > > > > screenshot pictures. please refer them to the attachment. the followings are my
> > >questions:
> > > >
> > > > You can use the http://ws.apache.org/commons/tcpmon/ to capture the
> > > > messages.. Please post your request as well...
> > > >
> > > > > 3. whenever there is a stream parsing, there will be a LOT of debug output. I use Eclipse
> > > > >3.2, but
> > > > > I don't think those are debug info like outputting to log4j, it seems those are standard
> > > > >output.
> > > >
> > > > Please post these messages too...
> > > >
> > > > Thilina
> > > >
> > > > --
> > > > http://webservices.apache.org/~thilina/
> > > > http://thilinag.blogspot.com/
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > >
> > > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam protection around
> > > http://mail.yahoo.com
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> > >
> >
> >
> > --
> > http://webservices.apache.org/~thilina/
> > http://thilinag.blogspot.com/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
http://webservices.apache.org/~thilina/
http://thilinag.blogspot.com/

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


Re: about Axis2's binary attachment

Posted by sam wang <sa...@yahoo.com>.
thanks, Thilina. but the debug output is from client side, which is caused by server side problem.
you can check the detailed information from SOAP message returned from server side which I have
attached as screenshot pictures in my previous email. the reason why I show you the debug
information is that I want to know if there is a way to disable those debug output in the client
side.

thanks,
Sam


--- Thilina Gunarathne <cs...@gmail.com> wrote:

> Please note the following in your debug output...
> 	at wuBlast.WDKWSClient.queryBinaryAsynchronize(WDKWSClient.java:295)
> 	at wuBlast.WDKWSClient.main(WDKWSClient.java:605)
> 
> Please look for this in your original client code....
> 
> ~Thilina
> 
> On 10/3/06, sam wang <sa...@yahoo.com> wrote:
> > thank you very much, Thilina. I tried to use TCPMon to capture network traffic but failed. I
> don't
> > know why, I just download TCPMon 1.0 and unzip it, then run the sh file, I can't capture
> anything
> > after I config it according to the tutorial. I don't know why there needs two ports. it seems
> only
> > the target port is enough. anyway, I tried for one and half hour and finally gave up. please
> check
> > the soap request screenshot at the attachment (ScreenShotRequest.png). sorry for the
> inconvenient.
> >
> > along the screenshot, I also paste three files you want, WDKWS is the server side
> implementation
> > with some simplicity. WDKWSClient.java is client invokation code which produces a LOT of debug
> > information redirected to the txt file wdkwsclient.output.
> >
> > thanks again,
> > Sam
> >
> >
> > --- Thilina Gunarathne <cs...@gmail.com> wrote:
> >
> > > Hi,
> > > Please post your server implementation class...
> > >
> > > > since I can't copy and paste the soap message from SOAPMonitor, I save the soap >message
> as
> > > > screenshot pictures. please refer them to the attachment. the followings are my
> >questions:
> > >
> > > You can use the http://ws.apache.org/commons/tcpmon/ to capture the
> > > messages.. Please post your request as well...
> > >
> > > > 3. whenever there is a stream parsing, there will be a LOT of debug output. I use Eclipse
> > > >3.2, but
> > > > I don't think those are debug info like outputting to log4j, it seems those are standard
> > > >output.
> > >
> > > Please post these messages too...
> > >
> > > Thilina
> > >
> > > --
> > > http://webservices.apache.org/~thilina/
> > > http://thilinag.blogspot.com/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> >
> 
> 
> -- 
> http://webservices.apache.org/~thilina/
> http://thilinag.blogspot.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: about Axis2's binary attachment

Posted by Thilina Gunarathne <cs...@gmail.com>.
Please note the following in your debug output...
	at wuBlast.WDKWSClient.queryBinaryAsynchronize(WDKWSClient.java:295)
	at wuBlast.WDKWSClient.main(WDKWSClient.java:605)

Please look for this in your original client code....

~Thilina

On 10/3/06, sam wang <sa...@yahoo.com> wrote:
> thank you very much, Thilina. I tried to use TCPMon to capture network traffic but failed. I don't
> know why, I just download TCPMon 1.0 and unzip it, then run the sh file, I can't capture anything
> after I config it according to the tutorial. I don't know why there needs two ports. it seems only
> the target port is enough. anyway, I tried for one and half hour and finally gave up. please check
> the soap request screenshot at the attachment (ScreenShotRequest.png). sorry for the inconvenient.
>
> along the screenshot, I also paste three files you want, WDKWS is the server side implementation
> with some simplicity. WDKWSClient.java is client invokation code which produces a LOT of debug
> information redirected to the txt file wdkwsclient.output.
>
> thanks again,
> Sam
>
>
> --- Thilina Gunarathne <cs...@gmail.com> wrote:
>
> > Hi,
> > Please post your server implementation class...
> >
> > > since I can't copy and paste the soap message from SOAPMonitor, I save the soap >message as
> > > screenshot pictures. please refer them to the attachment. the followings are my >questions:
> >
> > You can use the http://ws.apache.org/commons/tcpmon/ to capture the
> > messages.. Please post your request as well...
> >
> > > 3. whenever there is a stream parsing, there will be a LOT of debug output. I use Eclipse
> > >3.2, but
> > > I don't think those are debug info like outputting to log4j, it seems those are standard
> > >output.
> >
> > Please post these messages too...
> >
> > Thilina
> >
> > --
> > http://webservices.apache.org/~thilina/
> > http://thilinag.blogspot.com/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>


-- 
http://webservices.apache.org/~thilina/
http://thilinag.blogspot.com/

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


Re: about Axis2's binary attachment

Posted by sam wang <sa...@yahoo.com>.
thank you very much, Thilina. I tried to use TCPMon to capture network traffic but failed. I don't
know why, I just download TCPMon 1.0 and unzip it, then run the sh file, I can't capture anything
after I config it according to the tutorial. I don't know why there needs two ports. it seems only
the target port is enough. anyway, I tried for one and half hour and finally gave up. please check
the soap request screenshot at the attachment (ScreenShotRequest.png). sorry for the inconvenient.

along the screenshot, I also paste three files you want, WDKWS is the server side implementation
with some simplicity. WDKWSClient.java is client invokation code which produces a LOT of debug
information redirected to the txt file wdkwsclient.output.

thanks again,
Sam


--- Thilina Gunarathne <cs...@gmail.com> wrote:

> Hi,
> Please post your server implementation class...
> 
> > since I can't copy and paste the soap message from SOAPMonitor, I save the soap >message as
> > screenshot pictures. please refer them to the attachment. the followings are my >questions:
> 
> You can use the http://ws.apache.org/commons/tcpmon/ to capture the
> messages.. Please post your request as well...
> 
> > 3. whenever there is a stream parsing, there will be a LOT of debug output. I use Eclipse
> >3.2, but
> > I don't think those are debug info like outputting to log4j, it seems those are standard
> >output.
> 
> Please post these messages too...
> 
> Thilina
> 
> -- 
> http://webservices.apache.org/~thilina/
> http://thilinag.blogspot.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: about Axis2's binary attachment

Posted by Thilina Gunarathne <cs...@gmail.com>.
Hi,
Please post your server implementation class...

> since I can't copy and paste the soap message from SOAPMonitor, I save the soap >message as
> screenshot pictures. please refer them to the attachment. the followings are my >questions:

You can use the http://ws.apache.org/commons/tcpmon/ to capture the
messages.. Please post your request as well...

> 3. whenever there is a stream parsing, there will be a LOT of debug output. I use Eclipse >3.2, but
> I don't think those are debug info like outputting to log4j, it seems those are standard >output.

Please post these messages too...

Thilina

-- 
http://webservices.apache.org/~thilina/
http://thilinag.blogspot.com/

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


Re: about Axis2's binary attachment

Posted by sam wang <sa...@yahoo.com>.
thank you very much for all your guys help about transferring binary data through Axis2. I just
got time to test it today but didn't success. my goal is to serialize CachedRowSet into SOAP from
server side and then deserialize from client side. the following is server side code:

	public static OMElement queryBinaryXML(OMElement sqlElement) {
		String sql = sqlElement.getFirstChildWithName(
				new QName("lime.ctegd.uga.edu", "query")).getText();
		CachedRowSet crs = getCRS(sql);
		
		OMFactory fac = OMAbstractFactory.getOMFactory();
		OMNamespace omNs = fac
				.createOMNamespace("lime.ctegd.uga.edu", "wstest");
		OMElement data = fac.createOMElement("Data", omNs);
		
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		try {
			ObjectOutputStream so = new ObjectOutputStream(baos);
			so.writeObject(crs);
			so.flush();
			so.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		ByteArrayDataSource baDataSource = new ByteArrayDataSource(baos.toByteArray());
		DataHandler expectedDH = new DataHandler(baDataSource);
		OMText textData = fac.createOMText(expectedDH, true);
		data.addChild(textData);
		return data;}

I am quite sure that the CachedRowSet is wrapped into OMElement correctly because I can
reconstruct CachedRowSet from the main method of server side. that is, without the real
transferring online. but when I try to invoke the server online, I got 500 error message. I tried
to modify axis2.xml configuration file, for example, disabling "enableMTOM" or enabling it without
configuring caching  or enabling "enableMTOM" with caching, there is nothing changed about error
messages.

the following error messages are from Tomcat's catalina.out:

- Received Error Message with id null
- Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is
recommended.

since I can't copy and paste the soap message from SOAPMonitor, I save the soap message as
screenshot pictures. please refer them to the attachment. the followings are my questions:

1. what caused the error? what's the meaning of the error? how should I do to fix it?
2. why I can see the detailed error messages through SOAPMonitor but not through Tomcat's log
files? does there need some log config about axis2? how?
3. whenever there is a stream parsing, there will be a LOT of debug output. I use Eclipse 3.2, but
I don't think those are debug info like outputting to log4j, it seems those are standard output.
my question is that can I disable it? how? 

the following is debug output sample:

61293 [DEBUG]
org.apache.axis2.transport.http.server.SimpleHttpServer.destroy(SimpleHttpServer.java:142) -
Stopping test HTTP server on port 6060
61294 [DEBUG] org.apache.axis2.transport.jms.JMSSender.closeAllConnectors(JMSSender.java:69) -
Enter: JMSTransport::closeAllConnectors 



thank you very much!
Sam








--- Davanum Srinivas <da...@gmail.com> wrote:

> org.apache.axiom.attachments.ByteArrayDataSource
> 
> On 9/29/06, Paul Fremantle <pz...@gmail.com> wrote:
> > I did this by creating my own DataSource object too. Maybe if there is
> > a ByteArrayDataSource I didn't need to! On the other hand, coding a DS
> > of your own would help if you had a really big data set.... because
> > you might be able to avoid holding it all in memory at once.
> >
> >
> > public class MyDataSource implements javax.activation.DataSource {
> >
> >                 public String getContentType() {
> >                         return "image/jpeg";
> >                 }
> >
> >                 public InputStream getInputStream() throws IOException {
> >                         ByteArrayInputStream bais = new ByteArrayInputStream(data);
> >                         return bais;
> >                 }
> >
> >                 public String getName() {
> >                         return "test.jpg";
> >                 }
> >
> >                 public OutputStream getOutputStream() throws IOException {
> >                         throw new UnsupportedOperationException();
> >
> >                 }
> >         }
> >
> >
> >
> >
> > On 9/29/06, Betsy Frey <BF...@serena.com> wrote:
> > > One does not have to use an ImageDataSource or FileDataSource.  You can code your own
> DataSource, implementing javax.activation.DataSource.
> > >
> > > When receiving MTOM data, one gets a DataHandler from the OMText element, and one can get
> the input stream from that:
> > >
> > >   OMText data = (OMText) child.getFirstOMChild();
> > >   DataHandler dh = (DataHandler) data.getDataHandler();
> > >   InputStream istream = dh.getDataSource().getInputStream();
> > >
> > > An intermediate file may still be created.  This is because, when transferring binary data
> using MTOM, there is the issue that a very large amount of data could cause an OutOfMemoryError,
> without storing it on disk as it is being received.  One controls this by these configuration
> settings:
> > >
> > >   <parameter name="cacheAttachments" locked="false">true</parameter>
> > >   <parameter name="attachmentDIR" locked="false">temp directory</parameter>
> > >   <parameter name="sizeThreshold" locked="false">4000</parameter>
> > >
> > > Betsy
> > > ________________________________________
> > > From: scott ken [mailto:scttken@gmail.com]
> > > Sent: Thursday, September 28, 2006 7:53 PM
> > > To: axis-user@ws.apache.org
> > > Subject: Re: about Axis2's binary attachment
> > >
> > > Usually we will have an InputStream object. But I didn't make it work. I tried using a byte
> array as input.
> > > you can easily convert an InputStream to a byte array. After that, use ByteArrayDataSource.
> > >
> > >  // Build OMText to hold binary data
> > >  byte[] binaryBytes = ...;
> > >  ByteArrayDataSource dataSource = new ByteArrayDataSource(binaryBytes );
> > >  DataHandler expectedDH = new DataHandler(dataSource);
> > >  OMText textData = omFactory.createOMText(expectedDH, true);
> > >
> > > On 9/28/06, sam wang <sa...@yahoo.com> wrote:
> > > Hi, there,
> > >
> > > I have a question about transferring binary attachment through Axis2. I want to transfer
> binary
> > > attachment from server side to client side. My question is that if I can attach any kind of
> binary
> > > data? from Axis2's api, I see there are only two datasource: file and image. theoritically,
> Axis2
> > > can transfer any kind of object because we can first serialize any object to disk, save it
> as a
> > > file, and then construct file datasource to attach into soap as binary attachment. but it
> will not
> > > be efficient. so my question is that if there is a way to attach the object (for example,
> > > CachedRowSet) to soap directly and return to client, instead of saving as file first. if it
> can,
> > > could anyone give me a java snippet?
> > >
> > > thank you very much!
> > > Sam
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?Yahoo! Mail has the best spam protection around
> > > http://mail.yahoo.com
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> > >
> > > **********************************************************************
> > > This email and any files transmitted with it are confidential and
> > > intended solely for the use of the individual or entity to whom they
> > > are addressed. Any unauthorized review, use, disclosure or distribution is prohibited. If
> you are not the intended recipient, please contact the sender by reply e-mail and destroy all
> copies of the original message.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> >
> > --
> > Paul Fremantle
> > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> >
> > http://bloglines.com/blog/paulfremantle
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> 
> 
> -- 
> Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: about Axis2's binary attachment

Posted by Davanum Srinivas <da...@gmail.com>.
org.apache.axiom.attachments.ByteArrayDataSource

On 9/29/06, Paul Fremantle <pz...@gmail.com> wrote:
> I did this by creating my own DataSource object too. Maybe if there is
> a ByteArrayDataSource I didn't need to! On the other hand, coding a DS
> of your own would help if you had a really big data set.... because
> you might be able to avoid holding it all in memory at once.
>
>
> public class MyDataSource implements javax.activation.DataSource {
>
>                 public String getContentType() {
>                         return "image/jpeg";
>                 }
>
>                 public InputStream getInputStream() throws IOException {
>                         ByteArrayInputStream bais = new ByteArrayInputStream(data);
>                         return bais;
>                 }
>
>                 public String getName() {
>                         return "test.jpg";
>                 }
>
>                 public OutputStream getOutputStream() throws IOException {
>                         throw new UnsupportedOperationException();
>
>                 }
>         }
>
>
>
>
> On 9/29/06, Betsy Frey <BF...@serena.com> wrote:
> > One does not have to use an ImageDataSource or FileDataSource.  You can code your own DataSource, implementing javax.activation.DataSource.
> >
> > When receiving MTOM data, one gets a DataHandler from the OMText element, and one can get the input stream from that:
> >
> >   OMText data = (OMText) child.getFirstOMChild();
> >   DataHandler dh = (DataHandler) data.getDataHandler();
> >   InputStream istream = dh.getDataSource().getInputStream();
> >
> > An intermediate file may still be created.  This is because, when transferring binary data using MTOM, there is the issue that a very large amount of data could cause an OutOfMemoryError, without storing it on disk as it is being received.  One controls this by these configuration settings:
> >
> >   <parameter name="cacheAttachments" locked="false">true</parameter>
> >   <parameter name="attachmentDIR" locked="false">temp directory</parameter>
> >   <parameter name="sizeThreshold" locked="false">4000</parameter>
> >
> > Betsy
> > ________________________________________
> > From: scott ken [mailto:scttken@gmail.com]
> > Sent: Thursday, September 28, 2006 7:53 PM
> > To: axis-user@ws.apache.org
> > Subject: Re: about Axis2's binary attachment
> >
> > Usually we will have an InputStream object. But I didn't make it work. I tried using a byte array as input.
> > you can easily convert an InputStream to a byte array. After that, use ByteArrayDataSource.
> >
> >  // Build OMText to hold binary data
> >  byte[] binaryBytes = ...;
> >  ByteArrayDataSource dataSource = new ByteArrayDataSource(binaryBytes );
> >  DataHandler expectedDH = new DataHandler(dataSource);
> >  OMText textData = omFactory.createOMText(expectedDH, true);
> >
> > On 9/28/06, sam wang <sa...@yahoo.com> wrote:
> > Hi, there,
> >
> > I have a question about transferring binary attachment through Axis2. I want to transfer binary
> > attachment from server side to client side. My question is that if I can attach any kind of binary
> > data? from Axis2's api, I see there are only two datasource: file and image. theoritically, Axis2
> > can transfer any kind of object because we can first serialize any object to disk, save it as a
> > file, and then construct file datasource to attach into soap as binary attachment. but it will not
> > be efficient. so my question is that if there is a way to attach the object (for example,
> > CachedRowSet) to soap directly and return to client, instead of saving as file first. if it can,
> > could anyone give me a java snippet?
> >
> > thank you very much!
> > Sam
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> >
> > **********************************************************************
> > This email and any files transmitted with it are confidential and
> > intended solely for the use of the individual or entity to whom they
> > are addressed. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>
> --
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>
> http://bloglines.com/blog/paulfremantle
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)

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


Re: about Axis2's binary attachment

Posted by Paul Fremantle <pz...@gmail.com>.
I did this by creating my own DataSource object too. Maybe if there is
a ByteArrayDataSource I didn't need to! On the other hand, coding a DS
of your own would help if you had a really big data set.... because
you might be able to avoid holding it all in memory at once.


public class MyDataSource implements javax.activation.DataSource {

		public String getContentType() {
			return "image/jpeg";
		}

		public InputStream getInputStream() throws IOException {
			ByteArrayInputStream bais = new ByteArrayInputStream(data);
			return bais;
		}

		public String getName() {
			return "test.jpg";
		}

		public OutputStream getOutputStream() throws IOException {
			throw new UnsupportedOperationException();
			
		}
	}




On 9/29/06, Betsy Frey <BF...@serena.com> wrote:
> One does not have to use an ImageDataSource or FileDataSource.  You can code your own DataSource, implementing javax.activation.DataSource.
>
> When receiving MTOM data, one gets a DataHandler from the OMText element, and one can get the input stream from that:
>
>   OMText data = (OMText) child.getFirstOMChild();
>   DataHandler dh = (DataHandler) data.getDataHandler();
>   InputStream istream = dh.getDataSource().getInputStream();
>
> An intermediate file may still be created.  This is because, when transferring binary data using MTOM, there is the issue that a very large amount of data could cause an OutOfMemoryError, without storing it on disk as it is being received.  One controls this by these configuration settings:
>
>   <parameter name="cacheAttachments" locked="false">true</parameter>
>   <parameter name="attachmentDIR" locked="false">temp directory</parameter>
>   <parameter name="sizeThreshold" locked="false">4000</parameter>
>
> Betsy
> ________________________________________
> From: scott ken [mailto:scttken@gmail.com]
> Sent: Thursday, September 28, 2006 7:53 PM
> To: axis-user@ws.apache.org
> Subject: Re: about Axis2's binary attachment
>
> Usually we will have an InputStream object. But I didn't make it work. I tried using a byte array as input.
> you can easily convert an InputStream to a byte array. After that, use ByteArrayDataSource.
>
>  // Build OMText to hold binary data
>  byte[] binaryBytes = ...;
>  ByteArrayDataSource dataSource = new ByteArrayDataSource(binaryBytes );
>  DataHandler expectedDH = new DataHandler(dataSource);
>  OMText textData = omFactory.createOMText(expectedDH, true);
>
> On 9/28/06, sam wang <sa...@yahoo.com> wrote:
> Hi, there,
>
> I have a question about transferring binary attachment through Axis2. I want to transfer binary
> attachment from server side to client side. My question is that if I can attach any kind of binary
> data? from Axis2's api, I see there are only two datasource: file and image. theoritically, Axis2
> can transfer any kind of object because we can first serialize any object to disk, save it as a
> file, and then construct file datasource to attach into soap as binary attachment. but it will not
> be efficient. so my question is that if there is a way to attach the object (for example,
> CachedRowSet) to soap directly and return to client, instead of saving as file first. if it can,
> could anyone give me a java snippet?
>
> thank you very much!
> Sam
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

http://bloglines.com/blog/paulfremantle
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

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


RE: about Axis2's binary attachment

Posted by Betsy Frey <BF...@SERENA.com>.
One does not have to use an ImageDataSource or FileDataSource.  You can code your own DataSource, implementing javax.activation.DataSource.  

When receiving MTOM data, one gets a DataHandler from the OMText element, and one can get the input stream from that:

  OMText data = (OMText) child.getFirstOMChild();
  DataHandler dh = (DataHandler) data.getDataHandler();
  InputStream istream = dh.getDataSource().getInputStream();

An intermediate file may still be created.  This is because, when transferring binary data using MTOM, there is the issue that a very large amount of data could cause an OutOfMemoryError, without storing it on disk as it is being received.  One controls this by these configuration settings:

  <parameter name="cacheAttachments" locked="false">true</parameter>
  <parameter name="attachmentDIR" locked="false">temp directory</parameter>
  <parameter name="sizeThreshold" locked="false">4000</parameter>

Betsy
________________________________________
From: scott ken [mailto:scttken@gmail.com] 
Sent: Thursday, September 28, 2006 7:53 PM
To: axis-user@ws.apache.org
Subject: Re: about Axis2's binary attachment

Usually we will have an InputStream object. But I didn't make it work. I tried using a byte array as input. 
you can easily convert an InputStream to a byte array. After that, use ByteArrayDataSource.

                // Build OMText to hold binary data 
                byte[] binaryBytes = ...;
                ByteArrayDataSource dataSource = new ByteArrayDataSource(binaryBytes );
                DataHandler expectedDH = new DataHandler(dataSource);
                OMText textData = omFactory.createOMText(expectedDH, true);

On 9/28/06, sam wang <sa...@yahoo.com> wrote:
Hi, there,

I have a question about transferring binary attachment through Axis2. I want to transfer binary
attachment from server side to client side. My question is that if I can attach any kind of binary
data? from Axis2's api, I see there are only two datasource: file and image. theoritically, Axis2 
can transfer any kind of object because we can first serialize any object to disk, save it as a
file, and then construct file datasource to attach into soap as binary attachment. but it will not
be efficient. so my question is that if there is a way to attach the object (for example, 
CachedRowSet) to soap directly and return to client, instead of saving as file first. if it can,
could anyone give me a java snippet?

thank you very much!
Sam

__________________________________________________ 
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.


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


Re: about Axis2's binary attachment

Posted by scott ken <sc...@gmail.com>.
Usually we will have an InputStream object. But I didn't make it work. I
tried using a byte array as input.
you can easily convert an InputStream to a byte array. After that, use
ByteArrayDataSource.

                // Build OMText to hold binary data
                byte[] binaryBytes = ...;
                ByteArrayDataSource dataSource = new
ByteArrayDataSource(binaryBytes );
                DataHandler expectedDH = new DataHandler(dataSource);
                OMText textData = omFactory.createOMText(expectedDH, true);


On 9/28/06, sam wang <sa...@yahoo.com> wrote:
>
> Hi, there,
>
> I have a question about transferring binary attachment through Axis2. I
> want to transfer binary
> attachment from server side to client side. My question is that if I can
> attach any kind of binary
> data? from Axis2's api, I see there are only two datasource: file and
> image. theoritically, Axis2
> can transfer any kind of object because we can first serialize any object
> to disk, save it as a
> file, and then construct file datasource to attach into soap as binary
> attachment. but it will not
> be efficient. so my question is that if there is a way to attach the
> object (for example,
> CachedRowSet) to soap directly and return to client, instead of saving as
> file first. if it can,
> could anyone give me a java snippet?
>
> thank you very much!
> Sam
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>