socket calls webservervice

During the conversation, please do not trust remittance, winning information, unfamiliar phone calls, and do not use plug-in software.

☆Lanlan Mood★(357079649) 10:25:41 Wait
and I will tell you about it, hack and download a soapui first
JAVA_Lao Pan(654821093) 10:34:19
When will I tell you
☆Lanlan Mood★(357079649) 10:35:48
11:00
JAVA_Lao Pan (654821093) 10:37:34 Where are
you talking about Ah
QQ?
Still yy or
☆Lanlan Mood★(357079649) 10:37:56
QQ
JAVA_Lao Pan(654821093) 10:42:24 It’s almost

time,
how to say Ah’s voice or
☆Lanlan Mood★(357079649) 10:48 :35
QQ
typing
☆ blue mood ★ (357079649) 10:55:53
hack is not there?
Little Black Brother (1377252306) 10:56:40

☆Blue Mood★(357079649) 11:02:35
Time is up
For example, now call a webservice (http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl) that is queried by the source of a mobile phone number through a socket, I will give a detailed explanation, look back at hack2003 and solve it myself Question
☆ Lanlan Mood★ (357079649) 11:06:43
Change to a webservice service, this number needs a user ID, I can't provide it, change to:
http://webservice.webxml.com.cn/webservices/qqOnlineWebService .asmx?wsdl
QQ number online query service
JAVA_Lao Pan (654821093) 11:16:37
This is still a webservice interface, how can I use socket to adjust you this
☆ Lanlan mood (357079649) 11:17:06
I am Waiting
for this for you guys , make a demo, 5 minutes

JAVA_Lao Pan(654821093) 11:17:35
Well 
☆Blue Mood★(357079649) 11:29:43
package cn.mc.arch.demo;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;

