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 eb...@arcor.de on 2006/05/18 11:27:50 UTC

Path from the webapp

Hi,

I use Axis 1.4.

In the axis web app I have a directory 'update'.
In my service implementation I want to read the files in the directory.
String directory = ...;
File file = new File(directory);

The first problem is how I can get the string directory dynamically from the
xxxServiceBindingImplementation. I have no servlet context there.
I need the directory in the form like d://tomcat/webapps/update.

Another problem:
Can I get the url from the xxxServiceBindingImplementation for instance:
http://localhost:8080/myapp?

Can anybody help me?

Thanks!

Regards,
Ralph


Re: Schema validation

Posted by Dies Koper <di...@jp.fujitsu.com>.
Hello Ken,

Axis does not have the functionality to validate the SOAP message.
You should look for a third-party tool (hopefully others in the group 
have suggestions) to do that or write one yourself.

Good luck,
Dies

Ken Tam wrote:
> Hi all,
> 
> I am consuming web services made available from my customer. I was given a
> very elaborate WSDL with schemas and I was able to generate the stubs by
> using Axis's WSDL2Java. Everything was working fine until the service was
> changed on the customer's end. This causes the deserialization step to fail
> as the SOAP response does not match the schema. The customer in this case is
> a big company and they don't tend to respond in a timely manner. However,
> the problem persists which I must fix. I am using Axis 1.3 and it doesn't
> seem to validate the SOAP response with the WSDL's schema. How do I
> configure Axis to do so? Currently, I had to spend quite a bit of time to
> track down the mismatches. I figure if the schema is used to validate, it
> should point out the mismatches right off to spare me the time to track them
> down.
> 
> Thanks,
> Ken


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


RE: Schema validation

Posted by Ken Tam <ke...@proteustech.com>.
Hi Anne and Martin,

Thank you both for your responses. I already tried to obtain the latest WSDL
but it wasn't available. I'll try the handler method.

Ken
  -----Original Message-----
  From: Anne Thomas Manes [mailto:atmanes@gmail.com]
  Sent: Monday, May 22, 2006 5:26 AM
  To: axis-user@ws.apache.org
  Subject: Re: Schema validation


  Ken,

  I agree with Martin -- your service provider should supply you with a new
WSDL. Have you tried just doing a GET on the service URL appended with
"?wsdl"?.

  In the meantime, you can use a handler to validate the message. Java
provides native support for validation in the javax.xml.validation package.

  Anne


  On 5/22/06, Martin Gainty <mg...@hotmail.com> wrote:
    Good Morning Ken

    Who(m)ever is supplying the WSDL to you is responsible for specifying
request and response for all methods along with specifying
    parameters to those methods.
    Who(m)ever is changing the schema needs to re-gen and re-publish the
WSDL

    A situation arose where my webservice is now returning a String
parameter so I have re-published and regen'ed the WSDL to reflect the
response string

    <wsdl:message name="NameOfMethodResponse">
          <wsdl:part name="NameOfMethodReturn" type="xsd:string" />
        </wsdl:message>

    Does this answer your question?
    Martin --
    *********************************************************************
    This email message and any files transmitted with it contain
confidential
    information intended only for the person(s) to whom this email message
is
    addressed.  If you have received this email message in error, please
notify
    the sender immediately by telephone or email and destroy the original
    message without making a copy.  Thank you.



    ----- Original Message -----
    From: "Ken Tam" < kentam@proteustech.com>
    To: <ax...@ws.apache.org>
    Sent: Sunday, May 21, 2006 9:18 PM
    Subject: Schema validation


    > Hi all,
    >
    > I am consuming web services made available from my customer. I was
given a
    > very elaborate WSDL with schemas and I was able to generate the stubs
by
    > using Axis's WSDL2Java. Everything was working fine until the service
was
    > changed on the customer's end. This causes the deserialization step to
fail
    > as the SOAP response does not match the schema. The customer in this
case is
    > a big company and they don't tend to respond in a timely manner.
However,
    > the problem persists which I must fix. I am using Axis 1.3 and it
doesn't
    > seem to validate the SOAP response with the WSDL's schema. How do I
    > configure Axis to do so? Currently, I had to spend quite a bit of time
to
    > track down the mismatches. I figure if the schema is used to validate,
it
    > should point out the mismatches right off to spare me the time to
track them
    > down.
    >
    > Thanks,
    > Ken
    >
    >
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
    > For additional commands, e-mail: axis-user-help@ws.apache.org
    >
    >


Re: Schema validation

Posted by Anne Thomas Manes <at...@gmail.com>.
Ken,

I agree with Martin -- your service provider should supply you with a new
WSDL. Have you tried just doing a GET on the service URL appended with
"?wsdl"?.

In the meantime, you can use a handler to validate the message. Java
provides native support for validation in the javax.xml.validation package.

Anne

