Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Currently the Jetty HTTP SPI JAX-WS implementation doesn't appear to properly inject the MessageContext into a web service. Try switching to Apache CXF instead. Once you have </p> <ol> <li>cxf-2.6.2.jar</li> <li>neethi-3.0.2.jar</li> <li>xmlschema-core-2.0.3.jar</li> </ol> <p>on your project build path, you have to create a servlet class that extends the CXFNonSpringServlet and overrides the loadBus function like so:</p> <pre><code>public class SOAPServlet extends CXFNonSpringServlet { private static final long serialVersionUID = 1L; private Map&lt;String, Object&gt; endpoints; public SOAPServlet(){ endpoints = new HashMap&lt;String, Object&gt;(); } @Override public void loadBus(ServletConfig servletConfig) { super.loadBus(servletConfig); // You could add the endpoint publish codes here Bus bus = getBus(); BusFactory.setDefaultBus(bus); Set s = endpoints.entrySet(); Iterator p = s.iterator(); while(p.hasNext()){ Map.Entry m = (Map.Entry)p.next(); String address = (String)m.getKey(); Object impl = (Object)m.getValue(); System.out.println("Publishing " + address); Endpoint.publish(address, impl); } } public void publish(String address, Object impl){ endpoints.put(address, impl); } } </code></pre> <p>And then where you are configuring your server, add these lines:</p> <pre><code> Server server = new Server(8080); // Configure SOAP servlet SOAPServlet servlet = new SOAPServlet(); ServletHolder SOAPServletHolder = new ServletHolder(servlet); ServletContextHandler SOAPContext = new ServletContextHandler(server,"/",ServletContextHandler.SESSIONS); SOAPContext.addServlet(SOAPServletHolder, "/*"); // Set server context handlers ContextHandlerCollection contexts = new ContextHandlerCollection(); contexts.setHandlers(new Handler []{SOAPContext}); server.setHandler(contexts); // Publish SOAP Web service endpoints servlet.publish("/MyWebServiceRelativeURL", new MyWebServiceImpl()); server.start(); server.join(); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload