@RequestMapping(value = "loginInSSO", method = RequestMethod.GET)
public String loginInSSO(Cookyjar cookyjar, HttpServletRequest request, @Param("data")String data, HttpServletResponse response) {
HttpUtils client= HttpUtils.getInstance();
// String xml = HttpUtils.beanToXml(reqsObj, ReqsObj.class);
String xml = "";
// String xml = "<phone>123</phone><password>123</password>";
String md5Pwd = AlgorithmUtils.computeMD5("123");
// String msg = client.sendHttpPost("http://117.149.16.172:20004/xct/login.htm?phone=123&password=123", xml);
String msg = client.sendHttpPost("http://117.149.16.172:20004/xct/login.htm?phone=123&password=" + md5Pwd, xml);
logger.info("测试msg:" + msg);
// JSONObject jsonObject = JSONObject.fromObject(msg);
Msg dataObj = (Msg)JSONUtils.parse(msg);
return "redirect:" + bossIndexUrl;
}
、、、、、、、、、、、、、、、、、、、、
package com.jianwu.xct.common;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.entity.mime.content.StringBody;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import java.io.File;
import java.io.IOException;
import java.io.Reader;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by heyingchun on 2017/8/15.
*/
public class HttpUtils {
public final static String connectionUrl="http://223.105.4.67:7100/ds/V1/api/si/siApplicationJQ";
public final static String key="0808E973";
public final static String appid="da678da55f364e3a8de9ffe662127163";
public final static String siid="636c0812879a42e58c77474577bf26d2";
public static String APP00002="<?xml version='1.0' encoding='UTF-8'?>\n"+
"<Msg>\n"+
"<Head>\n"+
"<Code>APP00002</Code>\n" +
"<CTID>4591_20170822092257409_A9F6</CTID>\n"+
"<EcProvince>650000</EcProvince>\n" +
"<AppID>da678da55f364e3a8de9ffe662127163</AppID>\n" +
"<SubmitTime>20170822092257404</SubmitTime>\n" +
"<Version>1</Version>\n" +
"<Priority>10</Priority>\n" +
"</Head>\n" +
"<Body>Dc4SU2qmJzNI9VyLDsU/F8Jh77Nvt/cbmC+sxtvxoIMHkZFOkmdKCU6nvnl5/oOuYekPZ+XL6II8\n" +
"mYeBDqtd+Gy4Pt0EHFEXW8rH2UepV6dZp8G4ZAN19zgoKc1nGDADTSwfHNb4wtTTgcpaOzTuJX7/\n" +
"OHiWu5ALX654MZMqUcDB8FLEjV7NzUfCuMVpvvQ1vsc5u2j5yzOUtIxwEFvh07gSxFOlZH7PakzP\n" +
"/Ap+pLXp7azbMvIWr+a2K9ZSmeEeklOygXJNeSXr8/rPh9/esUv8NSC35RMYXZvl0CjabLtGZ5Qx\n" +
"BiEhQSmCV+EKbqPNa0CiTNROYVL6xBVr5YZH4owzqtjGgnHHuytIHmeXmS3CZQp12+3z/ASflHlA\n" +
"WY5LAxe7W4XVBNXBL/Lz3N1C+1M9YeDXv/f/B5/cKwB/07yohDW/Ql6WBujJuMs8U9Kqg76DyiM2\n" +
"/JYrYcuX1LwrIUfUZE19CUSXvTgdFMDPzF71luYNhPXU0HASPw1q3Ti9EtYNvIMgi8sSigme1EGk\n" +
"LbUOfTV//OOJ4nVIySgCPFw=</Body>\n" +
"</Msg>";
public static String ssoReqMsgbody="aCIQAnPlUl7y5TqYYX2XjCVACodp97rBzrc+4uVBWX7WE1IBYND3DG9wlvJwtz4z8BaIb8aJd+Km\n" +
"hm9b1zzJmkuaSJ9SgS7QzXpYJKWSfvMOzMTGmY9XCO7kOLaXCCzVZgew1dLH4sOJPUqBxtwOCWmk\n" +
"RKQteSYt7gdm6v+9Ll5D8IvP+bxogdKxcla58qqzA0bOlRpjX/MBelIZCA6U2m970JwvSztTREC+\n" +
"Bv9TEDRiYm2urpxo5BqpemkIgTTCAtME2Kf/9ObEN3PZugyXtrNsO0Cux6TKPWj1DnmvRzFSCMji\n" +
"WVlqBzsxX63zENieqRj65NvWaDMM9z6UAQh2r8O7vHT2Z/lu8fZP3bt3LZ3tKCRkHy+vedXiKDQi\n" +
"S7hh9UIW0gqZlvyz+c8FSERaJ8eLNw5BvywJN12K06b++1/s9BuBtWLqNMohdJhhLUjroQqsdSCX\n" +
"2X6eZaQ2cnBTIioI16R5yyAMKFfAK01+M9wn/vY/dQTk2Sjnrmgf3JYcYzylyyL1n7uDGf1Eku+7\n" +
"VQ==";
public static String ssoRespMsg="<Msg><Head><Code>SYS00001</Code><CTID>2017052310371120</CTID><STID/><AppID>da678da55f364e3a8de9ffe662127171</AppID><RequestTime/><ResponseTime/><Version>1</Version><Priority>10</Priority><Status/><EcProvince/></Head><Body>GajDfg7Y05wnxhUYwLjvgC2QuHbjdSaaej6GI7R6VJ5ZmHVoAQps5gLFa+UWrIY9j9/ONkQloP0Q\n" +
"q+VhsQcAG6yrkBY4MotVB+1p78Fr5g2VJ2aEr0qDHwekscHyICvwagI1axskgHAuDwFhJMSgDmbM\n" +
"NV4OfGRMA7Z5QmoLS0plXgIxVRLtFsddJs5XLMI2InrjPuGMWiwJ9Ozau1FxJLD3NeCIFusREKgU\n" +
"9kd7+snvJ8bJFYRsLA==</Body></Msg>";
public static String XMLBOYD="<MsgSN>ff55f7adfd9a4db0a28535174f578bc1</MsgSN>\n"+
"<MemberList>\n"+
"<MemberInfo>\n"+
"<ID>40608493</ID>\n"+
"<OPType>01</OPType>\n"+
"<UserName>13679331352</UserName>\n"+
"<EcID>931330004921</EcID>\n"+
"<Name>赵霞</Name>\n"+
"<Phone>13679331352</Phone>\n"+
"<Email></Email>\n"+
"<FaxNum></FaxNum>\n"+
"<Addr></Addr>\n"+
"<GroupID>353522979A1AC13F0131218102546159</GroupID>\n"+
"<OprTime>20170822092257409</OprTime>\n"+
"</MemberInfo>\n"+
"</MemberList>";
public final static String ss="LSdWmPIokRCLsjrZa55YvSi51LUGzpHqzOqb8EOWKmXE4t+dnydNQpLtGoT1deNRGU+Fa0O0aalx\n" +
"xGZge2eqwF4PzJ7Y1tTVf99VTpIEyGb915PQeO0ACYS6gZSBZt0Ue2qBsTMDD4c=";
public final String ok="0000";
public final static String bodyxml="<?xml version='1.0' encoding='UTF-8'?><Msg><Head>" +
"<Code>APP00001</Code><CTID>2017050600000006</CTID><AppID>da678da55f364e3a8de9ffe662127163</AppID>" +
"<SubmitTime>20170506153135556</SubmitTime><Version>0100</Version><Priority>10</Priority>" +
"<EcProvince>630000</EcProvince></Head><Body>yMQMOeOXkzgWc8xDKnfxfLo2tEeNVFkzaZMUdhFQsDdCwGKPbDrR" +
"D/dGUFdCXjNHTYkfjcLjhaRp\n" +
"NOZ4HlMEnZlLfvJatzCLKBpfBTo7F29nVdjmvFwLdwguAEZaz3d/RpvTprJVomE42IUFVunkx5TI\n" +
"EeGfEVDPGDs1F9b2RNm5AmTEVnZrPyX1ugDPD8sZ5cwGYZrQL1h83kROJtvb6e1NlFLg2hoqVviO\n" +
"mrEWUbB2DXrfLsPpQV35fFnOAnDX3JHEdddflCR9vAUsxDpXv38z51fd2DVYnoprDwrK5CDVpflT\n" +
"Hi+2iblIVguAwu5oYJLOPP7bG3yT/kD6aMD5pfu+VS+x9Y4b4Yf7MMMVQiWYhzyu93JNB4aAQGxr\n" +
"95v8ocX+EU8FMlPe5KFKeBstgyTPgwhIDjlO4AikRQDh99emmbhqyR+okf3iO031zRyx68CICk8q\n" +
"fwgs+19Q9fK3hWC1oVhN7tXA206QWLzn6z1RXhWy0KsCB0xSuP/lzlPzfcQgooHitC6jFZLoMX5Y\n" +
"XloblCFO7KD/H8/Wv2D7GHal5I5+c4tz3O6meS/DlIfFaiO3lCBnpDUA7VtexAfKcICiDe9vHCRv\n"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"yw/V2wOVzfRTcs5tbvjMyaW/BlxDrNP3h66bBklr7PknnJFxxHLAVSfGxY6u6GpavMYjO3nSGBB5\n" +
"5S4/3vce1fnD6386z+UEUNFzYBL68M+F2XK4EgrNOTwGp/7B1l04kzEqqSVqwi6R6SAozIzepCEF\n" +
"GUF3h4zD1DbY69hSqGDCaM5ABw8mqoc1Hwq6Gas7mbWcN8uB9+DzNAmKjQ84BTBjeqVF0lJPSE0C\n" +
"rnSMc09VLeshqrTX24GkvgksP/7DWQ==";
public Map staticstaticRsMap=new HashMap();
private RequestConfig requestConfig = RequestConfig.custom()
.setSocketTimeout(30000)
.setConnectTimeout(30000)
.setConnectionRequestTimeout(30000)
.build();
private static HttpUtils instance = null;
private HttpUtils(){
}
public static HttpUtils getInstance(){
if (instance == null) {
instance = new HttpUtils();
}
return instance;
}
/**
* 发送 post请求
* @param httpUrl 地址
*/
public String sendHttpPost(String httpUrl) {
HttpPost httpPost = new HttpPost(httpUrl);// 创建httpPost
return sendHttpPost(httpPost);
}
/**
* 发送 post请求
* @param httpUrl 地址
* @param params 参数(格式:key1=value1&key2=value2)
*/
public String sendHttpPost(String httpUrl, String params) {
HttpPost httpPost = new HttpPost(httpUrl);// 创建httpPost
try {
//设置参数
StringEntity stringEntity = new StringEntity(params, "UTF-8");
stringEntity.setContentType("text/xml");
httpPost.setEntity(stringEntity);
} catch (Exception e) {
e.printStackTrace();
return "-1";
}
return sendHttpPost(httpPost);
}
/**
* 发送 post请求
* @param httpUrl 地址
* @param maps 参数
*/
public String sendHttpPost(String httpUrl, Map<String, String> maps) {
HttpPost httpPost = new HttpPost(httpUrl);// 创建httpPost
// 创建参数队列
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
for (String key : maps.keySet()) {
nameValuePairs.add(new BasicNameValuePair(key, maps.get(key)));
}
try {
httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs, "UTF-8"));
} catch (Exception e) {
return "-1";
}
return sendHttpPost(httpPost);
}
/**
* 发送 post请求(带文件)
* @param httpUrl 地址
* @param maps 参数
* @param fileLists 附件
*/
public String sendHttpPost(String httpUrl, Map<String, String> maps, List<File> fileLists) {
HttpPost httpPost = new HttpPost(httpUrl);// 创建httpPost
MultipartEntityBuilder meBuilder = MultipartEntityBuilder.create();
for (String key : maps.keySet()) {
meBuilder.addPart(key, new StringBody(maps.get(key), ContentType.TEXT_PLAIN));
}
for(File file : fileLists) {
FileBody fileBody = new FileBody(file);
meBuilder.addPart("files", fileBody);
}
HttpEntity reqEntity = meBuilder.build();
httpPost.setEntity(reqEntity);
return sendHttpPost(httpPost);
}
/**
* 发送Post请求
* @param httpPost
* @return
*/
private String sendHttpPost(HttpPost httpPost) {
CloseableHttpClient httpClient = null;
CloseableHttpResponse response = null;
HttpEntity entity = null;
String responseContent = null;
try {
// 创建默认的httpClient实例.
httpClient = HttpClients.createDefault();
httpPost.setConfig(requestConfig);
// 执行请求
response = httpClient.execute(httpPost);
entity = response.getEntity();
responseContent = EntityUtils.toString(entity, "UTF-8");
} catch (Exception e) {
e.printStackTrace();
return "-1";
} finally {
try {
// 关闭连接,释放资源
if (response != null) {
response.close();
}
if (httpClient != null) {
httpClient.close();
}
} catch (IOException e) {
e.printStackTrace();
return "-1";
}
}
return responseContent;
}
public static String beanToXml(Object obj, Class<?> load) throws JAXBException {
JAXBContext context = JAXBContext.newInstance(load);
Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
StringWriter writer = new StringWriter();
marshaller.marshal(obj,writer);
return writer.toString();
}
public static String toBodyXml(Object obj, Class<?> load) throws JAXBException {
String xml=beanToXml(obj,load);
String bodyXml= xml.substring(6,xml.length()-7);
bodyXml= bodyXml.replace("\n", "").replace(" ","").replace("\t","").replace("\r","");
return bodyXml;
}
public static Object xmlToBean(Reader reader, Class<?> load) throws JAXBException, IOException {
JAXBContext context = JAXBContext.newInstance(load);
Unmarshaller unmarshaller = context.createUnmarshaller();
Object object = unmarshaller.unmarshal(reader);
return object;
}
//public static String generate
public static void main(String[] args) {
HttpUtils httpUtils = HttpUtils.getInstance();
/* BodyObj bodyOby=new BodyObj();
bodyOby.setAppID("asdfasd");
bodyOby.setSIID("asdfas");
bodyOby.setTicket("asdfasfd");
HttpUtils httpUtils= HttpUtils.getInstance();
try {
String xml=HttpUtils.toBodyXml(bodyOby,BodyObj.class);
xml="<Body>"+xml+"</Body>";
System.out.println(xml);
StringReader reader=new StringReader(xml);
BodyObj b=(BodyObj)HttpUtils.xmlToBean(reader,BodyObj.class);
System.out.println(b.getAppID());
}catch (Exception e){
e.printStackTrace();
}*/
/* ContextBean contextBean=new ContextBean();
Head head=contextBean.getHead();
head.setAppId("da678da55f364e3a8de9ffe662127163");
head.setCode("APP00005");
head.setCtId("asdfasd");
head.setPriority("10");
head.setVersion("1");
head.setSubmiTime("20170817145200575");
contextBean.setBody("asdfasdfasdfasdfasdf");
String convertObjToXml= XmlAndObjConverter.convertObjToXml(contextBean);
System.out.println("convertObjToXml-->"+convertObjToXml);*/
try {
// http://111.12.86.150/boss/execute.htm
// System.out.println("ssoReqMsg-->\n" + ssoReqMsg);
String bodyxml="<MsgSN>ff55f7adfd9a4db0a28535174f578bc1</MsgSN>" +
"<EcOrderInfo>" +
"<OPType>01</OPType>" +
"<OPNote>kaihu</OPNote>" +
"<EcID>931330004921</EcID>" +
"<EcInfo>" +
"<OprType>01</OprType>" +
"<EcName>企业客户名称</EcName>" +
"<AdminAccount>企业管理员登录帐号</AdminAccount>" +
"<AdminName>企业管理员姓名</AdminName>" +
"<AdminSex>管理员性别</AdminSex>" +
"<AdminPhone>企业管理员手机号码</AdminPhone>" +
"<AdminEmail>企业管理员Email</AdminEmail>" +
"<AdminAddr>企业管理员地址</AdminAddr>" +
"<LinkmanName>企业联系人姓名</LinkmanName>" +
"t<LinkmanFax>企业联系人传真</LinkmanFax>" +
"<LinkmanEmail>企业联系人Email</LinkmanEmail>" +
"<LinkmanTel>企业联系人联系电话</LinkmanTel>" +
"</EcInfo>" +
"<OrderInfo>" +
"<OrderID>订单ID(订单流水号)</OrderID>" +
"<OrderCode>订单编号(BOSS订单信息唯一标识)</OrderCode>" +
"<ProdID>产品ID</ProdID>" +
"<AppID>应用ID</AppID>" +
" <FeeType>计费类型</FeeType>\n" +
"<OrderStatus>订单状态</OrderStatus>\n" +
"<EffectDate>生效时间(yyyyMMdd)</EffectDate>\n" +
"t<Memo>备注</Memo>\n" +
"</OrderInfo>\n" +
"\t\t<OpenInfoList>\n" +
"\t\t\t<OpenInfo>\n" +
" <ParamID>参数ID(即计费要素ID)</ParamID>\n" +
"\t\t\t\t<ParamName>参数名称(eg.CPU个数,用户数量)</ParamName>\n" +
"\t\t\t\t<ParamValue>参数值(eg:1,50)</ParamValue>\n" +
"\t\t\t\t<ParamDesc>开通参数描述(eg:单位:核,单位:个)</ParamDesc>\n" +
" <Limit>是否限制计费项使用</Limit>\n" +
"\t\t\t</OpenInfo>\n" +
"</OpenInfoList>\n" +
"</EcOrderInfo>\n";
String APP00001="<?xml version='1.0' encoding='UTF-8'?>"+
"<Msg>"+
"<Head>"+
"<Code>APP00001</Code>" +
"<CTID>4591_20170822092257409_A9F6</CTID>"+
"<EcProvince>650000</EcProvince>" +
"<AppID>da678da55f364e3a8de9ffe662127163</AppID>" +
"<SubmitTime>20170822092257404</SubmitTime>" +
"<Version>1</Version>" +
"<Priority>10</Priority>" +
"</Head>"+
"<Body>"+
"<MsgSN>ff55f7adfd9a4db0a28535174f578bc122323</MsgSN>" +
"<EcOrderInfo>" +
"<OPType>01</OPType>" +
"<OPNote>kaihu</OPNote>" +
"<EcID>931330004921</EcID>" +
"<EcInfo>" +
"<OprType>01</OprType>" +
"<EcName>企业客户名称</EcName>" +
"<AdminAccount>企业管理员登录帐号</AdminAccount>" +
"<AdminName>企业管理员姓名</AdminName>" +
"<AdminSex>管理员性别</AdminSex>" +
"<AdminPhone>企业管理员手机号码</AdminPhone>" +
"<AdminEmail>企业管理员Email</AdminEmail>" +
"<AdminAddr>企业管理员地址</AdminAddr>" +
"<LinkmanName>企业联系人姓名</LinkmanName>" +
"<LinkmanFax>企业联系人传真</LinkmanFax>" +
"<LinkmanEmail>企业联系人Email</LinkmanEmail>" +
"<LinkmanTel>企业联系人联系电话</LinkmanTel>" +
"</EcInfo>" +
"<OrderInfo>" +
"<OrderID>订单ID(订单流水号)</OrderID>" +
"<OrderCode>订单编号(BOSS订单信息唯一标识)</OrderCode>" +
"<ProdID>产品ID</ProdID>" +
"<AppID>应用ID</AppID>" +
"<FeeType>计费类型</FeeType>" +
"<OrderStatus>订单状态</OrderStatus>" +
"<EffectDate>生效时间(yyyyMMdd)</EffectDate>" +
"<Memo>备注</Memo>" +
"</OrderInfo>" +
"<OpenInfoList>" +
"<OpenInfo>" +
"<ParamID>参数ID(即计费要素ID)</ParamID>" +
"<ParamName>参数名称(eg.CPU个数,用户数量)</ParamName>" +
"<ParamValue>参数值(eg:1,50)</ParamValue>" +
"<ParamDesc>开通参数描述(eg:单位:核,单位:个)</ParamDesc>" +
"<Limit>是否限制计费项使用</Limit>" +
"</OpenInfo>" +
"</OpenInfoList>" +
"</EcOrderInfo>"+
"</Body>" +
"</Msg>";
String sfasd="<?xml version='1.0' encoding='UTF-8'?>" +
"<Msg><Head><Code>APP00001</Code><CTID>2017050600000006</CTID>" +
"<AppID>da678da55f364e3a8de9ffe662127163</AppID><SubmitTime>20170506153135556</SubmitTime>" +
"<Version>0100</Version><Priority>10</Priority><EcProvince>630000</EcProvince></Head>" +
"<Body>yMQMOeOXkzgWc8xDKnfxfLo2tEeNVFkzaZMUdhFQsDdCwGKPbDrRD/dGUFdCXjNHTYkfjcLjhaRp\n" +
"NOZ4HlMEnZlLfvJatzCLKBpfBTo7F29nVdjmvFwLdwguAEZaz3d/RpvTprJVomE42IUFVunkx5TI\n" +
"EeGfEVDPGDs1F9b2RNm5AmTEVnZrPyX1ugDPD8sZ5cwGYZrQL1h83kROJtvb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"GUF3h4zD1DbY69hSqGDCaM5ABw8mqoc1Hwq6Gas7mbWcN8uB9+DzNAmKjQ84BTBjeqVF0lJPSE0C\n" +
"rnSMc09VLeshqrTX24GkvgksP/7DWQ==";
String mmmm="<MsgSN>e4412f34038e46d08aa84d3f63b6f812</MsgSN>" +
"<EcOrderInfo>" +
"<OPType>01</OPType>" +
"<OPNote></OPNote>" +
"<EcID>72791272</EcID>" +
"<EcInfo>" +
"<OprType>01</OprType>" +
"<EcName>中移软件</EcName>" +
"<AdminAccount>201708231042</AdminAccount>" +
"<AdminName>姜勇</AdminName>" +
"<AdminSex></AdminSex>" +
"<AdminPhone>15195908821</AdminPhone>" +
"<AdminEmail>QQ1@qq.com</AdminEmail>" +
"<AdminAddr>l991</AdminAddr>" +
"<LinkmanName>xiaoliu</LinkmanName>" +
"<LinkmanFax>0755-1234567-121</LinkmanFax>" +
"<LinkmanEmail>456451@qq.com</LinkmanEmail>" +
"<LinkmanTel>18896724615</LinkmanTel>" +
"</EcInfo>" +
"<OrderInfo>" +
"<OrderID>cb9a9682082e44a4be6caa5d460d2a1a</OrderID>" +
"<OrderCode>2312612266</OrderCode>" +
"<ProdID>dc1fe931fe854e8cb7a03eeb93ccf07e</ProdID>" +
"<AppID>da678da55f364e3a8de9ffe662127163</AppID>" +
"<FeeType>1</FeeType>" +
"<OrderStatus>00</OrderStatus>" +
"<EffectDate>20170506</EffectDate>" +
"<ExpiryDate>20170606</ExpiryDate>" +
"<Memo>11</Memo>" +
"</OrderInfo>" +
"<OpenInfoList>" +
"<OpenInfo>" +
"<ParamID></ParamID>" +
"<ParamName></ParamName>" +
"<ParamValue></ParamValue>" +
"<ParamDesc></ParamDesc>" +
"<Limit></Limit>" +
"</OpenInfo>" +
"</OpenInfoList>" +
"</EcOrderInfo>";
String oo="<MsgSN>149b7209a91f4c9c83bad2fc98f0909</MsgSN>" +
"<EcOrderInfo>" +
"<OPType>01</OPType>" +
"<OPNote></OPNote>" +
"<EcID>7717163472</EcID>" +
"<EcInfo>" +
"<OprType>01</OprType>" +
"<EcName>移动管家</EcName>" +
"<AdminAccount>13481007149</AdminAccount>" +
"<AdminName>15195908821</AdminName>" +
"<AdminSex></AdminSex>" +
"<AdminPhone>15195908821</AdminPhone>" +
"<AdminEmail></AdminEmail> " +
"<AdminAddr></AdminAddr>" +
"<LinkmanName></LinkmanName>" +
"<LinkmanFax></LinkmanFax>" +
"<LinkmanEmail></LinkmanEmail>" +
"<LinkmanTel></LinkmanTel>" +
"</EcInfo>" +
"<OrderInfo>" +
"<OrderID>34917c1a6ods4440pqw9990pfe1314</OrderID>" +
"<OrderCode>72332102142</OrderCode>" +
"<ProdID>a54b7eb816484751b7edb7e081a51d21</ProdID>" +
"<AppID>da678da55f364e3a8de9ffe662127163</AppID>" +
"<FeeType>1</FeeType>" +
"<OrderStatus>00</OrderStatus>" +
"<EffectDate>20170506</EffectDate>" +
"<ExpiryDate>20270606</ExpiryDate>" +
"<Memo></Memo>"+
"</OrderInfo>" +
"<OpenInfoList>"+
"<OpenInfo>" +
"<ParamID></ParamID>" +
"<ParamName></ParamName>" +
"<ParamValue></ParamValue>" +
"<ParamDesc></ParamDesc>" +
"<Limit></Limit>" +
"</OpenInfo>" +
"</OpenInfoList>" +
"</EcOrderInfo>";
/* String msg = httpUtils.sendHttpPost("http://117.149.16.172:81/boss/execute", sfasd);
ReqsObj reqsObj = new ReqsObj();
System.out.println("msg-->\n" + msg);
StringReader reader = new StringReader(msg);
//KEY=53825298
reqsObj = (ReqsObj) HttpUtils.xmlToBean(reader, ReqsObj.class);*/
// String ss=com.troyjj.crypt.Encrypt.encryptSSOPlain("11&13901230002&13901230002&manager&0008747&ST-667-FFoJsc9PkYwxWREbnB1c-sysso01","53825298");
// System.out.println("bodyxml22->\n" + ss);
String sss=com.troyjj.crypt.Encrypt.encryptSSOPlain(oo,key);
System.out.println("bodyxml22->\n" + sss);
// String bodyc= com.troyjj.crypt.Encrypt.decryptSSO(sssdfsdf, key);
// System.out.println("bodyxml22-&**************888>\n" + bodyc);
// String bodycc = com.troyjj.crypt.Encrypt.decryptSSO(reqsObj.getBody().replace(" ", ""), key);
// System.out.println("bodyxml->\n" + bodycc);
} catch (Exception e) {
e.printStackTrace();
}
}
}