On 5/22/06, Martin Gainty <mg...@hotmail.com> wrote:
>
> Good Morning Ken
>
> Who(m)ever is supplying the WSDL to you is responsible for specifying
> request and response for all methods along with specifying
> parameters to those methods.
> Who(m)ever is changing the schema needs to re-gen and re-publish the WSDL
>
> A situation arose where my webservice is now returning a String parameter
> so I have re-published and regen'ed the WSDL to reflect the response string
>
> <wsdl:message name="NameOfMethodResponse">
>       <wsdl:part name="NameOfMethodReturn" type="xsd:string" />
>     </wsdl:message>
>
> Does this answer your question?
> Martin --
> *********************************************************************
> This email message and any files transmitted with it contain confidential
> information intended only for the person(s) to whom this email message is
> addressed.  If you have received this email message in error, please
> notify
> the sender immediately by telephone or email and destroy the original
> message without making a copy.  Thank you.
>
>
>
> ----- Original Message -----
> From: "Ken Tam" <ke...@proteustech.com>
> To: <ax...@ws.apache.org>
> Sent: Sunday, May 21, 2006 9:18 PM
> Subject: Schema validation
>
>
> > Hi all,
> >
> > I am consuming web services made available from my customer. I was given
> a
> > very elaborate WSDL with schemas and I was able to generate the stubs by
> > using Axis's WSDL2Java. Everything was working fine until the service
> was
> > changed on the customer's end. This causes the deserialization step to
> fail
> > as the SOAP response does not match the schema. The customer in this
> case is
> > a big company and they don't tend to respond in a timely manner.
> However,
> > the problem persists which I must fix. I am using Axis 1.3 and it
> doesn't
> > seem to validate the SOAP response with the WSDL's schema. How do I
> > configure Axis to do so? Currently, I had to spend quite a bit of time
> to
> > track down the mismatches. I figure if the schema is used to validate,
> it
> > should point out the mismatches right off to spare me the time to track
> them
> > down.
> >
> > Thanks,
> > Ken
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >

Re: Schema validation

Posted by Martin Gainty <mg...@hotmail.com>.
Good Morning Ken

Who(m)ever is supplying the WSDL to you is responsible for specifying request and response for all methods along with specifying 
parameters to those methods.
Who(m)ever is changing the schema needs to re-gen and re-publish the WSDL 

A situation arose where my webservice is now returning a String parameter so I have re-published and regen'ed the WSDL to reflect the response string

<wsdl:message name="NameOfMethodResponse">
      <wsdl:part name="NameOfMethodReturn" type="xsd:string" /> 
    </wsdl:message>

Does this answer your question?
Martin --
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



----- Original Message ----- 
From: "Ken Tam" <ke...@proteustech.com>
To: <ax...@ws.apache.org>
Sent: Sunday, May 21, 2006 9:18 PM
Subject: Schema validation


> Hi all,
> 
> I am consuming web services made available from my customer. I was given a
> very elaborate WSDL with schemas and I was able to generate the stubs by
> using Axis's WSDL2Java. Everything was working fine until the service was
> changed on the customer's end. This causes the deserialization step to fail
> as the SOAP response does not match the schema. The customer in this case is
> a big company and they don't tend to respond in a timely manner. However,
> the problem persists which I must fix. I am using Axis 1.3 and it doesn't
> seem to validate the SOAP response with the WSDL's schema. How do I
> configure Axis to do so? Currently, I had to spend quite a bit of time to
> track down the mismatches. I figure if the schema is used to validate, it
> should point out the mismatches right off to spare me the time to track them
> down.
> 
> Thanks,
> Ken
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
>

Schema validation

Posted by Ken Tam <ke...@proteustech.com>.
Hi all,

I am consuming web services made available from my customer. I was given a
very elaborate WSDL with schemas and I was able to generate the stubs by
using Axis's WSDL2Java. Everything was working fine until the service was
changed on the customer's end. This causes the deserialization step to fail
as the SOAP response does not match the schema. The customer in this case is
a big company and they don't tend to respond in a timely manner. However,
the problem persists which I must fix. I am using Axis 1.3 and it doesn't
seem to validate the SOAP response with the WSDL's schema. How do I
configure Axis to do so? Currently, I had to spend quite a bit of time to
track down the mismatches. I figure if the schema is used to validate, it
should point out the mismatches right off to spare me the time to track them
down.

Thanks,
Ken



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


Re: Path from the webapp

Posted by Martin Gainty <mg...@hotmail.com>.
I know that The wsdd Deployment Descriptor and the wsdl Description Language 
cannot disagree
The WSDL will mirror all information specified from the wsdd

Here is an example (from GetQuote) first the deploy.wsdd (to deploy the 
service)
  <service name="urn:xmltoday-delayed-quotes" provider="java:RPC">
    <parameter name="className" value="samples.stock.StockQuoteService"/>
    <!--parameter name="allowedMethods" value="getQuote test"/-->
    <parameter name="allowedMethods" value="getQuote"/>
    <parameter name="allowedRoles" value="user1,user2"/>
    <parameter name="wsdlServicePort" value="GetQuote"/>
Notice the port specification parameter     <parameter 
name="wsdlServicePort" value="GetQuote"/>

 to look at the wsdl for the individual service
  <portType name="GetQuote">
    <operation name="getQuote" >
      <input  message="tns:GetQuoteRequest"/>
      <output message="tns:GetQuoteResponse"/>
    </operation>
    <operation name="test" >
      <input message="tns:testRequest"/>
      <output message="tns:testResponse"/>
    </operation>
  </portType>
Have you noticed that the Request and Response for each method test as well 
as getQuote are specified here
Does this help you?
Viel Gluck,
Martin --

This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: <eb...@arcor.de>
To: <ax...@ws.apache.org>; "'Martin Gainty'" <mg...@hotmail.com>
Sent: Sunday, May 21, 2006 2:47 PM
Subject: AW: Path from the webapp


I think, there is no special in my service implementation.

Works the interface for you also in the implementation class?

Need I additional configurations in the server-config.wsdd?

My ant task:
<axis-wsdl2java url="${local.wsdl}"
                output="${src}"
    testcase="false"
                deployscope="session"
    serverside="true"
    skeletonDeploy="true"
implementationclassname="com.name.ServiceImpl"
                            noimports="false">
<mapping...
</axis-wsdl2java>

