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 ti...@adinet.com.uy on 2004/02/15 00:41:39 UTC

accesing data

Hi,

I am implementing a service with SOAP RPC (with application scope), and
I would like to know how can I access a text file from it. I have read from
the list, that there is a way to do that putting the data in the deploymenent
descriptor, and then accessing it with SOAPContext, but I need the data
in the constructor of the service. How could I do that? I had though in
an environment variable too, but it's not portable, and Java don't allow
to read them.

Thanks very much,

Tizo


Re: file transfer

Posted by Scott Nichol <sn...@scottnichol.com>.
You can use SwA for file transfer.  The HTTP payload containing the file being sent is serialized into memory.  A file sender must have sufficient memory to do this.  The receiving code will read the entire HTTP payload into memory, and JavaMail may create an additional copy of the attachment, so the file receiver needs enough memory to hold 2 copies of the attachment.

As you can see, Apache SOAP is not a good option for transferring large files.  Axis, on the other hand, does not make all of these in-memory copies, so it would be a better alternative if you want to use SOAP for file transfers.

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: "Bassem HAIDAR" <ha...@yahoo.fr>
To: <so...@ws.apache.org>
Sent: Tuesday, February 17, 2004 12:08 PM
Subject: file transfer


hello
can i use soap with attachement for file transfer, and
does any maximium file size for the attachment?

thank you 

=====







Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout ! 
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/


file transfer

Posted by Bassem HAIDAR <ha...@yahoo.fr>.
hello
can i use soap with attachement for file transfer, and
does any maximium file size for the attachment?

thank you 

=====



	

	
		
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout ! 
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Re: Asunto: Re: accesing data

Posted by Scott Nichol <sn...@scottnichol.com>.
The current code has a "configure" sample with the following deployment descriptor:

<isd:service id="urn:configure-sample">
 <isd:provider type="java" scope="Application" methods="getConfigureParameters">
  <isd:java class="samples.configure.ConfigureService"/>
  <isd:option key="option1" value="you can configure your service"/>
  <isd:option key="option2" value="through your deployment descriptor"/>
 </isd:provider>
 <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>
</isd:service>

The "option" tags are the information contained in one of the Hashtables passed to the configure method.  You would do, for example,

  <isd:option key="filename" value="/usr/local/etc/myservice/myservice.txt"/>

Then have a configure method like
 
  public void configure(Hashtable serviceParameters,
                        Hashtable servletParameters,
                        Hashtable contextParameters) throws Exception {
    String filename = contextParameters.get("filename");
    // open/read/close
  }

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: <ti...@adinet.com.uy>
To: <so...@ws.apache.org>
Sent: Tuesday, February 17, 2004 11:24 AM
Subject: Asunto: Re: accesing data


Scott,

Your summary is right. I need to access the name of the text file from the
constructor, or, alternatively, the data itself.

So, as you say, I could do that implementing the ConfigurableService interface.
But, how can I put the name of the file (or the data itself) in the deployment
descriptor? or do I have to put it in another place?

Thanks very much,

Tizo


>-- Mensaje original --
>Reply-To: soap-user@ws.apache.org
>From: "Scott Nichol" <sn...@scottnichol.com>
>To: <so...@ws.apache.org>
>Subject: Re: accesing data
>Date: Tue, 17 Feb 2004 10:41:40 -0500
>
>
>My summary: you want to access a text file from the constructor for your
>service class, and you are wondering how you can put the name of the file
>in configuration data the can be accessed from the constructor.  Is that
>right?
>
>Nothing is provided in the Apache SOAP framework to help you do exactly
what
>I have stated above.  In all versions, you would have the alternative of
>having an initialization method called from each of your methods, i.e.
lazy
>initialization.  Your methods would each have the SOAPContext parameter
for
>you to access the deployment descriptor or servlet initialization information.
>
>Added to the current code after the 2.3.1 release, your service class can
>also implement the ConfigurableService interface.  The configure method
on
>this interface is called once per instance of the service, immediately
after
>the constructor.  This method receives webapp, servlet and deployment descriptor
>initialization values in Hashtables.  With post-2.3.1 code, this is the
preferred
>method for initializing services.
>
>Scott Nichol
>
>Do not send e-mail directly to this e-mail address,
>because it is filtered to accept only mail from
>specific mail lists.
>----- Original Message ----- 
>From: <ti...@adinet.com.uy>
>To: <so...@ws.apache.org>
>Sent: Saturday, February 14, 2004 6:41 PM
>Subject: accesing data
>
>
>Hi,
>
>I am implementing a service with SOAP RPC (with application scope), and
>I would like to know how can I access a text file from it. I have read
from
>the list, that there is a way to do that putting the data in the deploymenent
>descriptor, and then accessing it with SOAPContext, but I need the data
>in the constructor of the service. How could I do that? I had though in
>an environment variable too, but it's not portable, and Java don't allow
>to read them.
>
>Thanks very much,
>
>Tizo
>
>

