Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

xmlHTTP Post gets Error 53 response

Posted on 2011-10-07
9
Medium Priority
?
522 Views
Last Modified: 2012-05-12
When posting data to a web server, I get an Error 53 more often than not.  Problem is, I don't have a way to tell if the data was posted but the response was lost, or if the post itself never made it to the server.  Can anyone clarify with certainty just what this error tells me?  If the data did not make it, I want to try again...if it did, I really do not want duplicate entries, but how do I know?
The code I use is in vb.net 2010 and looks like this:

            xmlHTTP = New MSXML2.XMLHTTP
            xmlHTTP.open("POST", strURL, False)
            xmlHTTP.setRequestHeader("Content-Type", strContentType)
            orderForm.lblStatus.Text = "Checking Info >>>"
            System.Windows.Forms.Application.DoEvents()
            xmlHTTP.send(strPost)
            strResponse = xmlHTTP.responseText
0
Comment
Question by:Dalexan
7 Comments
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 2000 total points
ID: 36932738
Apparently "using MSXML in .NET is not supported."   This page http://social.msdn.microsoft.com/forums/en-US/xmlandnetfx/thread/2712c1e5-a04b-42dd-b283-a8d18a49f731  has links to more info including the .NET functions that replace MSXML.
0
 

Author Comment

by:Dalexan
ID: 36942686
This example states that MSXML is not supported in .net, then proceeds to use MSXML2 in the solution...I am already using MSXML2, not MSXML...

In my code (shown above) I get the Error 53 on the xmlHTTP.send(strPost) line.
0
 

Author Comment

by:Dalexan
ID: 36943445
Here is the full code we are using to post transactions:

    Public Function SendAuthString(ByRef strURL As String, ByRef strPost As String, ByRef strContentType As String) As String
        On Error GoTo ErrorTrap
        Push("frmOrderPoint:SendAuthString(" & strURL & "," & strPost & "," & strContentType & ")")
        LogFileEntry(Peek(), 5)
        Dim iErr As Int16 = 0
        Dim xmlHTTP As MSXML2.XMLHTTP
        Dim strResponse As String = String.Empty
        Dim strAddHead As String = String.Empty
        Dim aURL() As String

        If strContentType = "xCharge" Then
               'commented out section
        ElseIf strContentType = "Base64" Then
            aURL = Split(strURL, "|")
            xmlHTTP = New MSXML2.XMLHTTP
            xmlHTTP.open("POST", aURL(0), False)
            xmlHTTP.setRequestHeader("Authorization", "Basic " & EncodeBase64(aURL(1) & ":" & aURL(2)))
            orderForm.lblStatus.Text = "Checking Info >>>"
            System.Windows.Forms.Application.DoEvents()
            xmlHTTP.send(strPost)
            strResponse = xmlHTTP.responseText
            xmlHTTP = Nothing
        Else
            If strContentType = "" Then
                strContentType = "application/x-www-form-urlencoded"
            End If
            xmlHTTP = New MSXML2.XMLHTTP
            xmlHTTP.open("POST", strURL, False)
            xmlHTTP.setRequestHeader("Content-Type", strContentType)
            orderForm.lblStatus.Text = "Checking Info >>>"
            System.Windows.Forms.Application.DoEvents()
            xmlHTTP.send(strPost)
            strResponse = xmlHTTP.responseText
            xmlHTTP = Nothing
        End If
        SendAuthString = strResponse
ExitFunc:
        Pop()
        Exit Function
ErrorTrap:
        iErr += 1
        If Err.Number = 53 Then
            If iErr < 3 Then
                Pause(2)
                Resume
            End If
        End If
        GStr_f_end_method = Peek()
        GLng_f_end_number = Err.Number
        GStr_f_end_desc = Err.Description
        ErrHandler_OP(frmOrderPoint)
        SendAuthString = ""
        Resume ExitFunc
    End Function
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 14

Expert Comment

by:CtrlAltDl
ID: 36944920
Is strPost are any special characters parsed or escaped is that variable?  Does a single-quote in that variable screw it up?
0
 

Author Comment

by:Dalexan
ID: 36945140
No special characters or single quotes in that variable.
0
 
LVL 83

Expert Comment

by:leakim971
ID: 36946438
Did you try GET instead POST?
0
 

Author Closing Comment

by:Dalexan
ID: 36956571
Instead of troubleshooting this issue we decided to change our code to use the .dll instead of passing the parameters to the customers webservice. We will go forward under the assumption that not supporting msxml is a step in the wrong direction for our application and will pursue a more open source alternative.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Introduction to Processes

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question