
2 changed files with 56 additions and 0 deletions
@ -0,0 +1,52 @@ |
|||
package com.yxt.messagecenter.biz.utils; |
|||
|
|||
import com.yxt.anrui.portal.api.sms.SmsFeign; |
|||
import org.apache.axis.client.Call; |
|||
import org.apache.axis.client.Service; |
|||
import org.apache.axis.encoding.XMLType; |
|||
|
|||
import javax.xml.namespace.QName; |
|||
|
|||
/** |
|||
* @author dimengzhe |
|||
* @date 2020/9/11 8:59 |
|||
* @description 发送短信调用接口 |
|||
*/ |
|||
public class MsgWs { |
|||
public static String SendWaitWorkMsg(String mobile, String msg) { |
|||
try { |
|||
|
|||
String urlname = "http://sdk1.mb345.com/ws/LinkWS.asmx"; |
|||
String soapActionURI = "http://tempuri.org/BatchSend"; |
|||
Service s = new Service(); |
|||
Call call = (Call) s.createCall(); |
|||
call.setTimeout(new Integer(5000)); |
|||
call.setUseSOAPAction(true); |
|||
call.setSOAPActionURI(soapActionURI); |
|||
// wsdl中接口名称
|
|||
call.setOperationName(new QName("http://tempuri.org/", "BatchSend")); |
|||
call.setTargetEndpointAddress(urlname); |
|||
call.addParameter(new QName("http://tempuri.org/", "CorpID"), XMLType.XSD_STRING, |
|||
javax.xml.rpc.ParameterMode.IN); |
|||
call.addParameter(new QName("http://tempuri.org/", "Pwd"), XMLType.XSD_STRING, |
|||
javax.xml.rpc.ParameterMode.IN); |
|||
call.addParameter(new QName("http://tempuri.org/", "Mobile"), XMLType.XSD_STRING, |
|||
javax.xml.rpc.ParameterMode.IN); |
|||
call.addParameter(new QName("http://tempuri.org/", "Content"), XMLType.XSD_STRING, |
|||
javax.xml.rpc.ParameterMode.IN); |
|||
call.addParameter(new QName("http://tempuri.org/", "Cell"), XMLType.XSD_STRING, |
|||
javax.xml.rpc.ParameterMode.IN); |
|||
call.addParameter(new QName("http://tempuri.org/", "SendTime"), XMLType.XSD_STRING, |
|||
javax.xml.rpc.ParameterMode.IN); |
|||
// String[] fn01 = {"YXT010045", "yuxintonghygl", mobile, msgtitle+msg+msgSign, "", ""};
|
|||
String[] fn01 = {"YXT011852", "yxt_ar230314", mobile, msg+ SmsFeign.msgSign, "", ""}; |
|||
String val = (String) call.invoke(fn01); |
|||
// String val = "-1";//用于先去掉短信功能,不发短信
|
|||
return val; |
|||
|
|||
} catch (Exception e) { |
|||
return e.getMessage(); |
|||
|
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue