How to send XML request from a client to server over a network connection using the TCP/IP protocol in python.

Hi all!

I’ve been trying to figure out how to send and receive XML Data over a TCP Server in python. My program works if i’m sending just plain text, however once I try to send the xml data it just hangs. The server never receives the message. I’ve been searching for code to do this and haven’t found any luck, i’ve seen lots of code samples online that don’t work. if any of you know how to address this problem, please let me know, It would be very grateful for me.

Is it a question related to Milestone products? Are you trying to communicate with a Milestone server? If yes, what service? If not, I will recommend that you find another forum for advice on general TCP/IP communication. This forum is very much focused on software development with the Milestone VMS in mind.

Hi,

I hope, I have posted my query in right forum(Protocol Integration). We are planning to integrate our software with milestone’s VMs through protocol integration using python.

Please suggest me the right forum, Currently I’m trying to establish a connectivity with image server to access the live streams using python.

It would be grateful, if you share the right forum details.

Thanks

Nashrin.

You are on the right forum. Your original question never mentioned what you are trying to communicate with. My guess would now be that you try to communicate with the ServerCommandService.

https://doc.developer.milestonesys.com/html/index.html?base=serversoaphelp/index.html&tree=tree_3.html

https://doc.developer.milestonesys.com/html/index.html?base=gettingstarted/intro_soap_protocols.html&tree=tree_3.html

https://doc.developer.milestonesys.com/html/index.html?base=samples/protocolsamples/logindotnetsoap/readme.html&tree=tree_3.html

Hi,

Yes, I am able to connect with ServerCommandService and also able to retrieve configuration info.

But not able to communicate with image server for live streams. After initiating a TCP Socket connection with Milestone’s image server, I couldn’t get any response from the image server when I send request for live streams.

The Image Server Protocol is documented here. https://doc.developer.milestonesys.com/html/index.html?base=reference/protocols/imageserver_request_response.html&tree=tree_3.html

I suspect something special as I would expect you to always get something back even if the reply was ‘Unauthorized’.

The Image Server is in the recording server, which could be another server and at any rate uses another port (default 7563). A first step could be to see if the port is blocked by firewall.

Perhaps you can compare with the samples how they communicate with the Image Server.

https://doc.developer.milestonesys.com/html/index.html?base=samples/protocolsamples/logindotnetsoap/readme.html&tree=tree_3.html

One way could be to see the communiction twards the Image Server from the sample or Smart Client and then compare with your program, you could use Wireshark or similar.

Hi,

Yes, I agree with your point.

Please correct my understanding, if the port 7563 is blocked by firewall I could not able to initiate the socket connection right?

Here I am able to initiate a client socket, after sending my request I didn’t get back anything.

I think you are correct. Perhaps the network communication tracing will give more value in the troubleshooting.