- New User
- PowerBuilder
- Friday, 12 August 2022 07:35 AM UTC
Hello,
i am trying to consume a WCF service and i am getting status code 400(Bad Request) in httpclient response. can anyone guide me what is wrong in consuming / calling the service ?
i want to call "GetCMSWorkQueue"method of service wkfqueuemanager.svc, can somebody tell me what's the problem
service
PB code
httpClient lo_client
integer li_ret , i , li_StatusCode
String lo_xml_request
string ls_url
string ls_data
string ls_body
string ls_ret
ls_url ="http://130.0.238.12:55555/wkfqueuemanager.svc/GetCMSWorkQueue"
ls_body = '<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"><soapenv:Header/><soapenv:Body><tem:ReceiveRequestNotifications><!--Optional:--><tem:userName>t3</tem:userName><!--Optional:--><tem:flag>F</tem:flag></tem:ReceiveRequestNotifications></soapenv:Body></soapenv:Envelope>'
lo_client = Create httpClient
//lo_client.SetRequestHeader("Content-Type", "text/xml")
lo_client.SetRequestHeader("Content-Type", "application/soap+xml; charset=utf-8")
lo_client.sendrequest('POST',ls_url,ls_body)
li_StatusCode = lo_client.GetResponseStatusCode()
ls_ret = lo_client.GetResponseStatusText( )
li_ret = lo_client.getresponsebody( ls_data)
destroy lo_client
Error
statuscode 400
"Bad Request"
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.