package com.mycompany.myproject; import javax.servlet.*; import javax.servlet.http.*; import javax.xml.ws.*; import javax.naming.*; public class ServletClient extends HttpServlet { MTOMTest1 port1_1 = null; public void init(ServletConfig config) throws ServletException { super.init(config); try { InitialContext ctx = new InitialContext(); port1_1 = (MTOMTest1) ctx.lookup("java:comp/env/service/port1_1"); } catch(Exception e) { e.printStackTrace(); } } public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { // do something with port1_1 JAXWS proxy } public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { doGet(req, res); } }