1. Pbuser12 Ateikon
  2. PowerBuilder
  3. Monday, 23 October 2023 09:53 AM UTC

Dear friends,

 

  I have a issue with Getall soap.can any one share the sytax of the Getall or GetById...

 

i will share my code and error..

 

integer li_ret
integer li_StatusCode
string ls_url,ls_soap_action
string ls_data
string ls_body
string ls_ret

// Create an HTTP client object
httpClient lo_client


// Set the URL for the SOAP GET request
ls_url = "https://localhost:44339/McDonaldsSoapService.asmx"

ls_body ='<?xml version="1.0" encoding="utf-8"?>'
ls_body +='<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'
ls_body +="<soap:Body>"
ls_body +='<GetAllMcDonalds xmlns="http://tempuri.org/">'
ls_body += ' <requestDTO />'
ls_body += '</GetAllMcDonalds>'
ls_body += '</soap:Body>'
ls_body +='</soap:Envelope>'

 

lo_client = Create httpClient
// Set the request headers for a SOAP GET request

lo_client.SetRequestHeader("Content-Type","text/xml; charset=utf-8") // "text/xml")
lo_client.SetRequestHeader("SOAPAction","http://tempuri.org/GetAllMcDonalds")
lo_client.SetRequestHeader("Content-Length", ls_body)

//// Send the SOAP GET request
lo_client.sendrequest('GET', ls_url, ls_body)
li_StatusCode = lo_client.GetResponseStatusCode()
ls_ret = lo_client.GetResponseStatusText()
li_ret = lo_client.getresponsebody(ls_data)


destroy lo_client


messagebox("Service response", ls_data)



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