【问题标题】:SBL-ODU-01007 The HTTP request did not contain a valid SOAPAction headerSBL-ODU-01007 HTTP 请求不包含有效的 SOAPAction 标头
【发布时间】:2011-11-16 06:24:40
【问题描述】:

我希望有人能帮助我找到正确的方向......

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

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

当我运行以下代码时,我收到 SBL-ODU-01007 The HTTP request did not contain 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

【问题讨论】:

    标签: web-services soap powerbuilder msxml msxml4


    【解决方案1】:

    我认为您使用的登录和注销 URL 不正确;

    示例如下:

    其余代码在我看来没问题。

    【讨论】:

      【解决方案2】:

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

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

      【讨论】:

        【解决方案3】:

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

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2017-11-28
          • 1970-01-01
          • 1970-01-01
          • 2011-09-23
          • 1970-01-01
          • 2013-10-27
          • 2016-11-07
          • 2018-04-06
          相关资源
          最近更新 更多