- Nabeel Aslam
- PowerBuilder
- Monday, 11 April 2022 09:50 AM UTC
Hi Everyone,
We are migrating from PB 12.5.2 build 5629 to Appeon 2021. After code migration, we are trying to consume WCF Service using HTTPClient because the existing SOAP Connection and Create Instance approach is obsolete on latest Appeon 2021. During .NET service consumption we are facing response error of 400 bad request. Can anyone help us to resolve this issue or provide a alternate solution to consume .NET service. Source code has been place below for you reference.
Suggest the change that need to be incorporate
httpClient lo_client
integer li_ret , i , li_StatusCode
String lo_xml_request
string ls_url,ls_return,ls_soap_action
string ls_data
string ls_body
string ls_ret
lo_client = Create httpClient
ls_url="http://cms7017:49161/WKFLoginManager.svc?wsdl"
ls_soap_action ="http://tempuri.org/ILoginManager/LoginUser"
lo_client.SetRequestHeader("soapAction", ls_soap_action)
lo_client.SetRequestHeader("Content-Type", "application/soap+xml; charset=utf-8")
ls_body="username=ib2&password=a1!&moduleid=cms&clientmachine=cms&request_dte=2022-11-04 10:13:00.193"
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
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.