Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PATH_INFO in messagecontext getting retrieved as null

 
Ranadhir Nag
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Randhir,
I see there is no Servelt - Servlet Class mapping. What is that missing bit?

 
Ranadhir Nag
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic