1. Oscar Rios
  2. PowerBuilder
  3. Tuesday, 7 November 2017 19:36 PM UTC

Hi

necesito su apoyo, necesito desarrollar un webservice utilizando Msxml2.DOMDocument.3.0, pero no encentro un ejemplo completo si alguien me pudiese alcanzar un ejemplo estaria muy agradecido.

Se que debo de utilizar OLEObject, e encontrado diversas sintaxis en la web pero ninguna me indica todos los pasos que debo de seguir.

saludos cordiales

Marco Meoni Accepted Answer Pending Moderation
  1. Wednesday, 8 November 2017 07:01 AM UTC
  2. PowerBuilder
  3. # 1

Hi,

please find below a working example of a MSXML2 WS client.

Just copy the code into a button a run it.

Cheers,

Marco

 

 

String ls_response
String ls_url = "http://www.webservicex.net/globalweather.asmx/GetCitiesByCountry?CountryName=SPAIN"
String ls_status_text
Long    ll_status_code
Integer li_rc

oleobject l_xmlhttp
l_xmlhttp = CREATE oleobject
li_rc = l_xmlhttp.ConnectToNewObject("MSXML2.XMLHTTP")
IF li_rc < 0 THEN
    MessageBox("ConnectToNewObject", "Error " + String(li_rc), StopSign!)
    Return
End If

l_xmlhttp.Open("GET", ls_url, False)
l_xmlhttp.send("")
ls_status_text = l_xmlhttp.StatusText
ll_status_code =  l_xmlhttp.Status // If ll_status_code >= 300 there is an HTTPS POST Error
ls_response = String(l_xmlhttp.ResponseText)
l_xmlhttp.DisconnectObject()

Clipboard(ls_response)

MessageBox("WS response", "WS response is in the clipboard. Paste it into notepad")

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.