钉钉消息发送
来源:互联网 发布:macola软件字段表 编辑:程序博客网 时间:2024/06/02 10:55
package com.lingsheng.AppServices;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.ServiceException;
import javax.xml.rpc.encoding.XMLType;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import com.lingsheng.AppServices.daoImpl.DingDingUserDaoImpl;
import com.lingsheng.AppServices.daoImpl.EasPersonDaoImpl;
import com.lingsheng.AppServices.entity.DingDingUser;
import com.lingsheng.AppServices.entity.EasPerson;
/**
* 调接口测试类
* <p>Title: DingDingPush </p>
* <p>Description: </p>
* <p>Company: </p>
* @作者: ou.yang.ling
* @时间: 2017-6-5 上午10:33:04
*/
public class DingDingPush{
public static String ADVerification(String userIDS,String Content) {
String url="http://oa.tlgchina.com:8081/Lstechservice.asmx"; //连接地址
String obj=null;
String method ="setDingTalk";
Service service = new Service();
Call call ;
try {
call = (Call)service.createCall();
call.setTargetEndpointAddress(url);
//指定接口
call.setOperationName(new QName("http://oa.tlgchina.com:8081/",method));
call.addParameter(new QName("http://oa.tlgchina.com:8081/","userIDS"), XMLType.SOAP_STRING, ParameterMode.IN);// 给call对象设置方法的参数名、参数类型、参数模式
call.addParameter(new QName("http://oa.tlgchina.com:8081/","Content"), XMLType.SOAP_STRING, ParameterMode.IN);// 给call对象设置方法的参数名、参数类型、参数模式
call.setReturnType(XMLType.SOAP_STRING);// 设置调用方法的返回值类型
call.setUseSOAPAction(true); //打开接口
call.setSOAPActionURI("http://oa.tlgchina.com:8081/setDingTalk");
obj =(String)call.invoke(new Object[]{userIDS,Content});
System.out.println(obj);
} catch (Exception e) {
e.printStackTrace();
}
return obj;
}
public static void main(String[] args) throws ServiceException, javax.xml.rpc.ServiceException {
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String createdate = sdf.format(date);
ADVerification("072603480227582790",createdate+"测试测试");
}
}
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.ServiceException;
import javax.xml.rpc.encoding.XMLType;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import com.lingsheng.AppServices.daoImpl.DingDingUserDaoImpl;
import com.lingsheng.AppServices.daoImpl.EasPersonDaoImpl;
import com.lingsheng.AppServices.entity.DingDingUser;
import com.lingsheng.AppServices.entity.EasPerson;
/**
* 调接口测试类
* <p>Title: DingDingPush </p>
* <p>Description: </p>
* <p>Company: </p>
* @作者: ou.yang.ling
* @时间: 2017-6-5 上午10:33:04
*/
public class DingDingPush{
public static String ADVerification(String userIDS,String Content) {
String url="http://oa.tlgchina.com:8081/Lstechservice.asmx"; //连接地址
String obj=null;
String method ="setDingTalk";
Service service = new Service();
Call call ;
try {
call = (Call)service.createCall();
call.setTargetEndpointAddress(url);
//指定接口
call.setOperationName(new QName("http://oa.tlgchina.com:8081/",method));
call.addParameter(new QName("http://oa.tlgchina.com:8081/","userIDS"), XMLType.SOAP_STRING, ParameterMode.IN);// 给call对象设置方法的参数名、参数类型、参数模式
call.addParameter(new QName("http://oa.tlgchina.com:8081/","Content"), XMLType.SOAP_STRING, ParameterMode.IN);// 给call对象设置方法的参数名、参数类型、参数模式
call.setReturnType(XMLType.SOAP_STRING);// 设置调用方法的返回值类型
call.setUseSOAPAction(true); //打开接口
call.setSOAPActionURI("http://oa.tlgchina.com:8081/setDingTalk");
obj =(String)call.invoke(new Object[]{userIDS,Content});
System.out.println(obj);
} catch (Exception e) {
e.printStackTrace();
}
return obj;
}
public static void main(String[] args) throws ServiceException, javax.xml.rpc.ServiceException {
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String createdate = sdf.format(date);
ADVerification("072603480227582790",createdate+"测试测试");
}
}
阅读全文
0 0
- 钉钉消息发送
- 钉钉接口发送消息失败
- Python实现钉钉发送报警消息
- 钉钉发送信息脚本
- 钉钉消息推送教程
- 钉钉企业消息开发
- 【广告项目】钉钉实现发送通知
- 钉钉的API
- 钉钉打卡神器
- 钉钉机器人
- 钉钉自定义机器人
- 钉钉报警
- 钉钉定时打卡
- 钉钉子
- 钉钉的功能介绍
- 钉钉机器人自动提醒
- 钉钉平台接入文档
- C# 钉钉系列目录
- J2EE 解决MySQL中文乱码问题
- 记一次bug:错误: 找不到或无法加载主类 Test
- CentOS安装JDK
- python3下使用mysql
- Hybrid APP混合开发的一些经验和总结
- 钉钉消息发送
- 学习vuejs的第一天(vuejs)
- 从输入URL到显示页面,发生了什么?
- 百度定位获取不到坐标,返回码162
- web.xml报错
- Android命令行签名记录
- oracle 数据库常用语句
- 存储过程进行数据分页
- java 深入理解注解