> -----Ursprüngliche Nachricht-----
> Von: Martin Gainty [mailto:mgainty@hotmail.com]
> Gesendet: Sonntag, 21. Mai 2006 20:32
> An: ebaykunde@arcor.de; axis-user@ws.apache.org
> Betreff: Re: Path from the webapp
>
> Could you explain How your implementation differ from regular AxisServlet
> service?
>
> Martin -
>
> This email message and any files transmitted with it contain confidential
> information intended only for the person(s) to whom this email message is
> addressed.  If you have received this email message in error, please
> notify
> the sender immediately by telephone or email and destroy the original
> message without making a copy.  Thank you.
>
> ----- Original Message -----
> From: <eb...@arcor.de>
> To: <ax...@ws.apache.org>; "'Martin Gainty'" <mg...@hotmail.com>
> Sent: Sunday, May 21, 2006 10:19 AM
> Subject: AW: Path from the webapp
>
>
> Sorry, I don't understand your solution.
> My problem is that the service lifecycle methods are called within axis.
> This is the case for the skeleton class but not for my implementation
> class.
>
>
> > Question :
> > Instead of calling AxisServlet init method directly Could you achieve
> the
> > same result by passing in the requisite initialisation parameters in
> > web.xml?
> >
> > Viel Gluck,
> > Martin --
> >
> > This email message and any files transmitted with it contain
> confidential
> > information intended only for the person(s) to whom this email message
> is
> > addressed.  If you have received this email message in error, please
> > notify
> > the sender immediately by telephone or email and destroy the original
> > message without making a copy.  Thank you.
> >
> > ----- Original Message -----
> > From: <eb...@arcor.de>
> > To: <ax...@ws.apache.org>
> > Sent: Sunday, May 21, 2006 8:57 AM
> > Subject: AW: Path from the webapp
> >
> >
> > Hi,
> >
> > first thanks for your help but I have still problems with this.
> >
> > First I think you meant the javax.xml.rpc.server.ServiceLifecycle
> > and not the ServletLifecycle interface?
> >
> > I tried now code like this
> > http://forum.java.sun.com/thread.jspa?forumID=331&threadID=621841.
> >
> > The big problem is, that the init Method is never called. I am using
> > Tomcat
> > 5.0.28. I tried several version of Apache Axis 1.x including 1.4 Final.
> >
> > This problem keeps me busy now more than 3 hours and I'm too stupid to
> > find
> > a solution. That's why, please help me.
> >
> > I also tried to add this class as listener in web.xml?!
> >
> > In an handler class this is no problem but in a service class....
> >
> > Additional hints for me?
> >
> > Regards,
> > Ralph
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Dies Koper [mailto:dies@jp.fujitsu.com]
> > > Gesendet: Donnerstag, 18. Mai 2006 12:01
> > > An: axis-user@ws.apache.org
> > > Betreff: Re: Path from the webapp
> > >
> > > Hello Ralph,
> > >
> > > Check out the JAX-RPC spec.
> > > You can get to the servlet context by implementing the
> ServletLifecycle
> > > interface in your implementation class.
> > >
> > > Regards,
> > > Dies
> > >
> > > ebaykunde@arcor.de wrote:
> > > > Hi,
> > > >
> > > > I use Axis 1.4.
> > > >
> > > > In the axis web app I have a directory 'update'.
> > > > In my service implementation I want to read the files in the
> > directory.
> > > > String directory = ...;
> > > > File file = new File(directory);
> > > >
> > > > The first problem is how I can get the string directory dynamically
> > from
> > > the
> > > > xxxServiceBindingImplementation. I have no servlet context there.
> > > > I need the directory in the form like d://tomcat/webapps/update.
> > > >
> > > > Another problem:
> > > > Can I get the url from the xxxServiceBindingImplementation for
> > instance:
> > > > http://localhost:8080/myapp?
> > > >
> > > > Can anybody help me?
> > > >
> > > > Thanks!
> > > >
> > > > Regards,
> > > > Ralph
> >
> >
> > ---------------------------------------------------------------------
> > 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
>
>
> ---------------------------------------------------------------------
> 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


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


AW: Path from the webapp

Posted by eb...@arcor.de.
I think, there is no special in my service implementation.

Works the interface for you also in the implementation class?

Need I additional configurations in the server-config.wsdd?

My ant task:
		<axis-wsdl2java url="${local.wsdl}"
		                output="${src}"
			 	    testcase="false"
		                deployscope="session"
				    serverside="true"
				    skeletonDeploy="true"
implementationclassname="com.name.ServiceImpl"
                            noimports="false">
<mapping...
</axis-wsdl2java>

