• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to Start with WebServices:Getting No JAX-WS context information available:Please Help

 
Rashmita Sahu
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am unable to start with WebServices:
below are the exact steps I followed:
1-Created an Interface:
package ts;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
@WebService
@SOAPBinding(style=Style.RPC)
public interface TimeServer {
@WebMethod String getTimeAsString();
@WebMethod long getTimeAsElapsed();

}

2-Created Implementaion Class
package ts;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
import java.util.Date;

@WebService(endpointInterface = "ts.TimeServer")
@SOAPBinding(style=Style.RPC)
public class TimeServerImpl implements TimeServer{
public String getTimeAsString()
{
return new Date().toString();
}

public long getTimeAsElapsed()
{
return new Date().getTime();
}
}
3-Created the Publisher:
package ts;
import javax.xml.ws.Endpoint;

public class TimeServerPublisher {

public static void main(String[] args) throws Exception
{
Endpoint endpoint=Endpoint.publish("http://localhost:9888/ts", new TimeServerImpl());
System.out.println("******************DONE*********************"+endpoint.isPublished());
}
}
I ran the above standalone class and then when i tried opening http://localhost:9888/ts or http://localhost:9888/ts/wsdl in browser ,its giving "No JAX-WS context information available." error

I am totally new to Web Services .Please help me.

Please let me know about sites or ebooks etc which can help me to learn.

In future ,I want to write the Certification exam for Web Services
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!