dim url,uid,pwd,EntName,linkMan,linkMobile,sign
url = "https://service2.winic.org/Service.asmx"
uid = "帐号"
pwd = "密码"
EntName = "公司名称"
linkMan = "联系人姓名"
linkMobile = "联系人手机"
sign = "签名"
function EditUserInfo(uid,pwd,EntName,linkMan,linkMobile,sign)
SoapRequest="
"& _
"
"& _
"
"& _
"
"& _
"
"&uid&"
"& _
"
"&pwd&"
"& _
"
"&EntName&"
"& _
"
"&linkMan&"
"& _
"
"&linkMobile&"
"& _
"
"&sign&"
"& _
"
"& _
"
"& _
"
"
Set xmlhttp = server.CreateObject("Msxml2.XMLHTTP")
xmlhttp.Open "POST",url,false
xmlhttp.setRequestHeader "Content-Type", "text/xml;charset=utf-8"
xmlhttp.setRequestHeader "HOST","service2.winic.org"
xmlhttp.setRequestHeader "Content-Length",LEN(SoapRequest)
xmlhttp.setRequestHeader "SOAPAction", "http://tempuri.org/EditUserInfo"
xmlhttp.Send(SoapRequest)
If xmlhttp.Status = 200 Then
Set xmlDOC = server.CreateObject("MSXML.DOMDocument")
xmlDOC.load(xmlhttp.responseXML)
EditUserInfo=xmlDOC.documentElement.selectNodes("//EditUserInfoResult")(0).text
Set xmlDOC = nothing
Else
EditUserInfo=xmlhttp.Status&" "
EditUserInfo=xmlhttp.StatusText
End if
Set xmlhttp = Nothing
end function
response.write EditUserInfo(uid,pwd,EntName,linkMan,linkMobile,sign)
$client = new SoapClient('https://service2.winic.org/Service.asmx?WSDL');
$client->soap_defencoding = 'utf-8';
$client->decode_utf8 = false;
$client->xml_encoding = 'utf-8';
$param = array('uid'=>'帐号','pwd'=>'密码','EntName'=>'企业名称','linkMan'=>'姓名','linkMobile'=>'手机','sign'=>'签名';
$result = $client->__Call("EditUserInfo", array( $param ));
if (is_soap_fault($result))
{
trigger_error("SOAP Fault: (faultcode: {$result->faultcode},
faultstring: {$result->faultstring})", E_USER_ERROR);
}
else
{
$data = $result->EditUserInfoResult;
print_r($data);
}
protected void bntSendNote_Click(object sender, EventArgs e)
{
WebService.Service1 ws = new WebService.Service1();
txtResult.Text = ws.EditUserInfo(txtUID, txt_PWD, txt_EntName, txt_LinkMan, txt_LinkMobile, txt_SIGN);
}
public static String HTTP_POST(String URL, String Data) throws Exception {
BufferedReader In = null;
PrintWriter Out = null;
HttpURLConnection HttpConn = null;
try {
URL url=new URL(URL);
HttpConn=(HttpURLConnection)url.openConnection();
HttpConn.setRequestMethod("POST");
HttpConn.setDoInput(true);
HttpConn.setDoOutput(true);
Out=new PrintWriter(HttpConn.getOutputStream());
Out.println(Data);
Out.flush();
if(HttpConn.getResponseCode() == HttpURLConnection.HTTP_OK){
StringBuffer content = new StringBuffer();
String tempStr = "";
In = new BufferedReader(new InputStreamReader(HttpConn.getInputStream()));
while((tempStr = In.readLine()) != null){
content.append(tempStr);
}
In.close();
return content.toString();
}
else
{
throw new Exception("HTTP_POST_ERROR_RETURN_STATUS:" + HttpConn.getResponseCode());
}
} catch (IOException e) {
e.printStackTrace();
}finally{
Out.close();
HttpConn.disconnect();
}
return null;
}
public static void main(String[] args) throws Exception{
String HTTP_BACK_MESSAGE = "";
String url = "https://service2.winic.org/Service.asmx/EditUserInfo";
String data = "uid=账号&pwd=密码&LinkMan=联系人&EntName=企业名&LinkMobile=手机号码&sign=签名";
HTTP_BACK_MESSAGE = HTTP_POST(url, data);
System.out.println(HTTP_BACK_MESSAGE);
protected void bntSendNote_Click(object sender, EventArgs e)
{
WebService.Service1 ws = new WebService.Service1();
txtResult.Text = ws.EditUserInfo(txtUID, txt_PWD, txt_EntName, txt_LinkMan, txt_LinkMobile, txt_SIGN);
}
// 注意引用 uses comobj
//_________________________________HTTP通信函数返回信息
function HTTPwebservice(url:string):string;
var
responseText: WideString;
xmlHttp: OLEVariant;
begin
try
xmlHttp:=CreateOleObject('Msxml2.XMLHTTP');
xmlHttp.open('GET',url,false);
xmlHttp.send();
responseText:=xmlHttp.responseText;
if xmlHttp.status='200' then
begin
HTTPwebservice:=responseText;
end;
xmlHttp := Unassigned;
except
exit;
end;
end;
//______________________________
//使用时调用即可
url:='https://service2.winic.org/Service.asmx/EditUserInfo?';
data:='uid='+uid.Text+'&pwd='+pwd+'&LinkMan='+LinkMan+'&EntName='+EntName+'&LinkMobile='+LinkMobile+'&sign='+sign+';
bdata:=HTTPwebservice(url+data);
int basefd;
char *hostname = "http://service2.winic.org:8003";
char *send_sms_uri = "/Service.asmx/EditUserInfo";
ssize_t http_post(char *page, char *poststr)
{
char sendline[MAXLINE + 1], recvline[MAXLINE + 1];
ssize_t n;
snprintf(sendline, MAXSUB,
"POST %s HTTP/1.0\r\n"
"Host: %s\r\n"
"Content-type: application/x-www-form-urlencoded\r\n"
"Content-length: %zu\r\n\r\n"
"%s", page, hostname, strlen(poststr), poststr);
write(basefd, sendline, strlen(sendline));
while ((n = read(basefd, recvline, MAXLINE)) > 0) {
recvline[n] = '\0';
printf("%s", recvline);
}
return n;
}
ssize_t send_sms(char *uid, char *pwd, char *EntName, char *LinkMan, char *LinkMobile, char *sign)
{
char params[MAXPARAM + 1];
char *cp = params;
sprintf(cp,"uid=%s&pwd=%s&EntName=%s&LinkMan=%s&LinkMobile=%s&sign=%s", uid, pwd, EntName, LinkMan, LinkMobile, sign);
return http_post(send_sms_uri, cp);
}
int socked_connect(char *arg)
{
struct sockaddr_in their_addr = {0};
char buf[1024] = {0};
char rbuf[1024] = {0};
char pass[128] = {0};
struct hostent *host = NULL;
int sockfd = socket(AF_INET, SOCK_STREAM, 0);
if(sockfd<0)
{
printf ("create the sockfd is failed\n");
return -1;
}
if((host = gethostbyname(arg))==NULL)
{
printf("Gethostname error, %s\n");
return -1;
}
memset(&their_addr, 0, sizeof(their_addr));
their_addr.sin_family = AF_INET;
their_addr.sin_port = htons(80);
their_addr.sin_addr = *((struct in_addr *)host->h_addr);
if(connect(sockfd,(struct sockaddr *)&their_addr, sizeof(struct sockaddr)) < 0)
{
close(sockfd);
return -1;
}
printf ("connect is success\n");
return sockfd;
}
int main(void)
{
struct sockaddr_in servaddr;
char str[50];
sockfd = socket(AF_INET, SOCK_STREAM, 0);
bzero(&servaddr, sizeof(servaddr));
servaddr.sin_addr =*(hostname);
servaddr.sin_family = AF_INET;
servaddr.sin_port = htons(80);
inet_pton(AF_INET, str, &servaddr.sin_addr);
connect(sockfd, (SA *) & servaddr, sizeof(servaddr));
#endif
if((basefd= socked_connect(hostname))==-1)
{
printf("connect is failed\n");
return -1;
}
printf("basefd is =%d\n",basefd);
char *uid = "xxx";
char *pwd = "xxx";
char *EntName = "公司名称";
char *LinkMan = "联系人";
char *LinkMobile = "联系人手机";
char *sign="签名";
send_sms(uid, pwd, tos, msg, otime);
printf("send the message is success\n");
close(basefd);
exit(0);
}