1

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
Hugh Brackett
  • 2,706
  • 14
  • 21
Carol
  • 11
  • 3

3 Answers3

1

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

Here is the sample:

Rest of the code looks OK to me.

j0k
  • 22,600
  • 28
  • 79
  • 90
0

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.

jlv
  • 1
0

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

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

F3.
  • 19
  • 3