我有以下PowerBuilder代码,工作正常,我想在PHP中创建一个类似的过程。 我使用xmlhttp和服务器回复没有任何错误。
ls_get_url = "https://staging.xxxxxx.com/acqapi/service.ashx"
data = "<CardInquiry>"
data += "<Cardholderid>9999999999999</Cardholderid>"
data += "</CardInquiry>"
ls_params_text = 'Username=LalakisAPI&Password='+ls_password+'&MessageId='+ls_messageID+'&ApiSignature=clear&Data='+data
//First lets do a GET request
//All request parameters should be included in the URL
loo_xmlhttp.open ("POST",ls_get_url, False)
loo_xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded" )
loo_xmlhttp.SetAutomationTimeOut(30000)
try
loo_xmlhttp.send(ls_params_text)
catch (RunTimeError ex1)
destroy loo_xmlhttp
Messagebox('RuntimeError',ex1.getmessage())
return
end try
//Get our response
ls_status_text = loo_xmlhttp.StatusText
ll_status_code = loo_xmlhttp.Status