> -----Ursprüngliche Nachricht-----
> Von: Martin Gainty [mailto:mgainty@hotmail.com]
> Gesendet: Sonntag, 21. Mai 2006 20:32
> An: ebaykunde@arcor.de; axis-user@ws.apache.org
> Betreff: Re: Path from the webapp
> 
> Could you explain How your implementation differ from regular AxisServlet
> service?
> 
> Martin -
> 
> This email message and any files transmitted with it contain confidential
> information intended only for the person(s) to whom this email message is
> addressed.  If you have received this email message in error, please
> notify
> the sender immediately by telephone or email and destroy the original
> message without making a copy.  Thank you.
> 
> ----- Original Message -----
> From: <eb...@arcor.de>
> To: <ax...@ws.apache.org>; "'Martin Gainty'" <mg...@hotmail.com>
> Sent: Sunday, May 21, 2006 10:19 AM
> Subject: AW: Path from the webapp
> 
> 
> Sorry, I don't understand your solution.
> My problem is that the service lifecycle methods are called within axis.
> This is the case for the skeleton class but not for my implementation
> class.
> 
> 
> > Question :
> > Instead of calling AxisServlet init method directly Could you achieve
> the
> > same result by passing in the requisite initialisation parameters in
> > web.xml?
> >
> > Viel Gluck,
> > Martin --
> >
> > This email message and any files transmitted with it contain
> confidential
> > information intended only for the person(s) to whom this email message
> is
> > addressed.  If you have received this email message in error, please
> > notify
> > the sender immediately by telephone or email and destroy the original
> > message without making a copy.  Thank you.
> >
> > ----- Original Message -----
> > From: <eb...@arcor.de>
> > To: <ax...@ws.apache.org>
> > Sent: Sunday, May 21, 2006 8:57 AM
> > Subject: AW: Path from the webapp
> >
> >
> > Hi,
> >
> > first thanks for your help but I have still problems with this.
> >
> > First I think you meant the javax.xml.rpc.server.ServiceLifecycle
> > and not the ServletLifecycle interface?
> >
> > I tried now code like this
> > http://forum.java.sun.com/thread.jspa?forumID=331&threadID=621841.
> >
> > The big problem is, that the init Method is never called. I am using
> > Tomcat
> > 5.0.28. I tried several version of Apache Axis 1.x including 1.4 Final.
> >
> > This problem keeps me busy now more than 3 hours and I'm too stupid to
> > find
> > a solution. That's why, please help me.
> >
> > I also tried to add this class as listener in web.xml?!
> >
> > In an handler class this is no problem but in a service class....
> >
> > Additional hints for me?
> >
> > Regards,
> > Ralph
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Dies Koper [mailto:dies@jp.fujitsu.com]
> > > Gesendet: Donnerstag, 18. Mai 2006 12:01
> > > An: axis-user@ws.apache.org
> > > Betreff: Re: Path from the webapp
> > >
> > > Hello Ralph,
> > >
> > > Check out the JAX-RPC spec.
> > > You can get to the servlet context by implementing the
> ServletLifecycle
> > > interface in your implementation class.
> > >
> > > Regards,
> > > Dies
> > >
> > > ebaykunde@arcor.de wrote:
> > > > Hi,
> > > >
> > > > I use Axis 1.4.
> > > >
> > > > In the axis web app I have a directory 'update'.
> > > > In my service implementation I want to read the files in the
> > directory.
> > > > String directory = ...;
> > > > File file = new File(directory);
> > > >
> > > > The first problem is how I can get the string directory dynamically
> > from
> > > the
> > > > xxxServiceBindingImplementation. I have no servlet context there.
> > > > I need the directory in the form like d://tomcat/webapps/update.
> > > >
> > > > Another problem:
> > > > Can I get the url from the xxxServiceBindingImplementation for
> > instance:
> > > > http://localhost:8080/myapp?
> > > >
> > > > Can anybody help me?
> > > >
> > > > Thanks!
> > > >
> > > > Regards,
> > > > Ralph
> >
> >
> > ---------------------------------------------------------------------
> > 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
> 
> 
> ---------------------------------------------------------------------
> 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: Path from the webapp

Posted by Martin Gainty <mg...@hotmail.com>.
Could you explain How your implementation differ from regular AxisServlet 
service?

Martin -

This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: <eb...@arcor.de>
To: <ax...@ws.apache.org>; "'Martin Gainty'" <mg...@hotmail.com>
Sent: Sunday, May 21, 2006 10:19 AM
Subject: AW: Path from the webapp


Sorry, I don't understand your solution.
My problem is that the service lifecycle methods are called within axis.
This is the case for the skeleton class but not for my implementation class.


> Question :
> Instead of calling AxisServlet init method directly Could you achieve the
> same result by passing in the requisite initialisation parameters in
> web.xml?
>
> Viel Gluck,
> Martin --
>
> This email message and any files transmitted with it contain confidential
> information intended only for the person(s) to whom this email message is
> addressed.  If you have received this email message in error, please
> notify
> the sender immediately by telephone or email and destroy the original
> message without making a copy.  Thank you.
>
> ----- Original Message -----
> From: <eb...@arcor.de>
> To: <ax...@ws.apache.org>
> Sent: Sunday, May 21, 2006 8:57 AM
> Subject: AW: Path from the webapp
>
>
> Hi,
>
> first thanks for your help but I have still problems with this.
>
> First I think you meant the javax.xml.rpc.server.ServiceLifecycle
> and not the ServletLifecycle interface?
>
> I tried now code like this
> http://forum.java.sun.com/thread.jspa?forumID=331&threadID=621841.
>
> The big problem is, that the init Method is never called. I am using
> Tomcat
> 5.0.28. I tried several version of Apache Axis 1.x including 1.4 Final.
>
> This problem keeps me busy now more than 3 hours and I'm too stupid to
> find
> a solution. That's why, please help me.
>
> I also tried to add this class as listener in web.xml?!
>
> In an handler class this is no problem but in a service class....
>
> Additional hints for me?
>
> Regards,
> Ralph
>
> > -----Ursprüngliche Nachricht-----
> > Von: Dies Koper [mailto:dies@jp.fujitsu.com]
> > Gesendet: Donnerstag, 18. Mai 2006 12:01
> > An: axis-user@ws.apache.org
> > Betreff: Re: Path from the webapp
> >
> > Hello Ralph,
> >
> > Check out the JAX-RPC spec.
> > You can get to the servlet context by implementing the ServletLifecycle
> > interface in your implementation class.
> >
> > Regards,
> > Dies
> >
> > ebaykunde@arcor.de wrote:
> > > Hi,
> > >
> > > I use Axis 1.4.
> > >
> > > In the axis web app I have a directory 'update'.
> > > In my service implementation I want to read the files in the
> directory.
> > > String directory = ...;
> > > File file = new File(directory);
> > >
> > > The first problem is how I can get the string directory dynamically
> from
> > the
> > > xxxServiceBindingImplementation. I have no servlet context there.
> > > I need the directory in the form like d://tomcat/webapps/update.
> > >
> > > Another problem:
> > > Can I get the url from the xxxServiceBindingImplementation for
> instance:
> > > http://localhost:8080/myapp?
> > >
> > > Can anybody help me?
> > >
> > > Thanks!
> > >
> > > Regards,
> > > Ralph
>
>
> ---------------------------------------------------------------------
> 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


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


AW: Path from the webapp

