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 FunctionThanks for any insight!
Nate
04-02-2012 05:39 PM
Did you check what is in the strReq before you send it?
04-05-2012 04:58 AM