PowerBuilder
PowerBuilder
SOAP Request to fseservicetest.sanita.finanze.it with Basic Authentication
See more HTTP Misc Examples
Demonstrates sending a SOAP request to fseservicetest.sanita.finanze.it with Basic Authentication.Chilkat PowerBuilder Downloads
integer li_rc
integer li_Success
oleobject loo_Http
oleobject loo_Xml
string ls_SoapEnvelope
string ls_Domain
string ls_Path
oleobject loo_Req
oleobject loo_Resp
oleobject loo_XmlResp
li_Success = 0
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
loo_Xml = create oleobject
li_rc = loo_Xml.ConnectToNewObject("Chilkat.Xml")
li_Success = 0
// Create the SOAP envelope...
loo_Xml.Tag = "soapenv:Envelope"
loo_Xml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/")
loo_Xml.AddAttribute("xmlns:stat","http://statoconsensirichiesta.xsd.fse.ini.finanze.it")
loo_Xml.AddAttribute("xmlns:tip","http://tipodatistatoconsensi.xsd.fse.ini.finanze.it")
loo_Xml.UpdateChildContent("soapenv:Header","")
loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoUtente","XXXXXXAAABBBCCC")
loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:pinCode","...")
loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoOrganizzazione","999")
loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:StrutturaUtente","123456789")
loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:RuoloUtente","ZZZ")
loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:ContestoOperativo","")
loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoAssistitoGenitoreTutore","")
loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:PresaInCarico","true")
loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:TipoAttivita","READ")
loo_Xml.UpdateChildContent("soapenv:Body|stat:StatoConsensiRichiesta|stat:IdentificativoAssistitoConsenso","ABCDEFGHIJKLM")
ls_SoapEnvelope = loo_Xml.GetXml()
ls_Domain = "fseservicetest.sanita.finanze.it"
ls_Path = "/FseInsServicesWeb/services/fseStatoConsensi"
loo_Req = create oleobject
li_rc = loo_Req.ConnectToNewObject("Chilkat.HttpRequest")
loo_Req.HttpVerb = "POST"
loo_Req.SendCharset = 0
loo_Req.AddHeader("Content-Type","application/soap+xml; charset=utf-8")
loo_Req.Path = ls_Path
li_Success = loo_Req.LoadBodyFromString(ls_SoapEnvelope,"utf-8")
// User name and Password for Basic Authentication
loo_Http.Login = "XXXXXXAAABBBCCC"
loo_Http.Password = "MYPASSWORD"
loo_Resp = create oleobject
li_rc = loo_Resp.ConnectToNewObject("Chilkat.HttpResponse")
li_Success = loo_Http.HttpSReq(ls_Domain,443,1,loo_Req,loo_Resp)
if li_Success = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
destroy loo_Xml
destroy loo_Req
destroy loo_Resp
return
end if
loo_XmlResp = create oleobject
li_rc = loo_XmlResp.ConnectToNewObject("Chilkat.Xml")
li_Success = loo_XmlResp.LoadXml(loo_Resp.BodyStr)
Write-Debug loo_XmlResp.GetXml()
destroy loo_Http
destroy loo_Xml
destroy loo_Req
destroy loo_Resp
destroy loo_XmlResp