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 mchmiel <mc...@tlen.pl> on 2007/08/15 23:53:27 UTC

Need advice

I need to integrate a .NET platform and Java and for this task I have
choosen WebServices. First technology for the Java part was ofcourse
Axis. But then I had to redesign the
whole thing becouse of the caching problem . Here is the explanation:
1. I have a MemoryModel (a JDOM tree) which has to be loaded as the
Tomcat AppServer is stertin
2. I need to implement a WS taht manages the resourse (MemoryModel)
3. Then the next WebService allows users to invoke read/write operations
on the first Ws that manages the MemoryModel

First of all cannot find how to preload webservice, and second issue how
to share a complex Object between WebServices (inside the same WebApp)

I started from teh beggining and using servlets I could managed to do so
... that is.
1. PreLoad the servlet
2. Write a caching servlet and register the MemeoryModel in ServeltContext
3. Write a Servlet that could (pretend to be a WS)
4, the last task is extreamly hard I looked throuh kSOAP, JAXM and so on
but the i do not need the servet to understand SOAP but to be
a WS?
In such case can Axis help me?
Or even simplier task.... can Axis WS see a servlet context and register
internally my MemeoryModel?

Thanks For any help

mchm


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


Re: Need advice

Posted by Amila Suriarachchi <am...@gmail.com>.
On 8/16/07, mchmiel <mc...@tlen.pl> wrote:
>
> I am affraid that i will need to access the Servet conext from
> Webservice and is not
> easy. I have maneged to looked through such combination (correct me if I
> am wrong)


please see this http://wso2.org/library/480

first i cache my JDOM tree and load it into context (autostart servlet)
>
> then I establish a connection from
> .NET ASP page which communicates to my Axis (Axis2) webservice (7
> methods) (complex objects in/out)
> The Axis Webservice calls a SOAP aware servet (which  uses JAXM ) to
> decode the SOAP request calls the funkcjionality on stored in servet
> context model,
> get the response encode it to SOAP and send it back to Axis (Axis2)
> webservis which returns the output to ASP. NET.


I can not understand why you need Axis2 call for another Soap aware servlet.
What you should do is (as I understood) either.
1. call ASP directly to SOAP aware servlet
2. Axis2 web service directly calls to jdom structure stored in Servlet
Context.

What do You think is this possible ?? I think that Axis Should prepare
> itself to cooperate with Servlets and JSP ... this is the part of J2EE.
> :-)


yes.
In an axis2 web service you can directly access the servlet context as given
in the above artical.


Amila Suriarachchi pisze:
> > can you access the ServletConfiguration using the http request object
> >
> > if so you can get the request object,
> >
> > When creating messageContext Axis2 store the request and response
> > objects in message Context
> > msgContext.setProperty (HTTPConstants.MC_HTTP_SERVLETREQUEST, request);
> >         msgContext.setProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE,
> > response);
> >
> > so Inyour web service you can access it through
> >
> > MessageContext.getCurrentMessageContext
> > ().getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
> >
> > But I think the correct way is to store the ServletContext in
> > AxisConfigurationContext.
> >
> > I'll send a mail to developer list regarding this.
> >
> > Amila.
> >
> >
> > On 8/16/07, *mchmiel* <mchmiel21@tlen.pl <ma...@tlen.pl>>
> > wrote:
> >
> >     I need to integrate a .NET platform and Java and for this task I
> have
> >     choosen WebServices. First technology for the Java part was ofcourse
> >     Axis. But then I had to redesign the
> >     whole thing becouse of the caching problem . Here is the
> explanation:
> >     1. I have a MemoryModel (a JDOM tree) which has to be loaded as the
> >     Tomcat AppServer is stertin
> >     2. I need to implement a WS taht manages the resourse (MemoryModel)
> >     3. Then the next WebService allows users to invoke read/write
> >     operations
> >     on the first Ws that manages the MemoryModel
> >
> >     First of all cannot find how to preload webservice, and second
> >     issue how
> >     to share a complex Object between WebServices (inside the same
> WebApp)
> >
> >     I started from teh beggining and using servlets I could managed to
> >     do so
> >     ... that is.
> >     1. PreLoad the servlet
> >     2. Write a caching servlet and register the MemeoryModel in
> >     ServeltContext
> >     3. Write a Servlet that could (pretend to be a WS)
> >     4, the last task is extreamly hard I looked throuh kSOAP, JAXM and
> >     so on
> >     but the i do not need the servet to understand SOAP but to be
> >     a WS?
> >     In such case can Axis help me?
> >     Or even simplier task.... can Axis WS see a servlet context and
> >     register
> >     internally my MemeoryModel?
> >
> >     Thanks For any help
> >
> >     mchm
> >
> >
> >
> ---------------------------------------------------------------------
> >     To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> >     <ma...@ws.apache.org>
> >     For additional commands, e-mail: axis-user-help@ws.apache.org
> >     <ma...@ws.apache.org>
> >
> >
> >
> >
> > --
> > Amila Suriarachchi,
> > WSO2 Inc.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Amila Suriarachchi,
WSO2 Inc.

