Reply
Member
Posts: 1
Registered: ‎04-02-2012

CIM error "The parameter is not correct."

Hello-

I'm working with the CIM sample code (ASP Classic) and am converting it to VB.NET.

 

I have the following code to actually send the API request. It works until the "objHTTP.send(strReq)". At that point, I get the error "The parameter is not correct."

 

I know this is a shot-in-the-dark, but does anyone have any clue why I would be getting this?

 

Function SendAPIRequest(ByVal strReq) 'returns an MSXML DOMDocument
            Dim objHTTP As Object
            Dim objResponse As Object
            Dim gstrApiUrl As String = "https://apitest.authorize.net/xml/v1/request.api"

            strReq = Replace(strReq, " ", "%20")
            
            objHTTP = CreateObject("Microsoft.XMLHTTP", "")
            objHTTP.open("post", gstrApiUrl, False)
            objHTTP.setRequestHeader("Content-Type", "text/xml")
            objHTTP.send(strReq)
            objResponse = CreateObject("MSXML2.DOMDocument.4.0")
            objResponse.loadXML(objHTTP.response.Text)
            objResponse.setProperty("SelectionNamespaces", "xmlns:api='AnetApi/xml/v1/schema/AnetApiSchema.xsd'")

            SendAPIRequest = objResponse
        End Function

 Thanks for any insight!

Nate

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: CIM error "The parameter is not correct."

Did you check what is in the strReq before you send it?