调用webservice时,用main函数可成功,放到servlet里调用,不能成功且无报错
web项目MyWebPro,web.xml为:
MyWebPro
apn
com.cjq.servlet.APNServlet
apn
/*
index.html
APNServlet如下:
package com.cjq.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.cjq.push.PushBean;
import com.cjq.push.PushUtils;
public class APNServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String username = req.getParameter("username");
String msg = req.getParameter("message");