SBL-ODU-01007 HTTP 请求不包含有效的 SOAPAction 标头

发布于 2024-12-04 03:44:53 字数 1662 浏览 3 评论 0原文

我希望有人可以帮助我走向正确的方向...

我正在使用 Powerbuilder 12 Classic 并尝试使用 Oracle CRM OnDemand Web 服务。

使用 Msxml2.XMLHTTP.4.0 命令,我已经能够使用 https 进行连接并检索会话 ID,当我调用该方法时需要将其发回。

当我运行下面的代码时,我收到 SBL-ODU-01007 The HTTP request did not contains a valid SOAPAction header 错误消息。我不确定我错过了什么?

OleObject loo_xmlhttp

ls_get_url = "https://secure-ausomxxxx.crmondemand.com/Services/Integration?command=login"

try
  loo_xmlhttp = CREATE oleobject
  loo_xmlhttp.ConnectToNewObject("Msxml2.XMLHTTP.4.0")

  loo_xmlhttp.open ("GET",ls_get_url, false)
  loo_xmlhttp.setRequestHeader("UserName", "xxxxxxx")
  loo_xmlhttp.setRequestHeader("Password", "xxxxxxx")

  loo_xmlhttp.send()

  cookie = loo_xmlhttp.getResponseHeader("Set-Cookie")

  sesId = mid(cookie, pos(cookie,"=", 1)+1, pos(cookie,";", 1)-(pos(cookie,"=", 1)+1))


  ls_post_url = "https://secure-ausomxxxx.crmondemand.com/Services/Integration/Activity;"
  ls_response_text = "jsessionid=" + sesId + ";"

  ls_post_url = ls_post_url + ls_response_text

  loo_xmlhttp.open ("POST",ls_post_url, false)

  loo_xmlhttp.setRequestHeader("COOKIE", left(cookie,pos(cookie,";",1)-1) ) 
  loo_xmlhttp.setRequestHeader("COOKIE", left(cookie,pos(cookie,";",1)-1) )

  ls_post_url2 = "document/urn:crmondemand/ws/activity/10/2004:Activity_QueryPage"

  loo_xmlhttp.setRequestHeader("SOAPAction", ls_post_url2)  

  loo_xmlhttp.send()

  ls_get_url = "https://secure-ausomxxxx.crmondemand.com/Services/Integration?command=logoff"

  loo_xmlhttp.open ("POST",ls_get_url, false)

  loo_xmlhttp.send()


catch (RuntimeError rte)

  MessageBox("Error", "RuntimeError - " + rte.getMessage())

end try

I am hoping someone can help get me in the right direction...

I am using Powerbuilder 12 Classic and trying to consume a Oracle CRM OnDemand web service.

Using Msxml2.XMLHTTP.4.0 commands, I have been able to connect using https and retrieve the session id, which I need to send back when I invoke the method.

When I run the code below, I get the SBL-ODU-01007 The HTTP request did not contain a valid SOAPAction header error message. I am not sure what I am missing??

OleObject loo_xmlhttp

ls_get_url = "https://secure-ausomxxxx.crmondemand.com/Services/Integration?command=login"

try
  loo_xmlhttp = CREATE oleobject
  loo_xmlhttp.ConnectToNewObject("Msxml2.XMLHTTP.4.0")

  loo_xmlhttp.open ("GET",ls_get_url, false)
  loo_xmlhttp.setRequestHeader("UserName", "xxxxxxx")
  loo_xmlhttp.setRequestHeader("Password", "xxxxxxx")

  loo_xmlhttp.send()

  cookie = loo_xmlhttp.getResponseHeader("Set-Cookie")

  sesId = mid(cookie, pos(cookie,"=", 1)+1, pos(cookie,";", 1)-(pos(cookie,"=", 1)+1))


  ls_post_url = "https://secure-ausomxxxx.crmondemand.com/Services/Integration/Activity;"
  ls_response_text = "jsessionid=" + sesId + ";"

  ls_post_url = ls_post_url + ls_response_text

  loo_xmlhttp.open ("POST",ls_post_url, false)

  loo_xmlhttp.setRequestHeader("COOKIE", left(cookie,pos(cookie,";",1)-1) ) 
  loo_xmlhttp.setRequestHeader("COOKIE", left(cookie,pos(cookie,";",1)-1) )

  ls_post_url2 = "document/urn:crmondemand/ws/activity/10/2004:Activity_QueryPage"

  loo_xmlhttp.setRequestHeader("SOAPAction", ls_post_url2)  

  loo_xmlhttp.send()

  ls_get_url = "https://secure-ausomxxxx.crmondemand.com/Services/Integration?command=logoff"

  loo_xmlhttp.open ("POST",ls_get_url, false)

  loo_xmlhttp.send()


catch (RuntimeError rte)

  MessageBox("Error", "RuntimeError - " + rte.getMessage())

end try

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

感情废物 2024-12-11 03:44:53

我相信您使用的登录和注销 URL 不正确;

以下是示例:

其余代码对我来说看起来不错。

I believe you are using incorrect URL for Login and Logoff;

Here is the sample:

Rest of the code looks OK to me.

瑶笙 2024-12-11 03:44:53

我在 PB 中通过 ole 使用 msxml 遇到了类似的问题。添加此内容可能会有所帮助:

loo_xmlhttp.setRequestHeader("Content-Type", "text/xml")

I have run into similar issues in PB with msxml through ole. Adding this may help:

loo_xmlhttp.setRequestHeader("Content-Type", "text/xml")

骷髅 2024-12-11 03:44:53

您需要确保 ls_post_url2 的值是 wsdl 文件中找到的值之一。只需在 wsdl 文件中搜索“soap:operationsoapAction”即可查看 SOAPAction 的有效值。

you need to make sure that the your value for ls_post_url2 is one of the values that is found in the wsdl file. Just search for "soap:operation soapAction" in the wsdl file to see the valid values for SOAPAction.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文