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
Thanks for quick reply.
Yes we have already using postman to consume .Net WCF Service but we did not find the exact header and content-type to consume it on postman IDE. if you have any idea about setting then please do share with us. Thank you
Nabeel