Link to home
Start Free TrialLog in
Avatar of kattre
kattre

asked on

Send XML Messages via Wiinsock

Hi

I am having trouble sending xml requests using winsock to an application server running on my pc.
I am able to connect, but when i try to send a xml request the server hasn't received the message.

If anyone can see why the following code wouldn't work or any other suggestions, it would be appreciated.

    With Winsock1
        .Close
        .LocalPort = 0
        .RemoteHost = "localhost"
        .RemotePort = 7001
        .Connect
    End With

    Dim objXMLDoc As New DOMDocument40  
    objXMLDoc.async = False
    objXMLDoc.validateOnParse = False
    objXMLDoc.resolveExternals = False

    Dim root As IXMLDOMNode
    Set root = objXMLDoc.appendChild(objXMLDoc.createElement("Request_Logon"))
    Dim data As IXMLDOMNode
    Set data = root.appendChild(objXMLDoc.createElement("Data"))
    data.appendChild(objXMLDoc.createElement("UserName")).Text = "user_1"

    ' send xml request
    Winsock1.SendData objXMLDoc.xml

Thanks.
Avatar of _agj_
_agj_

Try writing a simple winsock based server which does a

winsock1.listen at port 7001
in the winsock1_data arrival event, do a getData and see what sutff is coming in.

ASKER CERTIFIED SOLUTION
Avatar of _agj_
_agj_

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial