Hi,
I am new to webservices.
Assume in a j2ee container one web application is running.
Also there is a web servie running as well in the same box.
Assume there is a application scope variable in the above web application (eg.static variable).
The question is can the web service access that variable and update.
Waiting for a quick solution.
Thanks
-
Can the webservice do the following (4 messages)
- Posted by: Navee Navee
- Posted on: April 07 2005 02:53 EDT
Threaded Messages (4)
- Can the webservice do the following by sithu aung on April 07 2005 06:45 EDT
- Can the webservice do the following - Further explanation by Navee Navee on April 08 2005 00:47 EDT
-
Can the webservice do the following - Further explanation by Saqib Rasul on April 08 2005 04:52 EDT
- Can the webservice do the following - Further explanation by Navee Navee on April 09 2005 12:19 EDT
-
Can the webservice do the following - Further explanation by Saqib Rasul on April 08 2005 04:52 EDT
- Can the webservice do the following - Further explanation by Navee Navee on April 08 2005 00:47 EDT
-
Can the webservice do the following[ Go to top ]
- Posted by: sithu aung
- Posted on: April 07 2005 06:45 EDT
- in response to Navee Navee
Hi,
If you are building Web services over Apache Axis servlet or adding Web service calls on existing JSP/Servlets, then you can use any static variable from the application code in your web service calls. In axis, you can access HttpServletRequest.
Here is a little piece of code.
/**
* demo message context stuff
* @return list of request headers
*/
public String[] list() {
HttpServletRequest request = getRequest();
Enumeration headers=request.getHeaderNames();
ArrayList list=new ArrayList();
while (headers.hasMoreElements()) {
String h = (String) headers.nextElement();
String header=h+':'+request.getHeader(h);
list.add(header);
}
String[] results=new String[list.size()];
for(int i=0;i<list.size();i++) {
results[i]=(String) list.get(i);
}
return results;
}
Sithu -
Can the webservice do the following - Further explanation[ Go to top ]
- Posted by: Navee Navee
- Posted on: April 08 2005 00:47 EDT
- in response to sithu aung
Hi,
What I meant was whether the Web service can access the variable(scope is Application) which resides in a different web application.
The following answer is all about getting a request object.
Other thing is for the web services will be host in WebLogic. We do not use Apache Axis.
Waiting for early reply.
Lalith -
Can the webservice do the following - Further explanation[ Go to top ]
- Posted by: Saqib Rasul
- Posted on: April 08 2005 04:52 EDT
- in response to Navee Navee
if the web application is in a different to that which will host the Web Service, then it seems that it is not possible to share information. Correct me if i am wrong.
If you have control over the application then you can build a web service into it and redeploy it. If the Web service and some variable are in the same web app, then it it much easier.
Hope this helps,
Saqib
http://galaxy.sagadc.com/
- Create Web Services in 15 minutes - -
Can the webservice do the following - Further explanation[ Go to top ]
- Posted by: Navee Navee
- Posted on: April 09 2005 00:19 EDT
- in response to Saqib Rasul
My argument is Web service runs in a different context and the web application runs in a different context.
Due to this reason the web service cannot access the variable in the web application.
Let me know if am wrong.