cancel
Showing results for 
Search instead for 
Did you mean: 

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

natetg23
Member
1 REPLY 1

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

RaynorC1emen7
Expert