1. Ashok Kumar Pattanaik
  2. PowerBuilder
  3. Friday, 17 May 2019 17:15 PM UTC

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.

https://www.appeon.com/developers/get-help/knowledgebase/call-soap-web-service-using-httpclient-object.html

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 = ''+&
'http://www.w3.org/2001/XMLSchema-instance" '+&
'xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="'">http://schemas.xmlsoap.org/soap/envelope/">'+&
'+&
'    '">http://V002.service.rewardssoa.bankofamerica.com">'+&
'      '+&
'    '+&
'+&
'
'

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

 

 

Accepted Answer
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 20 May 2019 18:32 PM UTC
  2. PowerBuilder
  3. # Permalink

I'm not sure what headers are required for a SOAP call but I do know that the body is an XML document. I'm not familiar enough with it to tell you any more detail.

Comment
  1. David Peace (Powersoft)
  2. Tuesday, 21 May 2019 09:42 AM UTC
A while back I used Rolands winhttp to perform a Soap Call, it has a function called soapcall witht he following code:

// -----------------------------------------------------------------------

// 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
  1. Helpful
  1. Ashok Kumar Pattanaik
  2. Tuesday, 21 May 2019 10:35 AM UTC
Thank You Roland. Now I am able to send header info data to httpclient. Following way I am setting header data.



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
  1. Helpful
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Friday, 17 May 2019 19:15 PM UTC
  2. PowerBuilder
  3. # 1

Honestly, you can probably get it working using REST faster than converting your SOAP code to HTTPClient, but it's do-able using Roland's suggestions above if you are set on using the SOAP call.  REST is a better long term solution also.

 

Just my $.02

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Friday, 17 May 2019 18:02 PM UTC
  2. PowerBuilder
  3. # 2

The answer is right in your question. The HttpClient object function SetRequestHeader is used to add the required headers.

You can use an HTTP monitoring tool like Postman (mentioned in the page you linked) to see exactly what the 12.5 SOAP connection is sending. Once you have a log  of the headers sent by the SOAP call, add SetRequestHeader calls to reproduce it.

 

Comment
  1. Ashok Kumar Pattanaik
  2. Monday, 20 May 2019 08:19 AM UTC
Appreciating your response to the queries. Actually our application writing into SOAPLOG when service call made in PB12.5 version. I have attached logs data ( portion of contain so many params) that how it sending it to the service. So how will I add those while adding it to SetRequestHeader() method using HTTPClient.

Awaiting your response. Thank You!!!



SOAPLOG

=============

User-Agent: EasySoap++/0.6

Content-Type: text/xml; charset=utf-8

SOAPAction: "auditIAASEventSuccess"

Content-Length: 2162















auditIAASEvent

auditIAASEventLOGIN

V002





PAG-LOGIN

WebHeader

V002



PAG

login

PAG-WS

iaas

V002

PAG

PAG_auditIAASEventLOGIN_90GRM300_19:30:31:896_165.42.87.175

F6C3BE50D58BD

2019-05-17T14:00:31.896Z

90GRM300

MGR

false



90GRM300

login

0







165.42.87.175

F6C3BE50D58BD

443

login

















Thanks,

Ashok
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


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