Posted by eb...@arcor.de.
Sorry, I don't understand your solution.
My problem is that the service lifecycle methods are called within axis.
This is the case for the skeleton class but not for my implementation class.


> Question :
> Instead of calling AxisServlet init method directly Could you achieve the
> same result by passing in the requisite initialisation parameters in
> web.xml?
> 
> Viel Gluck,
> Martin --
> 
> This email message and any files transmitted with it contain confidential
> information intended only for the person(s) to whom this email message is
> addressed.  If you have received this email message in error, please
> notify
> the sender immediately by telephone or email and destroy the original
> message without making a copy.  Thank you.
> 
> ----- Original Message -----
> From: <eb...@arcor.de>
> To: <ax...@ws.apache.org>
> Sent: Sunday, May 21, 2006 8:57 AM
> Subject: AW: Path from the webapp
> 
> 
> Hi,
> 
> first thanks for your help but I have still problems with this.
> 
> First I think you meant the javax.xml.rpc.server.ServiceLifecycle
> and not the ServletLifecycle interface?
> 
> I tried now code like this
> http://forum.java.sun.com/thread.jspa?forumID=331&threadID=621841.
> 
> The big problem is, that the init Method is never called. I am using
> Tomcat
> 5.0.28. I tried several version of Apache Axis 1.x including 1.4 Final.
> 
> This problem keeps me busy now more than 3 hours and I'm too stupid to
> find
> a solution. That's why, please help me.
> 
> I also tried to add this class as listener in web.xml?!
> 
> In an handler class this is no problem but in a service class....
> 
> Additional hints for me?
> 
> Regards,
> Ralph
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Dies Koper [mailto:dies@jp.fujitsu.com]
> > Gesendet: Donnerstag, 18. Mai 2006 12:01
> > An: axis-user@ws.apache.org
> > Betreff: Re: Path from the webapp
> >
> > Hello Ralph,
> >
> > Check out the JAX-RPC spec.
> > You can get to the servlet context by implementing the ServletLifecycle
> > interface in your implementation class.
> >
> > Regards,
> > Dies
> >
> > ebaykunde@arcor.de wrote:
> > > Hi,
> > >
> > > I use Axis 1.4.
> > >
> > > In the axis web app I have a directory 'update'.
> > > In my service implementation I want to read the files in the
> directory.
> > > String directory = ...;
> > > File file = new File(directory);
> > >
> > > The first problem is how I can get the string directory dynamically
> from
> > the
> > > xxxServiceBindingImplementation. I have no servlet context there.
> > > I need the directory in the form like d://tomcat/webapps/update.
> > >
> > > Another problem:
> > > Can I get the url from the xxxServiceBindingImplementation for
> instance:
> > > http://localhost:8080/myapp?
> > >
> > > Can anybody help me?
> > >
> > > Thanks!
> > >
> > > Regards,
> > > Ralph
> 
> 
> ---------------------------------------------------------------------
> 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


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


Re: Path from the webapp

Posted by Martin Gainty <mg...@hotmail.com>.
Ralph-

If you're an axis coder then I would not classify Axis coders as 'stupid'
Question :
Instead of calling AxisServlet init method directly Could you achieve the 
same result by passing in the requisite initialisation parameters in 
web.xml?

Viel Gluck,
Martin --

This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: <eb...@arcor.de>
To: <ax...@ws.apache.org>
Sent: Sunday, May 21, 2006 8:57 AM
Subject: AW: Path from the webapp


Hi,

first thanks for your help but I have still problems with this.

First I think you meant the javax.xml.rpc.server.ServiceLifecycle
and not the ServletLifecycle interface?

I tried now code like this
http://forum.java.sun.com/thread.jspa?forumID=331&threadID=621841.

The big problem is, that the init Method is never called. I am using Tomcat
5.0.28. I tried several version of Apache Axis 1.x including 1.4 Final.

This problem keeps me busy now more than 3 hours and I'm too stupid to find
a solution. That's why, please help me.

I also tried to add this class as listener in web.xml?!

In an handler class this is no problem but in a service class....

Additional hints for me?

Regards,
Ralph

> -----Ursprüngliche Nachricht-----
> Von: Dies Koper [mailto:dies@jp.fujitsu.com]
> Gesendet: Donnerstag, 18. Mai 2006 12:01
> An: axis-user@ws.apache.org
> Betreff: Re: Path from the webapp
>
> Hello Ralph,
>
> Check out the JAX-RPC spec.
> You can get to the servlet context by implementing the ServletLifecycle
> interface in your implementation class.
>
> Regards,
> Dies
>
> ebaykunde@arcor.de wrote:
> > Hi,
> >
> > I use Axis 1.4.
> >
> > In the axis web app I have a directory 'update'.
> > In my service implementation I want to read the files in the directory.
> > String directory = ...;
> > File file = new File(directory);
> >
> > The first problem is how I can get the string directory dynamically from
> the
> > xxxServiceBindingImplementation. I have no servlet context there.
> > I need the directory in the form like d://tomcat/webapps/update.
> >
> > Another problem:
> > Can I get the url from the xxxServiceBindingImplementation for instance:
> > http://localhost:8080/myapp?
> >
> > Can anybody help me?
> >
> > Thanks!
> >
> > Regards,
> > Ralph


---------------------------------------------------------------------
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: AW: ServiceLifecycle

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Dr Janusz Martyniak wrote:

> Deepal Jayasinghe wrote:
>
>> Hi  Janusz;
>>
>>>  but,
>>>
>>> The init() is called every time I invoke the method. 
>>
>>
>> That will only happen if you deploy your service in request scope , if
>> you deploy your service in application scope then that will never
>> happen.
>>
>
>  Well, if I deploy my service as an application then init() is called
> once and all the clients will share the implementation instance and
> the latter is not what I want.
>
> What I'm trying to achieve is to keep the request mode, so every
> client gets his own instance of a service, but have a possibility to
> initialise the service once, possibly at servlet loading time, or at a
> very first call. The init() method does not deliver this.