Asunto: Re: accesing data

Posted by ti...@adinet.com.uy.
Scott,

Your summary is right. I need to access the name of the text file from the
constructor, or, alternatively, the data itself.

So, as you say, I could do that implementing the ConfigurableService interface.
But, how can I put the name of the file (or the data itself) in the deployment
descriptor? or do I have to put it in another place?

Thanks very much,

Tizo


>-- Mensaje original --
>Reply-To: soap-user@ws.apache.org
>From: "Scott Nichol" <sn...@scottnichol.com>
>To: <so...@ws.apache.org>
>Subject: Re: accesing data
>Date: Tue, 17 Feb 2004 10:41:40 -0500
>
>
>My summary: you want to access a text file from the constructor for your
>service class, and you are wondering how you can put the name of the file
>in configuration data the can be accessed from the constructor.  Is that
>right?
>
>Nothing is provided in the Apache SOAP framework to help you do exactly
what
>I have stated above.  In all versions, you would have the alternative of
>having an initialization method called from each of your methods, i.e.
lazy
>initialization.  Your methods would each have the SOAPContext parameter
for
>you to access the deployment descriptor or servlet initialization information.
>
>Added to the current code after the 2.3.1 release, your service class can
>also implement the ConfigurableService interface.  The configure method
on
>this interface is called once per instance of the service, immediately
after
>the constructor.  This method receives webapp, servlet and deployment descriptor
>initialization values in Hashtables.  With post-2.3.1 code, this is the
preferred
>method for initializing services.
>
>Scott Nichol
>
>Do not send e-mail directly to this e-mail address,
>because it is filtered to accept only mail from
>specific mail lists.
>----- Original Message ----- 
>From: <ti...@adinet.com.uy>
>To: <so...@ws.apache.org>
>Sent: Saturday, February 14, 2004 6:41 PM
>Subject: accesing data
>
>
>Hi,
>
>I am implementing a service with SOAP RPC (with application scope), and
>I would like to know how can I access a text file from it. I have read
from
>the list, that there is a way to do that putting the data in the deploymenent
>descriptor, and then accessing it with SOAPContext, but I need the data
>in the constructor of the service. How could I do that? I had though in
>an environment variable too, but it's not portable, and Java don't allow
>to read them.
>
>Thanks very much,
>
>Tizo
>
>



Re: accesing data

Posted by Scott Nichol <sn...@scottnichol.com>.
My summary: you want to access a text file from the constructor for your service class, and you are wondering how you can put the name of the file in configuration data the can be accessed from the constructor.  Is that right?

Nothing is provided in the Apache SOAP framework to help you do exactly what I have stated above.  In all versions, you would have the alternative of having an initialization method called from each of your methods, i.e. lazy initialization.  Your methods would each have the SOAPContext parameter for you to access the deployment descriptor or servlet initialization information.

Added to the current code after the 2.3.1 release, your service class can also implement the ConfigurableService interface.  The configure method on this interface is called once per instance of the service, immediately after the constructor.  This method receives webapp, servlet and deployment descriptor initialization values in Hashtables.  With post-2.3.1 code, this is the preferred method for initializing services.

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: <ti...@adinet.com.uy>
To: <so...@ws.apache.org>
Sent: Saturday, February 14, 2004 6:41 PM
Subject: accesing data


Hi,

I am implementing a service with SOAP RPC (with application scope), and
I would like to know how can I access a text file from it. I have read from
the list, that there is a way to do that putting the data in the deploymenent
descriptor, and then accessing it with SOAPContext, but I need the data
in the constructor of the service. How could I do that? I had though in
an environment variable too, but it's not portable, and Java don't allow
to read them.

Thanks very much,

Tizo