Re: Need advice

Posted by mchmiel <mc...@tlen.pl>.
I am affraid that i will need to access the Servet conext from 
Webservice and is not
easy. I have maneged to looked through such combination (correct me if I 
am wrong)


first i cache my JDOM tree and load it into context (autostart servlet)

then I establish a connection from
.NET ASP page which communicates to my Axis (Axis2) webservice (7 
methods) (complex objects in/out)
The Axis Webservice calls a SOAP aware servet (which  uses JAXM ) to 
decode the SOAP request calls the funkcjionality on stored in servet 
context model,
get the response encode it to SOAP and send it back to Axis (Axis2) 
webservis which returns the output to ASP. NET.

What do You think is this possible ?? I think that Axis Should prepare 
itself to cooperate with Servlets and JSP ... this is the part of J2EE. :-)



Amila Suriarachchi pisze:
> can you access the ServletConfiguration using the http request object
>
> if so you can get the request object,
>
> When creating messageContext Axis2 store the request and response 
> objects in message Context
> msgContext.setProperty (HTTPConstants.MC_HTTP_SERVLETREQUEST, request);
>         msgContext.setProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE, 
> response);
>
> so Inyour web service you can access it through
>
> MessageContext.getCurrentMessageContext 
> ().getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
>
> But I think the correct way is to store the ServletContext in 
> AxisConfigurationContext.
>
> I'll send a mail to developer list regarding this.
>
> Amila.
>
>
> On 8/16/07, *mchmiel* <mchmiel21@tlen.pl <ma...@tlen.pl>> 
> wrote:
>
>     I need to integrate a .NET platform and Java and for this task I have
>     choosen WebServices. First technology for the Java part was ofcourse
>     Axis. But then I had to redesign the
>     whole thing becouse of the caching problem . Here is the explanation:
>     1. I have a MemoryModel (a JDOM tree) which has to be loaded as the
>     Tomcat AppServer is stertin
>     2. I need to implement a WS taht manages the resourse (MemoryModel)
>     3. Then the next WebService allows users to invoke read/write
>     operations
>     on the first Ws that manages the MemoryModel
>
>     First of all cannot find how to preload webservice, and second
>     issue how
>     to share a complex Object between WebServices (inside the same WebApp)
>
>     I started from teh beggining and using servlets I could managed to
>     do so
>     ... that is.
>     1. PreLoad the servlet
>     2. Write a caching servlet and register the MemeoryModel in
>     ServeltContext
>     3. Write a Servlet that could (pretend to be a WS)
>     4, the last task is extreamly hard I looked throuh kSOAP, JAXM and
>     so on
>     but the i do not need the servet to understand SOAP but to be
>     a WS?
>     In such case can Axis help me?
>     Or even simplier task.... can Axis WS see a servlet context and
>     register
>     internally my MemeoryModel?
>
>     Thanks For any help
>
>     mchm
>
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>     <ma...@ws.apache.org>
>     For additional commands, e-mail: axis-user-help@ws.apache.org
>     <ma...@ws.apache.org>
>
>
>
>
> -- 
> Amila Suriarachchi,
> WSO2 Inc. 


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


Re: Need advice

Posted by Amila Suriarachchi <am...@gmail.com>.
can you access the ServletConfiguration using the http request object

if so you can get the request object,

When creating messageContext Axis2 store the request and response objects in
message Context
msgContext.setProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST, request);
        msgContext.setProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE,
response);

so Inyour web service you can access it through

MessageContext.getCurrentMessageContext().getProperty(
HTTPConstants.MC_HTTP_SERVLETREQUEST);

But I think the correct way is to store the ServletContext in
AxisConfigurationContext.

I'll send a mail to developer list regarding this.

Amila.