Well , then you need to have a look at ServiceLifeCycle interface. I
hope using that you will be able to achieve what you want.

Thanks
Deepal


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


RE: AW: ServiceLifecycle

Posted by Tony Dean <To...@sas.com>.
sorry, axis2. 

-----Original Message-----
From: Dr Janusz Martyniak [mailto:janusz.martyniak@imperial.ac.uk] 
Sent: Thursday, January 11, 2007 10:34 AM
To: axis-user@ws.apache.org
Subject: Re: AW: ServiceLifecycle

Tony Dean wrote:
> Here's what you need:
> 
> services.xml
> 
> <service name="yourService"
>          class="yourService.serviceLifeCyle" scope="request">
>     <parameter name="ServiceClass">yourService.Impl</parameter> 
>     ...
> <service/>
> 

  Hi,

Are you talking about axis2 ? I'm using axis 1.4 . There is no services.xml  apparently... server-config.wsdd seems to have a similar role in axis 1.4 but tags are somewhat different there. Have you tried the above solution on 1.x ?

                 Janusz

---------------------------------------------------------------------
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: AW: ServiceLifecycle

Posted by Dr Janusz Martyniak <ja...@imperial.ac.uk>.
Tony Dean wrote:
> Here's what you need:
> 
> services.xml
> 
> <service name="yourService"
>          class="yourService.serviceLifeCyle" scope="request">
>     <parameter name="ServiceClass">yourService.Impl</parameter> 
>     ...
> <service/>
> 

  Hi,

Are you talking about axis2 ? I'm using axis 1.4 . There is no 
services.xml  apparently... server-config.wsdd seems to have a similar 
role in axis 1.4 but tags are somewhat different there. Have you tried 
the above solution on 1.x ?

                 Janusz

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


RE: AW: ServiceLifecycle

Posted by Tony Dean <To...@sas.com>.
Here's what you need:

services.xml

<service name="yourService"
         class="yourService.serviceLifeCyle" scope="request">
    <parameter name="ServiceClass">yourService.Impl</parameter> 
    ...
<service/>

yourService.serviceLifeCycle class is your service lifecycle class and it will be loaded one and only one time.  This class must implement startUp(ConfigurationContext ctx, AxisService service) and shutDown(ConfigurationContext ctx, AxisService service) and these methods are called once at the obvious time.

yourService.Impl is your implementation class.  It should contain an init(ServiceContext ctx) and destroy(ServiceContext ctx).  These methods are session-based and will be called everytime a new session is created and destroyed.  And since you specify scope=request, a new session will be created on every request.

Hope this explains what you need.

I use scope=application so I have not verified this myself, but I investigated all possible lifecycle scenarios when I was deciding how I wanted to implement my service.

-Tony

-----Original Message-----
From: Dr Janusz Martyniak [mailto:janusz.martyniak@imperial.ac.uk] 
Sent: Thursday, January 11, 2007 5:43 AM
To: axis-user@ws.apache.org
Subject: Re: AW: ServiceLifecycle

Deepal Jayasinghe wrote:
> Hi  Janusz;
> 
>>  but,
>>
>> The init() is called every time I invoke the method. 
> 
> That will only happen if you deploy your service in request scope , if 
> you deploy your service in application scope then that will never happen.
> 

  Well, if I deploy my service as an application then init() is called once and all the clients will share the implementation instance and the latter is not what I want.

What I'm trying to achieve is to keep the request mode, so every client gets his own instance of a service, but have a possibility to initialise the service once, possibly at servlet loading time, or at a very first call. The init() method does not deliver this.

> 
>>  Thre are lots of applications one would like to initialise the whole
>> system before actually performing any requests. Otherwise every call
>> to an operation has to perform often complex initialisation steps.
> 
> Totally agreed.
> 
  Appreciated ;-), but is there a way out ???

                         cheers, Janusz

---------------------------------------------------------------------
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: AW: ServiceLifecycle

Posted by Dr Janusz Martyniak <ja...@imperial.ac.uk>.
Deepal Jayasinghe wrote:
> Hi  Janusz;
> 
>>  but,
>>
>> The init() is called every time I invoke the method. 
> 
> That will only happen if you deploy your service in request scope , if
> you deploy your service in application scope then that will never happen.
> 

  Well, if I deploy my service as an application then init() is called 
once and all the clients will share the implementation instance and the 
latter is not what I want.

What I'm trying to achieve is to keep the request mode, so every client 
gets his own instance of a service, but have a possibility to initialise 
the service once, possibly at servlet loading time, or at a very first 
call. The init() method does not deliver this.

> 
>>  Thre are lots of applications one would like to initialise the whole
>> system before actually performing any requests. Otherwise every call
>> to an operation has to perform often complex initialisation steps.
> 
> Totally agreed.
> 
  Appreciated ;-), but is there a way out ???

                         cheers, Janusz

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


Re: AW: ServiceLifecycle

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi  Janusz;

>
>  but,
>
> The init() is called every time I invoke the method. 

That will only happen if you deploy your service in request scope , if
you deploy your service in application scope then that will never happen.

> I saw a post on axis2 and it seems to be different there (lifecycle !=
> session). 

Yes , session and life cycle are two different things , the idea of life
cycle interface is to provide a way to handle life cycle of the
AixsService and those life cycle method only call at the system start
time and when system goes down.
But , the idea of session is bit different . Sessions scope define the
life time of service impl class and the contexts.

> There is no much use of init() called every time for session-less
> services (I could put init() in a operation) and it just makes
> lifecycle=session (an application is an endless session ;-) ).


