aspose file tools*
The moose likes Web Services and the fly likes PATH_INFO in messagecontext getting retrieved as null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "PATH_INFO in messagecontext getting retrieved as null" Watch "PATH_INFO in messagecontext getting retrieved as null" New topic
Author

PATH_INFO in messagecontext getting retrieved as null

Ranadhir Nag
Ranch Hand

Joined: Mar 09, 2006
Posts: 138
We have a JAX-WS Provider<Source> based webservice hosted in weblogic 10.3.

@WebServiceProvider(targetNamespace = "http://wl-spot.com/wsSamples/restfulWebService1", serviceName = "RestfulWS")
@BindingType(value = HTTPBinding.HTTP_BINDING)
public class RestfulWS implements Provider<Source> {
public RestfulWS()
{

System.out.println("Inside RestfulWS ctor");
}

public Source invoke(Source source) {
try {

System.out.println("Inside RestfulWS invoke;");
MessageContext messageContext = wsContext.getMessageContext();
String requestMethod = (String) messageContext.get(MessageContext.HTTP_REQUEST_METHOD);
String query = (String) messageContext.get(MessageContext.QUERY_STRING);
String path = (String) messageContext.get(MessageContext.PATH_INFO);
.....
....

Though we retrieve the querystrings and request method successfully,the path info is always getting retrieved as null.

The web.xml is as follows:



<?xml version='1.0' encoding='UTF-8'?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5">
<display-name>RestfulWSWebApp</display-name>
<servlet-mapping>
<servlet-name>RestfulWSServlethttp</servlet-name>
<url-pattern>/RestfulWS/*</url-pattern>
</servlet-mapping>
</web-app>


Where are we going wrong.
Any help is appreciated.




Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 577

Hi Randhir,
I see there is no Servelt - Servlet Class mapping. What is that missing bit?


Cheers,
Naren
(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)
Ranadhir Nag
Ranch Hand

Joined: Mar 09, 2006
Posts: 138
God catch.But the service perse is working fine.
So I believe for Provider based JAX-WS services,the servlet is auto-discovered during deployment?

Not sure - will appreciate comments.
But even if the implementation class is specifically mentioned in the servlet-class mapping,it does not resolve the PATH_INFO problem.
Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 577

Hi Ranadhir,
So I believe for Provider based JAX-WS services,the servlet is auto-discovered during deployment?

Not sure how it is different from provider to provider. But, if you can see web.xml being generated by your provider and have url mapping details. I'm sure you should also see servlet-class mapping.

But even if the implementation class is specifically mentioned in the servlet-class mapping,it does not resolve the PATH_INFO problem.

Is your web service working? What MessageContext you are using? (logical or SOAP)

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: PATH_INFO in messagecontext getting retrieved as null