import javax.xml.namespace.QName;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
/**
*
* 功能描述:
* 时间:2013-8-21
* @author:zengxinliang
*/
public static String sendMsg(String method,String param1,String param2)throws Exception{
String url=Global.getPath("lc_url");//联创url
String result="";
String sendParam=null;
String sendContent="";
if(method.equals("StaLogon")||method.equals("StaLogout")){//站点登录或者退出
sendParam="pStaInfoXml";
sendContent="<?xml version='1.0' encoding='utf-8'?><Root><StaInfo><StaNo>"+param1+"</StaNo><TerminalNum>"+param2+"</TerminalNum></StaInfo></Root>";
}else if(method.equals("CheckUserByCardNo")){
sendParam="pCheckUserReqXml";
sendContent="<?xml version='1.0' encoding='utf-8'?><Root><CheckUserReq><Key>"+param1+"</Key><PassWord>"+param2+"</PassWord></CheckUserReq></Root>";
}
Service service = new Service();
Call call=(Call)service.createCall();
call.setTargetEndpointAddress(url);//webservice路径
call.setOperationName(new QName("http://tempuri.org/ns1.xsd",method));//method接口名称new QName("http://tempuri.org/ns1.xsd",method)命名空间
call.addParameter(sendParam, org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);//方法参数
result=(String)call.invoke(new Object[]{sendContent});
return result;
}