You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Brian Shields <br...@geminga.nuigalway.ie> on 2002/09/09 16:03:14 UTC

passing files with soap.

I want to pass a file thru soap. I am aware that you can attach a file but i dont want to do that yet, i would like to pass it as a parameter in the call object. Is using an input stream the best way to do this ?

Thanks,
Brian.

Re: passing files with soap.

Posted by Scott Nichol <sn...@scottnichol.com>.
Brian,

I am sorry about the previous message.  I was not aware that there is a
serializer mapping for InputStream already built into Apache SOAP.

An InputStream parameter will be serialized using the MimePartSerializer,
i.e. it will be serialized as an attachment.  However, since it is a
parameter, there will be a parameter serialized that references the
attachment, and when the message is deserialized, a parameter of type
javax.activation.DataHandler will be deserialized.

This means that you might have a service method that has a signature like

    boolean putFile(String fileName, DataHandler dh)

that you could call with parameters of type String and InputStream.

I hope this helps.

Scott Nichol

----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>; "Brian Shields"
<br...@geminga.nuigalway.ie>
Sent: Monday, September 09, 2002 10:15 AM
Subject: Re: passing files with soap.


Brian,

You would have to write quite a bit of code to be able to do this.  First,
you have to have something to serialize and de-serialize the input stream.
Second, whatever you de-serialize to must somehow work remotely.  If the
file is already accessible remotely, such as through a URL, I would just
pass the URL and let the remote side open the URL.

You can, of course, pass the file contents as a byte array parameter.  That
is what I did in the gzip sample that was committed last week.

Scott Nichol

----- Original Message -----
From: "Brian Shields" <br...@geminga.nuigalway.ie>
To: <so...@xml.apache.org>
Sent: Monday, September 09, 2002 10:03 AM
Subject: passing files with soap.


I want to pass a file thru soap. I am aware that you can attach a file but i
dont want to do that yet, i would like to pass it as a parameter in the call
object. Is using an input stream the best way to do this ?

Thanks,
Brian.



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>




--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: passing files with soap.

Posted by Scott Nichol <sn...@scottnichol.com>.
Brian,

I am sorry about the previous message.  I was not aware that there is a
serializer mapping for InputStream already built into Apache SOAP.

An InputStream parameter will be serialized using the MimePartSerializer,
i.e. it will be serialized as an attachment.  However, since it is a
parameter, there will be a parameter serialized that references the
attachment, and when the message is deserialized, a parameter of type
javax.activation.DataHandler will be deserialized.

This means that you might have a service method that has a signature like

    boolean putFile(String fileName, DataHandler dh)

that you could call with parameters of type String and InputStream.

I hope this helps.

Scott Nichol

----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>; "Brian Shields"
<br...@geminga.nuigalway.ie>
Sent: Monday, September 09, 2002 10:15 AM
Subject: Re: passing files with soap.


Brian,

You would have to write quite a bit of code to be able to do this.  First,
you have to have something to serialize and de-serialize the input stream.
Second, whatever you de-serialize to must somehow work remotely.  If the
file is already accessible remotely, such as through a URL, I would just
pass the URL and let the remote side open the URL.

You can, of course, pass the file contents as a byte array parameter.  That
is what I did in the gzip sample that was committed last week.

Scott Nichol

----- Original Message -----
From: "Brian Shields" <br...@geminga.nuigalway.ie>
To: <so...@xml.apache.org>
Sent: Monday, September 09, 2002 10:03 AM
Subject: passing files with soap.


I want to pass a file thru soap. I am aware that you can attach a file but i
dont want to do that yet, i would like to pass it as a parameter in the call
object. Is using an input stream the best way to do this ?

Thanks,
Brian.



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>




Re: passing files with soap.

Posted by Scott Nichol <sn...@scottnichol.com>.
Brian,

You would have to write quite a bit of code to be able to do this.  First,
you have to have something to serialize and de-serialize the input stream.
Second, whatever you de-serialize to must somehow work remotely.  If the
file is already accessible remotely, such as through a URL, I would just
pass the URL and let the remote side open the URL.

You can, of course, pass the file contents as a byte array parameter.  That
is what I did in the gzip sample that was committed last week.

Scott Nichol

----- Original Message -----
From: "Brian Shields" <br...@geminga.nuigalway.ie>
To: <so...@xml.apache.org>
Sent: Monday, September 09, 2002 10:03 AM
Subject: passing files with soap.


I want to pass a file thru soap. I am aware that you can attach a file but i
dont want to do that yet, i would like to pass it as a parameter in the call
object. Is using an input stream the best way to do this ?

Thanks,
Brian.



Re: passing files with soap.

Posted by Scott Nichol <sn...@scottnichol.com>.
Brian,

You would have to write quite a bit of code to be able to do this.  First,
you have to have something to serialize and de-serialize the input stream.
Second, whatever you de-serialize to must somehow work remotely.  If the
file is already accessible remotely, such as through a URL, I would just
pass the URL and let the remote side open the URL.

You can, of course, pass the file contents as a byte array parameter.  That
is what I did in the gzip sample that was committed last week.

Scott Nichol

----- Original Message -----
From: "Brian Shields" <br...@geminga.nuigalway.ie>
To: <so...@xml.apache.org>
Sent: Monday, September 09, 2002 10:03 AM
Subject: passing files with soap.


I want to pass a file thru soap. I am aware that you can attach a file but i
dont want to do that yet, i would like to pass it as a parameter in the call
object. Is using an input stream the best way to do this ?

Thanks,
Brian.



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>