On 8/16/07, mchmiel <mc...@tlen.pl> wrote:
>
> I need to integrate a .NET platform and Java and for this task I have
> choosen WebServices. First technology for the Java part was ofcourse
> Axis. But then I had to redesign the
> whole thing becouse of the caching problem . Here is the explanation:
> 1. I have a MemoryModel (a JDOM tree) which has to be loaded as the
> Tomcat AppServer is stertin
> 2. I need to implement a WS taht manages the resourse (MemoryModel)
> 3. Then the next WebService allows users to invoke read/write operations
> on the first Ws that manages the MemoryModel
>
> First of all cannot find how to preload webservice, and second issue how
> to share a complex Object between WebServices (inside the same WebApp)
>
> I started from teh beggining and using servlets I could managed to do so
> ... that is.
> 1. PreLoad the servlet
> 2. Write a caching servlet and register the MemeoryModel in ServeltContext
> 3. Write a Servlet that could (pretend to be a WS)
> 4, the last task is extreamly hard I looked throuh kSOAP, JAXM and so on
> but the i do not need the servet to understand SOAP but to be
> a WS?
> In such case can Axis help me?
> Or even simplier task.... can Axis WS see a servlet context and register
> internally my MemeoryModel?
>
> Thanks For any help
>
> mchm
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Amila Suriarachchi,
WSO2 Inc.

Re: Need advice

Posted by mchmiel <mc...@tlen.pl>.
If there is a way to integrate Spring Framework,  I  guess that there 
must be a WS Bridge to Servets.
I looked throught the API Documentation and there is a AxisServlet ... 
and it is working as a dispacher
... I also foung a GlobalContext ... which is a kind of ApplicationContext.
 From documentation I have also found that Axis WS are stateless and 
only Context is able to store the state of
service.
Can anyone write me if there is a way to start a webservice along with a 
Tomcat.
I am assume that my Axis2 will work as a WebApp on my Tomcat Server.

mchm



????? ????? pisze:
> if i'm not mistaken axis2 has the notion of application scope. 
>  
> also why not use spring beans for the model (assuming it's immutable and renders services not data).
>  
>
> ________________________________
>
> From: mchmiel [mailto:mchmiel21@tlen.pl]
> Sent: Thu 8/16/2007 12:53 AM
> To: axis-user@ws.apache.org
> Subject: Need advice
>
>
>
> I need to integrate a .NET platform and Java and for this task I have
> choosen WebServices. First technology for the Java part was ofcourse
> Axis. But then I had to redesign the
> whole thing becouse of the caching problem . Here is the explanation:
> 1. I have a MemoryModel (a JDOM tree) which has to be loaded as the
> Tomcat AppServer is stertin
> 2. I need to implement a WS taht manages the resourse (MemoryModel)
> 3. Then the next WebService allows users to invoke read/write operations
> on the first Ws that manages the MemoryModel
>
> First of all cannot find how to preload webservice, and second issue how
> to share a complex Object between WebServices (inside the same WebApp)
>
> I started from teh beggining and using servlets I could managed to do so
> ... that is.
> 1. PreLoad the servlet
> 2. Write a caching servlet and register the MemeoryModel in ServeltContext
> 3. Write a Servlet that could (pretend to be a WS)
> 4, the last task is extreamly hard I looked throuh kSOAP, JAXM and so on
> but the i do not need the servet to understand SOAP but to be
> a WS?
> In such case can Axis help me?
> Or even simplier task.... can Axis WS see a servlet context and register
> internally my MemeoryModel?
>
> Thanks For any help
>
> mchm
>
>
> ---------------------------------------------------------------------
> 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: Need advice

Posted by ????? ????? <El...@Phoenix.co.il>.
if i'm not mistaken axis2 has the notion of application scope. 
 
also why not use spring beans for the model (assuming it's immutable and renders services not data).
 

________________________________

From: mchmiel [mailto:mchmiel21@tlen.pl]
Sent: Thu 8/16/2007 12:53 AM
To: axis-user@ws.apache.org
Subject: Need advice



I need to integrate a .NET platform and Java and for this task I have
choosen WebServices. First technology for the Java part was ofcourse
Axis. But then I had to redesign the
whole thing becouse of the caching problem . Here is the explanation:
1. I have a MemoryModel (a JDOM tree) which has to be loaded as the
Tomcat AppServer is stertin
2. I need to implement a WS taht manages the resourse (MemoryModel)
3. Then the next WebService allows users to invoke read/write operations
on the first Ws that manages the MemoryModel

First of all cannot find how to preload webservice, and second issue how
to share a complex Object between WebServices (inside the same WebApp)

I started from teh beggining and using servlets I could managed to do so
... that is.
1. PreLoad the servlet
2. Write a caching servlet and register the MemeoryModel in ServeltContext
3. Write a Servlet that could (pretend to be a WS)
4, the last task is extreamly hard I looked throuh kSOAP, JAXM and so on
but the i do not need the servet to understand SOAP but to be
a WS?
In such case can Axis help me?
Or even simplier task.... can Axis WS see a servlet context and register
internally my MemeoryModel?

Thanks For any help

mchm


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