Please give me some basic explanation how to send and receive xml strings. Winsock? MSXML?
Printable View
Please give me some basic explanation how to send and receive xml strings. Winsock? MSXML?
split()
if you want to send the XML data over the internet or a network you will need the winsock control, or the winsock API. Have a look at some tutorials theres loads.
:ehh:Quote:
Originally Posted by sspoke
I have server, named Intellex and a lot of COMs(APIs) to comunicate with him. This is wath happens:
send
0000 3C 56 53 44 4D 73 67 3E-30 00 00 00 F5 05 00 00 <VSDMsg>0.......
0010 90 01 00 00 00 00 00 00-0B 00 00 00 31 39 32 2E ............192.
0020 31 36 38 2E 31 2E 31 00-00 00 00 00 00 00 00 00 168.1.1.........
0030 00 00 00 00 00 00 00 00-00 00 00 00 3C 2F 56 53 ............</VS
0040 44 4D 73 67 3E DMsg>
received
0000 3C 56 53 44 4D 73 67 3E-1C 01 00 00 FD 05 00 00 <VSDMsg>........
0010 01 00 00 00 00 00 00 00-08 01 00 00 00 00 00 00 ................
0020 3C 45 78 49 6E 66 6F 3E-0D 0A 3C 53 69 74 65 3E <ExInfo>..<Site>
0030 0D 0A 3C 4E 61 6D 65 3E-49 4E 54 45 4C 4C 45 58 ..<Name>INTELLEX
0040 3C 2F 4E 61 6D 65 3E 0D-0A 3C 2F 53 69 74 65 3E </Name>..</Site>
0050 0D 0A 3C 50 6F 72 74 73-20 4D 61 69 6E 20 3D 20 ..<Ports Main =
0060 22 35 30 30 30 22 20 4C-69 76 65 20 3D 20 22 35 "5000" Live = "5
0070 30 30 31 22 20 45 76 65-6E 74 20 3D 20 22 35 30 001" Event = "50
0080 30 33 22 20 2F 3E 0D 0A-3C 4D 61 78 4C 69 76 65 03" />..<MaxLive
0090 43 6C 69 65 6E 74 73 3E-35 3C 2F 4D 61 78 4C 69 Clients>5</MaxLi
00A0 76 65 43 6C 69 65 6E 74-73 3E 0D 0A 3C 41 75 64 veClients>..<Aud
00B0 69 6F 3E 0D 0A 3C 4E 75-6D 3E 30 3C 2F 4E 75 6D io>..<Num>0</Num
00C0 3E 0D 0A 3C 2F 41 75 64-69 6F 3E 0D 0A 3C 54 65 >..</Audio>..<Te
00D0 78 74 3E 0D 0A 3C 4E 75-6D 3E 30 3C 2F 4E 75 6D xt>..<Num>0</Num
00E0 3E 0D 0A 3C 2F 54 65 78-74 3E 0D 0A 3C 53 65 63 >..</Text>..<Sec
00F0 4D 6F 64 65 3E 30 3C 2F-53 65 63 4D 6F 64 65 3E Mode>0</SecMode>
0100 0D 0A 3C 41 6C 61 72 6D-54 61 67 73 3E 0D 0A 3C ..<AlarmTags>..<
0110 2F 41 6C 61 72 6D 54 61-67 73 3E 0D 0A 3C 2F 45 /AlarmTags>..</E
0120 78 49 6E 66 6F 3E 0D 0A-3C 2F 56 53 44 4D 73 67 xInfo>..</VSDMsg
0130 3E
So, how to send the first string?
UL=LdI/dtQuote:
Originally Posted by DigiRev
:ehh: :ehh:Quote:
Originally Posted by VbFob
Do you know how to connect/send data with Winsock?Quote:
Originally Posted by VbFob
The first string would look something like this:
VB Code:
Dim strPacket As String strPacket = "<VSDMsg>0...................192.168.1.1.....................</VSDMsg>" 'periods (.) represent Chr(0) in the port monitor/packet sniffer. strPacket = Replace$(strPacket, ".", Chr$(0)) 'You have to connect to the server before you can send data using TCP. winsock1.SendData strPacket
I don't have a lot of experience with packet sniffers but one thing that puzzles me is why there is a dash in the hex representation on the left side?
Code:0000 3C 56 53 44 4D 73 67 3E-30 00 00 00 F5 05 00 00
Thank you blues bro, this is enough.Quote:
Originally Posted by DigiRev
The dash is from some winsock monitor app.
It's not enought. The Protocol is IPv4 and after connection become TCP ??????? Well, this maybe will not happend on LAN........... OK, I have some responce, how to catch him ?