>
>  Is it possible to initialise the whole service _ONCE_ and still get a
> session-less services in Axis 1.4 ? The Web Services mit Axis, a
> German book the ebaykunde was probably referring to does suggest that
> init() is called only once "before a service can accept calls".

hmm, I am not sure abt Axis 1.4 :)

>
>  Thre are lots of applications one would like to initialise the whole
> system before actually performing any requests. Otherwise every call
> to an operation has to perform often complex initialisation steps.

Totally agreed.

>
>  Any ideas ?
>
>                   happy New Year to everyone !
>                             cheers Janusz
>
>
> ---------------------------------------------------------------------
> 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: AW: ServiceLifecycle

Posted by Dr Janusz Martyniak <ja...@imperial.ac.uk>.
Dies Koper wrote:

> 
> It depends on what you specify for the deployScope option. If you choose 
> "application", the init method will be called only once.
> 

  Well,

I tried the lifecycle business  as well (via skeletons which call imp 
classes explicitly in their init() method, i.e both skeletons and imp 
implement the interface)

  but,

The init() is called every time I invoke the method. I saw a post on 
axis2 and it seems to be different there (lifecycle != session). There 
is no much use of init() called every time for session-less services (I 
could put init() in a operation) and it just makes lifecycle=session (an 
application is an endless session ;-) ).

  Is it possible to initialise the whole service _ONCE_ and still get a 
session-less services in Axis 1.4 ? The Web Services mit Axis, a German 
book the ebaykunde was probably referring to does suggest that init() is 
called only once "before a service can accept calls".

  Thre are lots of applications one would like to initialise the whole 
system before actually performing any requests. Otherwise every call to 
an operation has to perform often complex initialisation steps.

  Any ideas ?

                   happy New Year to everyone !
                             cheers Janusz


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


Re: AW: ServiceLifecycle

Posted by Dies Koper <di...@jp.fujitsu.com>.
Hello Ralph,

Sorry for the very very late reply. I suppose you have solved your 
problem already, but if you haven't:

ebaykunde@arcor.de wrote:
>> Follow the example in the URL:
>> 1. your impl class implements javax.xml.rpc.server.ServiceLifecycle
>> 2. implement init(Object ctx) and destroy()
> My problem is hat the init and destroy method is only called, if I implement
> the ServiceLifecycle interface in the Skeleton class. But this is not what I
> want to do, because this class is not very nice and would be overwritten if
> I do another Java2WSDL task.

I tried rebuilding your service with the skeletonDeploy option to false 
(no skeletons). The init method in the impl class was called correctly.
I never used skeletons, so I am not sure what to expect if you do 
generate them.

> I am a little bit confused about the ServiceLifecycle. The ServiceLifecycle
> seems to be called every time if I call
> http://localhost:7070/myapp/services/SyncService?method=getPerson
> in the browser etc.. That's OK and what I want to have. But in some
> documentations and also in books they write the init method of a service
> will be called only ONCE before he can accept requests. I think that's not
> correct?!?

It depends on what you specify for the deployScope option. If you choose 
"application", the init method will be called only once.

> PS:
> Another ugly thing why overwrites Axis with every java2wsdl task the
> ServiceImpl class?

I think you mean the wsdl2java task.
The ant task designer must have thought that the reason you are 
rerunning the wsdl2java task is to update your Java classes after you 
changed the interface. If the interface is changed, the old impl class 
would not work anymore anyway. Why don't you keep the generated source 
and your own implementation class separate (with the 'output' attribute) 
and update your impl by hand if necessary.

Regards,
Dies


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


AW: ServiceLifecycle

Posted by eb...@arcor.de.
Hello,

I have still the same problem.

> Follow the example in the URL:
> 1. your impl class implements javax.xml.rpc.server.ServiceLifecycle
> 2. implement init(Object ctx) and destroy()
My problem is hat the init and destroy method is only called, if I implement
the ServiceLifecycle interface in the Skeleton class. But this is not what I
want to do, because this class is not very nice and would be overwritten if
I do another Java2WSDL task.

> It works for me in Axis 1.2.1 and Axis 1.3.
I use axis 1.4 but I think that's not the problem.

> Search for basic mistakes: are you overwriting your impl and deploying 
> that instead? Is the impl class in Tomcat's webapps/classes really the 
> one you made? Do you have two versions, one in web-inf/classes and one 
> in web-inf/lib?
I have checked this.

> IIRC, the init method will be called when the Axis servlet is activated.
> I believe Tomcat activates servlets at start-up time, but Servlet 
> container implementations are allowed to do this at first access (just 
> before the first incoming request).
I am a little bit confused about the ServiceLifecycle. The ServiceLifecycle
seems to be called every time if I call
http://localhost:7070/myapp/services/SyncService?method=getPerson
in the browser etc.. That's OK and what I want to have. But in some
documentations and also in books they write the init method of a service
will be called only ONCE before he can accept requests. I think that's not
correct?!?

> There is no need to set anything in the web.xml or wsdd to make it work.
OK.
 
> PS: If you really can't get it to work, send us your appl (or smaller 
> version of it).
That's very kindly from you. Please see the attached short code (including
also build.xml and server-config.wsdd). You have only to add the axis libs
to test it.

The code produces in my case:
Skeleton - init
Skeleton - destroy
Skeleton - init
Skeleton - destroy
..

I would think, he should generates:
Skeleton - init
ServiceImpl - init
PersonService - init
Skeleton - destroy
ServiceImpl - destroy
PersonService - destroy

The init and destroy method of ServieImpl will also not be called if I
comment the other two.

Your help is very, very appreciated!

Many thanks,
Ralph

PS:
Another ugly thing why overwrites Axis with every java2wsdl task the
ServiceImpl class?

Re: AW: Path from the webapp

Posted by Dies Koper <di...@jp.fujitsu.com>.
Hello Ralph,

