Hi,
Recently we migrated our application from PB12.5 to PB2017 R3 in order to support TLS1.2. We are following easySOAP method and connecting SOAP based webservice. Due to lots of efforts and budget we are not converting SOAP webservice to REstful service. As per instruction provided in appeon site, I am modifying service request replacing SOAPCONNECTION with HTTPCLIENT.
But I am confusing how to accommodate below line of codes in HTTPCLIENT based call.
PB12.5 SOAP
==============
tns3__osarequestheader GenericWBHdr
intf__retrievegenericparamdetailsout GenericDetailsOut[]
intf__genericparmvalue GenericDetailsValue[]
GenericWBHdr = of_get_web_header(li_reqno)
intf__retrievegenericparamdetailsin GenericParmIn
GenericParmIn.osarequestheader = GenericWBHdr
GenericParmIn.osarequestheader.task = "GenericDetails"
GenericDetailsOut = webservice.retrievegenericparamdetails( GenericParmIn)
of_get_web_header()
tns3__osarequestheader osareqhdr
osareqhdr.isreplyexpected = True
osareqhdr.timestamp = Datetime(Today(), Now())
osareqhdr.applicationid = "TEMP"
osareqhdr.channel = ""
osareqhdr.component = ""
osareqhdr.revision = ""
osareqhdr.role = "MGR"
osareqhdr.traceid = of_get_traceid( )
osareqhdr.userid = user
osareqhdr.providerservice.name = "TEMP222"
osareqhdr.providerservice.operation = "test"
osareqhdr.requestorservice.name = "Tier"
PB2017 R3
============
ls_url = "http://temphost/RewardsAdministrationServiceV002"
How will I pass above mandatory header data(of_get_web_header()) to HTTPCLIENT?
ls_body = ''+&
'
'xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="'">http://schemas.xmlsoap.org/soap/envelope/">'+&
'
'
'
' '+&
'
'
lnv_HttpClient = Create httpClient
lnv_HttpClient.SetRequestHeader("Content-Type", "text/xml")
lnv_HttpClient.sendrequest('POST',ls_url,ls_body)
How will I replace below line of codes into HTTPCLIENT?
PB12.5 SOAPBASED WEbSErvice.
intf__retrievegenericparamdetailsout GenericDetailsOut[]
GenericDetailsOut = webservice.retrievegenericparamdetails( GenericParmIn)
Please help me to migrate those lines of codes using HTTPCLIENT compatible to TLS1.2.
Thanks,
Ashok
// -----------------------------------------------------------------------
// SCRIPT: n_winhttp.PostSOAP
//
// PURPOSE: This function duplicates the standard PostURL function
// except it returns the result instead of an
// InternetResult object reference.
//
// ARGUMENTS: as_urlname - The URL where data is being posted
// ablob_data - The data being posted
// as_mimetype - The MIMETYPE of data being posted
// ablob_response - The response data
//
// RETURN: Length of Response or Zero for errors
//
// DATE PROG/ID DESCRIPTION OF CHANGE / REASON
// ---------- --------- -----------------------------------------------
// 03/25/2014 RolandS Initial Coding
// -----------------------------------------------------------------------
ULong lul_length
If Open("SOAPAction", as_urlname) = False Then
Return 0
End If
lul_length = Len(ablob_data)
SetRequestHeader("Content-Length", String(lul_length))
SetRequestHeader("Content-Type", 'application/soap+xml; charset=utf-8')
SetRequestheader( 'Accept', 'text/xml')
SetRequestHeader("SOAPAction", as_soap_action)
Return SendData(ablob_data, ablob_response)
-------------------------------------------------------------------------------------------------------------------
I suggest that you can use the same concepts in the httpclient using the set header functions to add these header values. You can get the values from the log file you posted earlier.
Regards
David
ls_header=''+&
''+&
' '+&
' '+&
' '+&
' '+&
' '+&
' WSV002'+&
' RetrieveEMPDetails'+&
' '+&
' V232'+&
' '+&
' '+&
' EMPDetails-WS'+&
' TEST'+&
' V987'+&
' '+&
' TTT'+&
' TTT'+&
' WS'+&
' EMPDetails'+&
' R5678'+&
' Test'+&
' TTT_RetrieveEMPDetails_XXXXXX_10:24:27:939_111.111.111.111+&
' '+&
' RRRRRRRRRR'+&
' '+&
' 2019-05-08T14:24:27.937Z'+&
' XXXXXX'+&
' RRR'+&
' true'+&
' '+&
' '+&
' '+&
' '+&
''
Thanks,
Ashok Pattanaik