ACS服务的搭建
ACS服务器的创建:
package com.comba.hms.comm.cwmp.south;import java.io.IOException;import java.util.Enumeration;import java.util.StringTokenizer;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import javax.xml.soap.MimeHeaders;import org.apache.log4j.Logger;import com.comba.hms.comm.cwmp.cache.service.LocalCwmpCache;import com.comba.hms.common.helper.CommonPropertiesHelper;import com.comba.hms.protocol.cwmp.MessageBody;import com.comba.hms.protocol.cwmp.ParseMessageHandler;import com.comba.hms.protocol.cwmp.ValidateResult;import com.comba.hms.protocol.cwmp.message.Message;/** * 【ACS servlet服务】 * * @version * @author fdy 2010-3-22 下午03:41:15 * */public class ACSServlet extends HttpServlet {private static final long serialVersionUID = 4564721134868353486L;private static final Logger log = Logger.getLogger(ACSServlet.class);private static String sessionIdFlag = null;static {try {// 进行配置,防止不同servlet容器生成的标识不一样sessionIdFlag = CommonPropertiesHelper.getSessionIdFlag();} catch (Exception e) {log.error(e.getMessage(), e);}};public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {}public void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {try {// 解析消息体MimeHeaders headers = getHeaders(request);MessageBody messageBody = ParseMessageHandler.parseMessageBody(request, headers);} catch (Exception ex) {log.error(ex.getMessage(), ex);throw new ServletException("JAXM POST failed;");}}}
<servlet><servlet-name>ACSServlet</servlet-name><servlet-class>com.comba.hms.comm.cwmp.south.ACSServlet</servlet-class><load-on-startup>1</load-on-startup></servlet><servlet-mapping><servlet-name>ACSServlet</servlet-name><url-pattern>/ACSServlet</url-pattern></servlet-mapping>