Yes, ServiceLifecycle, not ServletLifecycle, sorry.
Follow the example in the URL:
1. your impl class implements javax.xml.rpc.server.ServiceLifecycle
2. implement init(Object ctx) and destroy()
3. cast ctx to ServletEndpointContext

It works for me in Axis 1.2.1 and Axis 1.3.
Search for basic mistakes: are you overwriting your impl and deploying 
that instead? Is the impl class in Tomcat's webapps/classes really the 
one you made? Do you have two versions, one in web-inf/classes and one 
in web-inf/lib?

IIRC, the init method will be called when the Axis servlet is activated. 
I believe Tomcat activates servlets at start-up time, but Servlet 
container implementations are allowed to do this at first access (just 
before the first incoming request).

There is no need to set anything in the web.xml or wsdd to make it work.

Good luck,
Dies

PS: If you really can't get it to work, send us your appl (or smaller 
version of it).


ebaykunde@arcor.de wrote:
> Hi,
> 
> first thanks for your help but I have still problems with this.
> 
> First I think you meant the javax.xml.rpc.server.ServiceLifecycle
> and not the ServletLifecycle interface?
> 
> I tried now code like this
> http://forum.java.sun.com/thread.jspa?forumID=331&threadID=621841.
> 
> The big problem is, that the init Method is never called. I am using Tomcat
> 5.0.28. I tried several version of Apache Axis 1.x including 1.4 Final.
> 
> This problem keeps me busy now more than 3 hours and I'm too stupid to find
> a solution. That's why, please help me.
> 
> I also tried to add this class as listener in web.xml?!
> 
> In an handler class this is no problem but in a service class....
> 
> Additional hints for me?
> 
> Regards,
> Ralph
> 
>> -----Ursprüngliche Nachricht-----
>> Von: Dies Koper [mailto:dies@jp.fujitsu.com]
>> Gesendet: Donnerstag, 18. Mai 2006 12:01
>> An: axis-user@ws.apache.org
>> Betreff: Re: Path from the webapp
>>
>> Hello Ralph,
>>
>> Check out the JAX-RPC spec.
>> You can get to the servlet context by implementing the ServletLifecycle
>> interface in your implementation class.
>>
>> Regards,
>> Dies
>>
>> ebaykunde@arcor.de wrote:
>>> Hi,
>>>
>>> I use Axis 1.4.
>>>
>>> In the axis web app I have a directory 'update'.
>>> In my service implementation I want to read the files in the directory.
>>> String directory = ...;
>>> File file = new File(directory);
>>>
>>> The first problem is how I can get the string directory dynamically from
>> the
>>> xxxServiceBindingImplementation. I have no servlet context there.
>>> I need the directory in the form like d://tomcat/webapps/update.
>>>
>>> Another problem:
>>> Can I get the url from the xxxServiceBindingImplementation for instance:
>>> http://localhost:8080/myapp?
>>>
>>> Can anybody help me?
>>>
>>> Thanks!
>>>
>>> Regards,
>>> Ralph



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


AW: Path from the webapp

Posted by eb...@arcor.de.
Hi,

first thanks for your help but I have still problems with this.

First I think you meant the javax.xml.rpc.server.ServiceLifecycle
and not the ServletLifecycle interface?

I tried now code like this
http://forum.java.sun.com/thread.jspa?forumID=331&threadID=621841.

The big problem is, that the init Method is never called. I am using Tomcat
5.0.28. I tried several version of Apache Axis 1.x including 1.4 Final.

This problem keeps me busy now more than 3 hours and I'm too stupid to find
a solution. That's why, please help me.

I also tried to add this class as listener in web.xml?!

In an handler class this is no problem but in a service class....

Additional hints for me?

Regards,
Ralph

> -----Ursprüngliche Nachricht-----
> Von: Dies Koper [mailto:dies@jp.fujitsu.com]
> Gesendet: Donnerstag, 18. Mai 2006 12:01
> An: axis-user@ws.apache.org
> Betreff: Re: Path from the webapp
> 
> Hello Ralph,
> 
> Check out the JAX-RPC spec.
> You can get to the servlet context by implementing the ServletLifecycle
> interface in your implementation class.
> 
> Regards,
> Dies
> 
> ebaykunde@arcor.de wrote:
> > Hi,
> >
> > I use Axis 1.4.
> >
> > In the axis web app I have a directory 'update'.
> > In my service implementation I want to read the files in the directory.
> > String directory = ...;
> > File file = new File(directory);
> >
> > The first problem is how I can get the string directory dynamically from
> the
> > xxxServiceBindingImplementation. I have no servlet context there.
> > I need the directory in the form like d://tomcat/webapps/update.
> >
> > Another problem:
> > Can I get the url from the xxxServiceBindingImplementation for instance:
> > http://localhost:8080/myapp?
> >
> > Can anybody help me?
> >
> > Thanks!
> >
> > Regards,
> > Ralph


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


Re: Path from the webapp

Posted by Dies Koper <di...@jp.fujitsu.com>.
Hello Ralph,

Check out the JAX-RPC spec.
You can get to the servlet context by implementing the ServletLifecycle 
interface in your implementation class.

Regards,
Dies

ebaykunde@arcor.de wrote:
> Hi,
> 
> I use Axis 1.4.
> 
> In the axis web app I have a directory 'update'.
> In my service implementation I want to read the files in the directory.
> String directory = ...;
> File file = new File(directory);
> 
> The first problem is how I can get the string directory dynamically from the
> xxxServiceBindingImplementation. I have no servlet context there.
> I need the directory in the form like d://tomcat/webapps/update.
> 
> Another problem:
> Can I get the url from the xxxServiceBindingImplementation for instance:
> http://localhost:8080/myapp?
> 
> Can anybody help me?
> 
> Thanks!
> 
> Regards,
> Ralph