1.编写接口
注意使用 @WebService注解
@WebService
public interface DynamicRegistrationNotifyInterface {
/**
* demo 查看服务是否正常
* @param InMsg
* @return
*/
public String thirdPushDemoInfo(@WebParam(name="InMsg")String inMsg);
/**
* @param InMsg
* @return
*/
public String thirdPushScheduleInfo(@WebParam(name="InMsg")String inMsg);
/**
*/
public String thirdPushStopReplaceInfo(@WebParam(name="InMsg")String inMsg);
}
2.接口实现类
@WebService
public class WebserviceRecMessageImpl implements DynamicRegistrationNotifyInterface {
private static final Logger logger =LoggerFactory.getLogger(WebserviceRecMessageImpl.class);
private XmlUtils xmlUtils;
private DynamicRegistrationNotifyService dynamicRegistrationNotifyService;
public WebserviceRecMessageImpl(XmlUtils xmlUtils,DynamicRegistrationNotifyService dynamicRegistrationNotifyService){
this.xmlUtils = xmlUtils;
this.dynamicRegistrationNotifyService = dynamicRegistrationNotifyService;
}
@Override
public String thirdPushDemoInfo(String inMsg) {
logger.info(">>>>>>>>进入thirdPushDemoInfo推送消息:" + inMsg);
// code:1成功,-1失败
StringBuffer result = new StringBuffer();
String code = "1";
Stri