Quintiq file version 2.0
|
#parent: #root
|
Method TestDataConnect (
|
String DataName
|
) as String
|
{
|
Description: 'Test Data Connect'
|
TextBody:
|
[*
|
//Administrator Jul-6-2023 (created)
|
parms := this.GetDataConnectParms( DataName );
|
address := parms.Element( 0 );
|
url := parms.Element( 1 );
|
port := parms.Element( 2 );
|
bodynumber := parms.Element( 3 );
|
|
// for HTTPS requests:
|
i := HTTPInterface::Create( address, [Number]port);
|
//i := HTTPInterface::Create( address ,443);
|
info( parms.ToString( "***" ) );
|
|
i.URL(url);
|
i.SSL(false);
|
//i.SSL(true);
|
//i.SSLKeystore('MyKeystore'); // created in the Config Utility
|
|
i.PostMethod(true); //it's a POST method
|
postrequestbody := JSON::Object()
|
.Add( "serviceInterfaceCode", "ESBOTDH000" + bodynumber )
|
.Add( "fromSystemCode", "OTDH000" + bodynumber )
|
.Add( "toInterfaceCode", "QIDH000" + bodynumber )
|
.Add( "ouZone", "OU_TMSH" )
|
.Add( "uuid", "1617355496bb588e353e80147eea5f45" )
|
.Add( "requestTime", DateTime::Now().Format( "Y-M2-D2 H:m:s" ) )
|
.Add( "dataType", "JSON" )
|
.Add( "data", JSON::Object()
|
.Add( "pageIndex", "1" ) ).Build();
|
|
info( DateTime::Now().Format( "Y-M2-D2 H:m:s" ) );
|
postrequestbodystring := postrequestbody.AsString();
|
i.Call(postrequestbodystring); // Call's argument is for POST method's content.
|
htmlresult := i.Result();
|
info( htmlresult );
|
|
result := this.GetStatusFromJson( JSON::Parse( htmlresult ), DataName );
|
|
return result;
|
*]
|
}
|