public class SoapDemo {

/**
* *
*
* @param args
*/
public static void main(String[] args) throws Exception {
Socket socket = new Socket("webservice.webxml.com.cn", 80);
PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
BufferedReader in = new BufferedReader(new InputStreamReader(socket
.getInputStream()));

out
.println("POST http://webservice.webxml.com.cn/webservices/qqOnlineWebService.asmx HTTP/1.1");
out.println("Accept-Encoding: gzip,deflate");
out.println("Content-Type:text/xml;charset=UTF-8");
out.println("SOAPAction: \"http://WebXml.com.cn/qqCheckOnline\"");
out.println("Host: webservice.webxml.com.cn");
out.println("Connection: Keep-Alive");
out.println("User-Agent: mclaren-test");

StringBuffer buffer = new StringBuffer();

buffer
.append("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"http://WebXml.com.cn/\">");
buffer.append("<soapenv:Header/>");
buffer.append("<soapenv:Body>");
buffer.append("<web:qqCheckOnline>");
buffer.append("<web:qqCode>641069519</web:qqCode>");
buffer.append("</web:qqCheckOnline>");
buffer.append("</soapenv:Body>");
buffer.append("</soapenv:Envelope>");

String body = buffer.toString();

out.println("Content-Length: " + body.getBytes().length);
out.println();

out.println(body);

StringBuffer response = new StringBuffer();
char[] buf = new char[128];
do {
// clear buffer
for (int i = 0; i < buf.length; i++) {
buf[i] = 0;
}

int rt = in.read(buf);

String s = new String(buf);
response.append(s);

if (rt < 128) {
break;
}
} while (true);

in.close();
out.close();
socket.close();

System.out.println("Response is " + response);
}
}

注意这个demo, 按照soap协议,发起请求
响应截图

HTTP/1.1 200 OK
Date: Fri, 05 Apr 2013 03:29:30 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 367

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><qqCheckOnlineResponse xmlns="http://WebXml.com.cn/"><qqCheckOnlineResult>N</qqCheckOnlineResult></qqCheckOnlineResponse></soap:Body></soap:Envelope> This is the complete response body, you can find that the online status of this QQ is N
☆Blue mood★ (357079649) 11:30:51


☆Lanlan Mood★ (357079649) 11:31:52

Try it with Lao Pan's QQ account, the result is:

Lao Pan should be invisible
JAVA_Lao Pan (654821093) 11:33:01
Well,
I'm testing it
☆ Lan Blue Mood★(357079649) 11:33:28 Changed
to my own QQ, it is:

JAVA_Lao Pan(654821093) 11:34:40 The pictures
you sent are all broken in my place
☆Blue Blue Mood★ Share file 11:35:14
"ws.rar" download
JAVA_Old Pan (654821093) 11:35:24
This cow B
☆Blue blue mood★(357079649) 11:35:25
Code demo, group sharing ws.rar
JAVA_Old Pan(654821093) 11:35:35
I want to see who is running this directly online
☆Blue Mood★(357079649) 11:35:39
Download to local research
JAVA_Old Pan(654821093) 11:35:42
 
Well I just tested
No problem
☆Blue mood★(357079649) 11:36:02
ok
JAVA_Lao Pan(654821093) 11:36:10

☆Blue mood★(357079649) 11:36:42
Socket is the foundation of all application protocols. Don't think of it as different from soap, rmi, http, etc. There is no socket for underlying communication, and they are useless
. JAVA_Lao Pan (654821093) 11:37:28 RMI
is a remote program call, I have never done
this . Does Lanlan have a demo
☆ Lanlan Mood (357079649) 11:38:11
RMI, just treat it as a concept,
no need specific one Technology is the same as webservice
JAVA_Lao Pan(654821093) 11:38:26 It
seems that there is no socket so convenient for testing
Ah
☆ Lanlan Mood (357079649) 11:38:38
As long as you want, you can implement RMI in any technical way
JAVA_Lao Pan(654821093) 11:41:28
That webservice was released by Tencent
☆Blue Mood★(357079649) 11:41:57 I
don’t know where it is, I’ll make a demo for you, just find it online
JAVA_Lao Pan(654821093) 11:42:24
Oh

☆Blue Mood★(357079649) 11:44:20 Take
the time to tell you about hadoop these few days
JAVA_Lao Pan(654821093) 11:44:20
Why can't I ping that address locally?
☆ Lanlan Mood★(357079649) 11:44:36
Not giving ping is not necessarily not connecting to the server. The
server generally does
JAVA_Old Pan (654821093) 11:45: 03
Oh, I get it
☆ Lanlan Mood★ (357079649) 11:47:02
For students who are interested in hadoop, please apply for a VPN, we can set up a technical team, use everyone's own machines, and build a hadoop cluster through the VPN network , for you and the community to conduct hadoop researchJAVA_Lao
Pan (654821093) 11:48:55 Well
, everyone went out to play today , so please don't trust remittances, winning information, unfamiliar phone calls during the conversation, and don't use plug-in software. Hacker 2003(121003923) 2013/4/5 15:49:25 I want to know the connection between socket and websevice ☆Blue Mood★(357079649) 2013/4/5 15:53:09 Watch demo Hacker 2003(121003923) 2013 Where is /4/5 15:53:17 ? ws.rar? Hacker 2003 (121003923) 2013/4/5 15:54:08 The day before yesterday, c and http were connected to the url through sockets, which probably let me understand that sockets are at the system level of

















☆Lanlan Mood★(357079649) 2013/4/5 15:55:07

Hacker 2003(121003923) 2013/4/5 15:56:04
Ha
I saw it. It is exactly as I thought,
just need to send , add the header protocol to
the same as http
☆ blue mood ★ (357079649) 2013/4/5 15:56:25
Is it what you want?
Hacker 2003(121003923) 2013/4/5 15:56:31
Yes
☆Blue Mood★(357079649) 2013/4/5 15:56:36
SOAP is a wrapper based on HTTP
Well , it's good to help you
Hacker 2003(121003923) 2013/4/5 15:56:53 Is
http based on sockets? Change
the soap protocol in you to http. It supports sockets and http communication
JAVA_Old Pan(654821093) 2013/4/ 5 15:57:36 Lanlan
encapsulated the wsdl
and then post
☆ Lanlan Mood★ (357079649) 2013/4/5 15:57:43
No wsdl is needed.
wsdl just helps us analyze the interface information
JAVA_Lao Pan(654821093) 2013/4/5 15:58:09
post is very important
Hacker 2003 (121003923) 2013/4/5 15:59:20
Oh
JAVA_Lao Pan (654821093) 2013/4/5 15:59:58
According to this, is soap a subset of the http protocol?
Hacker 2003 (121003923) 2013/4/5 16:00:30
is not
two different
hackers 2003 (121003923) 2013/4/5 16:00:45
but both respect the sockets protocol
http/webservice all respect the sockets for development Yes ,
but I don't know if the system's network communication only supports sockets
JAVA_Lao Pan(654821093) 2013/4/5 16:02:32
I still don't understand the relationship between soap and http
Hacker 2003(121003923) 2013 /4/5 16:02:54 Both are
protocols , it doesn't matter Lanlan☆ Blue Blue Mood★(357079649) 2013/4/5 16:08:42 ? Hacker 2003 (121003923) 2013/4/5 16:08:57 Does soap only need the protocol header above you









JAVA_Lao Pan (654821093) 2013/4/5 16:09:01 Lanlan Hacker
2003 (121003923) 2013/4/5 16:09:08 The xml of the content can be determined according to the situation? Hacker 2003 (121003923) 2013/4/5 16:09:50 soapenv:Envelope is the beginning and the end . Can soapenv:Envelope be freely defined? Just follow some of my own definitions? ☆Blue Mood★(357079649) 2013/4/5 16: 10:35 soapenv: Evnelope is the specification and the specification of the soap body Hacker 2003 (121003923) 2013/4/5 16:11:19 The xml in the soap body can be customized, the others are in the protocol specification format, must be brought? ☆Blue Mood★(357079649) 2013/4/5 16:11:32 Yes Hacker 2003(121003923) 2013/4/5 16:12:09 wsdl should be the xml in the body, right? ☆Blue Blue mood★(357079649) 2013/4/5 16:13:05 In this way, I won't tell you check the soap specification yourself. You need to understand soap systematically, not local JAVA_Lao Pan(654821093) 2013 /4/5 16:13:52



















I also don't understand soap
hacker 2003 (121003923) 2013/4/5 16:14:12 The
low level is c, and it is necessary to burn the c program into the device
☆ Lanlan mood (357079649) 2013/4/5 16: 14:13 After
many years of webservice development, many people still do not understand wsdl, which is a serious problem. I suggest that everyone systematically study soap (including other industrial technologies)
Hacker 2003 (121003923) 2013/4/5 16:14:33
They do not support webservice, but they can use sockets
. If you want to communicate, you need to understand Isn't there a lot of
hackers 2003 (121003923) 2013/4/5 16:16:06
My boss wrote C. At that time, I said that sockets only need to communicate with the soap protocol, and then they can connect with the webservice above me
☆ blue Blue mood (357079649) 2013/4/5 16:17:06
Your boss is right
JAVA_Lao Pan (654821093) 2013/4/5 16:17:52 Why
do I always feel that webservice does not have to
be It can meet the needs with
some
functions
:42
but I don't know the protocol itself to put those values ​​to call and transmit
His c mainly does the processing of memory. Most of them are binary transmission
yangcq(526896071) 2013/4/5 16:19:18
Intercept the protocol packet to see the data structure
Hacker 2003(121003923) 2013/4/5 16: 19:28
How to intercept
yangcq(526896071) 2013/4/5 16:20:14 Download
software /4/5 16:22:08 I was in the library and did not return to yangcq(526896071) 2013/4/5 16:23:04 I did not bring my computer home- - yangcq(526896071) 2013/4/5 16:23:08 So boring hacker 2003(121003923) 2013/4/5 16:24:35 Oh , I am very happy to be able to go home JAVA_Lao Pan (654821093) 2013/4/5 16:25:42 It seems that there are 9 years of rain in the 10 years of Qingming Festival, at least


















骇客2003(121003923) 2013/4/5 16:26:01
春季
骇客2003(121003923) 2013/4/5 16:30:58
wsdl
是真心看不懂
只能看个大概
骇客2003(121003923) 2013/4/5 16:32:06
<wsdl:message name="getAttRecResponse">
<wsdl:part name="getAttRecReturn" type="xsd:string"></wsdl:part>
</wsdl:message>
返回string类型的值
<wsdl:message name="getAttRecRequest">
<wsdl:part name="date" type="xsd:string"></wsdl:part>
<wsdl:part name="pageNum" type="xsd:int"></wsdl:part>
<wsdl:part name="pageSize" type="xsd:int"></wsdl:part>
</wsdl:message>
传三个参数
<wsdl:portType name="YunDaSOA">
<wsdl:operation name="getAttRec" parameterOrder="date pageNum pageSize">
<wsdl:input message="impl:getAttRecRequest" name="getAttRecRequest"></wsdl:input>
<wsdl:output message="impl:getAttRecResponse" name="getAttRecResponse"></wsdl:output>
</wsdl: operation>
</wsdl:portType>
Hacker 2003(121003923) 2013/4/5 16:33:20 The
method supports reading and writing and methods, parameters, corresponding to the class
yangcq(526896071) 2013/4/5 16:33:29
Well, generate code according to wsdl document
Hacker 2003(121003923) 2013/4/5 16:33:44
wsdl:binding I can't understand
Hacker 2003(121003923) 2013/4/5 17:25:32

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327001849&siteId=291194637