Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Posting a xml object to a url

Status
Not open for further replies.

truenight

Programmer
Oct 12, 2001
4
AU
Wondering if someone could help here. I have some asp code which posts an xml object and then receives a response back in the form of an xml object and I need to do the same thing in Java can someone point me in the right direction to do this.

I worked out how to create the xml object just dont know how to do this bit of the code.

The ASP code is as follows:
Code:
Set xmlHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")	    ' Check if object created	    If Err then		    ' Didn't create it so try version 2 (This object olso in version 3)			Set xmlHTTP = Server.CreateObject("MSXML2.XMLHTTP")			' Fail application because all failed to create			If Err Then				m_Error = Err.Number				m_ErrorMessage = Err.Description				On Error GoTo 0				Set xmlDoc = Nothing				Exit Function			End If		Else			xmlHTTP.setTimeouts 120000, 120000, 120000, 120000		End If			    ' Send the xml to the server	    xmlHTTP.open "POST", m_ewayURL, False	    xmlHTTP.send xmlDoc	    	    ' An error occured so exit	    If Err.Number <> 0 Then	        m_Error = Err.Number	        m_ErrorMessage = Err.Description	        On Error GoTo 0	        Set xmlDoc = Nothing	        Set xmlHTTP = Nothing	        Exit Function	    End If	    On Error GoTo 0	    	    xmlDoc.async = False	    If xmlDoc.loadXML(xmlHTTP.responseText) Then'code to interpret your results
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top