PowerBuilder 顶点连接
我正在尝试使用 PowerBuilder 11.1 连接到 Vertex 税务数据库,但以下代码出现问题。
我认为我连接正确,因为 ls_status_text = loo_xmlhttp.StatusText
的返回代码为 200,并且 ll_status_code = loo_xmlhttp.Status
正常。
当我从 ls_response_text = loo_xmlhttp.ResponseText 代码获取返回值时,返回值是 MOTW 消息。
我期望以下代码发送 ls_get_url (其中包含要发送到顶点的 xml)并收到一个大的 xml 作为回报,并根据 ls_get_url xml 计算出税率。我得到的是 ls_status_text = 'OK' 和 ll_Status_code = 200 (任何大于 300 的都是问题)。
// 获取请求 loo_xmlhttp.open ("GET",ls_get_url , false) loo_xmlhttp.send()
//Get response
ls_status_text = ''
ls_status_text = loo_xmlhttp.StatusText
ll_status_code = loo_xmlhttp.Status
在上述代码块成功运行后,以下代码运行:
if ll_status_code >= 300 then
MessageBox("HTTP POST Request Failed", ls_response_text)
else
//Get the response we received from the web server
ls_response_text = loo_xmlhttp.ResponseText
MessageBox("POST Request Succeeded", ls_response_text)
end if
我收到“POST 请求成功”消息框,但 ls_response_text 包含 Mark Of The Web 语法。
您有什么想法可以帮助我吗?
谢谢!
String ls_get_url, ls_post_url
String ls_post_variables, ls_response
String ls_response_text, ls_status_text
long ll_status_code
OleObject loo_xmlhttp
//include parameters on the URL here for get parameters
ls_get_url = 'http://10.1.1.65:8095/vertex-ui/vertextcc.jsp'
try
//Create an instance of our COM object
loo_xmlhttp = CREATE oleobject
loo_xmlhttp.ConnectToNewObject( 'Microsoft.XMLHTTP')
// Get request
loo_xmlhttp.open ("GET",ls_get_url , false)
loo_xmlhttp.send()
//Get response
ls_status_text = ''
ls_status_text = loo_xmlhttp.StatusText
ll_status_code = loo_xmlhttp.Status
//Check HTTP Response code for errors
if ll_status_code >= 300 then
MessageBox("HTTP GET Request Failed", ls_response_text)
else
//Get the response we received from the web server
ls_response_text = loo_xmlhttp.ResponseText
MessageBox("GET Request Succeeded", ls_response_text)
end if
ls_post_url = 'http://10.1.1.65:8095/vertex-ui/vertextcc.jsp'
ls_post_variables = "I add my custom xml here - I can run it in the vertex software and the xml executes fine"
loo_xmlhttp.open ("POST",ls_post_url, false)
loo_xmlhttp.send(ls_post_variables)
//Get response
ls_status_text = loo_xmlhttp.StatusText
ll_status_code = loo_xmlhttp.Status
//Check HTTP Response code for errors
if ll_status_code >= 300 then
MessageBox("HTTP POST Request Failed", ls_response_text)
else
//Get the response we received from the web server
ls_response_text = loo_xmlhttp.ResponseText
MessageBox("POST Request Succeeded", ls_response_text)
end if
loo_xmlhttp.DisconnectObject()
catch (RuntimeError rte)
MessageBox("Error", "RuntimeError - " + rte.getMessage())
end try
I am trying to connect to a Vertex tax database using PowerBuilder 11.1 and am having problems with the following code.
I think I am connecting correctly since the return codes for ls_status_text = loo_xmlhttp.StatusText
is 200 and ll_status_code = loo_xmlhttp.Status
is OK.
When I get the return value from the ls_response_text = loo_xmlhttp.ResponseText
code the return value is the MOTW message.
I am expecting the following code to send the ls_get_url (which contains the xml to be sent to vertex) and receive a large xml in return with calculated tax rates based off the ls_get_url xml. What I am getting is ls_status_text = 'OK' and ll_Status_code = 200 ( anything >300 is a problem).
// Get request
loo_xmlhttp.open ("GET",ls_get_url , false)
loo_xmlhttp.send()
//Get response
ls_status_text = ''
ls_status_text = loo_xmlhttp.StatusText
ll_status_code = loo_xmlhttp.Status
after the above block of code runs successfully the following code runs:
if ll_status_code >= 300 then
MessageBox("HTTP POST Request Failed", ls_response_text)
else
//Get the response we received from the web server
ls_response_text = loo_xmlhttp.ResponseText
MessageBox("POST Request Succeeded", ls_response_text)
end if
I get the "POST Request Succeeded" messagebox but the ls_response_text contains the Mark Of The Web syntax.
Do you have any ideas that can help me along?
Thanks!
String ls_get_url, ls_post_url
String ls_post_variables, ls_response
String ls_response_text, ls_status_text
long ll_status_code
OleObject loo_xmlhttp
//include parameters on the URL here for get parameters
ls_get_url = 'http://10.1.1.65:8095/vertex-ui/vertextcc.jsp'
try
//Create an instance of our COM object
loo_xmlhttp = CREATE oleobject
loo_xmlhttp.ConnectToNewObject( 'Microsoft.XMLHTTP')
// Get request
loo_xmlhttp.open ("GET",ls_get_url , false)
loo_xmlhttp.send()
//Get response
ls_status_text = ''
ls_status_text = loo_xmlhttp.StatusText
ll_status_code = loo_xmlhttp.Status
//Check HTTP Response code for errors
if ll_status_code >= 300 then
MessageBox("HTTP GET Request Failed", ls_response_text)
else
//Get the response we received from the web server
ls_response_text = loo_xmlhttp.ResponseText
MessageBox("GET Request Succeeded", ls_response_text)
end if
ls_post_url = 'http://10.1.1.65:8095/vertex-ui/vertextcc.jsp'
ls_post_variables = "I add my custom xml here - I can run it in the vertex software and the xml executes fine"
loo_xmlhttp.open ("POST",ls_post_url, false)
loo_xmlhttp.send(ls_post_variables)
//Get response
ls_status_text = loo_xmlhttp.StatusText
ll_status_code = loo_xmlhttp.Status
//Check HTTP Response code for errors
if ll_status_code >= 300 then
MessageBox("HTTP POST Request Failed", ls_response_text)
else
//Get the response we received from the web server
ls_response_text = loo_xmlhttp.ResponseText
MessageBox("POST Request Succeeded", ls_response_text)
end if
loo_xmlhttp.DisconnectObject()
catch (RuntimeError rte)
MessageBox("Error", "RuntimeError - " + rte.getMessage())
end try
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一个按需 Vertex 服务。我在端口 80 上输入 .../vertex-ui/vertexcc.jsp 地址并收到登录提示。因此,看来您需要先发布登录数据,然后再开始向其推送 XML。由于我没有帐户,我无法再继续寻找。我不知道登录后服务器会给你什么,但如果这是一个可以粘贴 XML 的页面,你可以安装 Fiddler 并准确查看帖子中的内容。 Fiddler 还将向您显示 Microsoft XMLHTTP 正在发布的内容以及服务器正在发回的内容。
There's an On Demand Vertex service. I hit the .../vertex-ui/vertextcc.jsp address on port 80 and got a login prompt. So it appears you need to Post the login data before you start shoving XML at it. I couldn't look any farther as I don't have an account. I don't know what the server would give you after you log in, but if it's a page you can paste XML into, you could install Fiddler and see exactly what belongs in the Post. Fiddler will also show you what Microsoft XMLHTTP is posting and what the server is sending back.