consuming asmx from classic aps

IbizaEspecial

New Member
I am using eWay SOAP Rapid API in classic ASP code. See the URL: http://itelc.somee.com/ewayasp/d3fault.aspHere is the SOAP: https://au.ewaypayments.com/hotpotato/soap.asmxHere is the WSDL: https://au.ewaypayments.com/hotpotato/soap.asmx?wsdlBelow is my requesting XML code: xmlString = "<?xml version=""1.0"" encoding=""UTF-8""?>" xmlString = xmlString & "<soap12:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:soap12=""http://www.w3.org/2003/05/soap-envelope"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">" xmlString = xmlString & "<soap12:Body>" xmlString = xmlString & "<CreateAccessCode xmlns=""https://au.ewaypayments.com/hotpotato/"">" xmlString = xmlString & "<request>" xmlString = xmlString & "<Authentication>" xmlString = xmlString & "<CustomerID>" & Customerid & "</CustomerID>" xmlString = xmlString & "<Username>" & Username & "</Username>" xmlString = xmlString & "<Password>" & Password & "</Password>" xmlString = xmlString & "</Authentication>" xmlString = xmlString & "<Customer>" xmlString = xmlString & "<TokenCustomerID>" & tokenCustId & "</TokenCustomerID>" xmlString = xmlString & "<SaveToken>" & chkSaveToken & "</SaveToken>" xmlString = xmlString & "<Reference>" & request.Form("txtCustomerRef") & "</Reference>" xmlString = xmlString & "<Title>" & request.Form("ddlTitle") & "</Title>" xmlString = xmlString & "<FirstName>" & request.Form("txtFirstName") & "</FirstName>" xmlString = xmlString & "<LastName>" & request.Form("txtLastName") & "</LastName>" xmlString = xmlString & "<CompanyName>" & request.Form("txtCompanyName") & "</CompanyName>" xmlString = xmlString & "<JobDescription>" & request.Form("txtJobDescription") & "</JobDescription>" xmlString = xmlString & "<Street1>" & request.Form("txtStreet") & "</Street1>" xmlString = xmlString & "<City>" & request.Form("txtCity") & "</City>" xmlString = xmlString & "<State>" & request.Form("txtState") & "</State>" xmlString = xmlString & "<PostalCode>" & request.Form("txtPostcode") & "</PostalCode>" xmlString = xmlString & "<Country>" & request.Form("txtCountry") & "</Country>" xmlString = xmlString & "<Email>" & request.Form("txtEmail") & "</Email>" xmlString = xmlString & "<Phone>" & request.Form("txtPhone") & "</Phone>" xmlString = xmlString & "<Mobile>" & request.Form("txtMobile") & "</Mobile>" xmlString = xmlString & "<Comments></Comments>" xmlString = xmlString & "<Fax></Fax>" xmlString = xmlString & "<Url></Url>" xmlString = xmlString & "</Customer>" xmlString = xmlString & "<CustomFields>" xmlString = xmlString & "<Option1>" & request.Form("txtOption1") & "</Option1>" xmlString = xmlString & "<Option2>" & request.Form("txtOption2") & "</Option2>" xmlString = xmlString & "<Option3>" & request.Form("txtOption3") & "</Option3>" xmlString = xmlString & "</CustomFields>" xmlString = xmlString & "<Payment>" xmlString = xmlString & "<TotalAmount>" & request.Form("txtAmount") & "</TotalAmount>" xmlString = xmlString & "<InvoiceNumber>" & request.Form("txtInvoiceNumber") & "</InvoiceNumber>" xmlString = xmlString & "<InvoiceDescription>" & request.Form("txtInvoiceDescription") & "</InvoiceDescription>" xmlString = xmlString & "<InvoiceReference>" & request.Form("txtInvoiceReference") & "</InvoiceReference>" xmlString = xmlString & "</Payment>" xmlString = xmlString & "<ResponseMode>" & request.Form("ddlResponseMode") & "</ResponseMode>" xmlString = xmlString & "<RedirectUrl>" & request.Form("txtRedirectURL") & "</RedirectUrl>" xmlString = xmlString & "<IPAddress>" & ip_address & "</IPAddress>" xmlString = xmlString & "<BillingCountry>" & bill_country & "</BillingCountry>" xmlString = xmlString & "<Action>CreateTokenCustomer</Action>" xmlString = xmlString & "</request>" xmlString = xmlString & "</CreateAccessCode>" xmlString = xmlString & "</soap12:Body>" xmlString = xmlString & "</soap12:Envelope>" Dim url Dim objHTTP Set objHTTP = Server.CreateObject("Microsoft.XMLHTTP") url = "https://au.ewaypayments.com/hotpotato/soap.asmx?WSDL" objHTTP.Open "post", url, false objHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8" objHTTP.setRequestHeader "SOAPAction", "https://au.ewaypayments.com/hotpotato/CreateAccessCode" objHTTP.send xmlString Dim strResponse strResponse = objHTTP.responseText response.Write(strResponse)And I am using XMLHTTP server object to invoke the soap method "CreateAccessCode" which exposed by this WS. The problem is strange, when I make a post WS respond back with null exception: soap:SenderSystem.Web.Services.Protocols.SoapException: request cannot be null at RapidAPI.CreateAccessCode(CreateAccessCodeRequest request)And returns a following SOAP fault:<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Sender</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">System.Web.Services.Protocols.SoapException: request cannot be null at RapidAPI.CreateAccessCode(CreateAccessCodeRequest request)</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>I wonder what is wrong with my call to web service in classic ASP code.Wikki
 
Back
Top