| | |
| | | TextBody: |
| | | [* |
| | | // Administrator Oct-26-2023 (created) |
| | | info( "Sales Segment Finished, Start Get StockingPoint From Api" ) |
| | | //info( "Sales Segment Finished, Start Get StockingPoint From Api" ) |
| | | //bodynumber := "2"; |
| | | //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(); |
| | | //info( postrequestbodystring ); |
| | | // |
| | | //parameter := select( owner, GlobalParameters, param, param.AttributeName() = "test" ); |
| | | //body := parameter.PostRequestBody(); |
| | | //address := parameter.Address(); |
| | | //url := parameter.AttributeValue(); |
| | | //port := [Number]parameter.Port(); |
| | | // |
| | | //// for HTTPS requests: |
| | | //i := HTTPInterface::Create( address, port); |
| | | ////i := HTTPInterface::Create( address ,443); |
| | | //info( address, url, port, body ); |
| | | // |
| | | //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 |
| | | // |
| | | //i.Call(body); // Call's argument is for POST method's content. |
| | | //htmlresult := i.Result(); |
| | | //info( htmlresult ); |
| | | // |
| | | //htmlresponse := JSON::Parse( htmlresult ); |
| | | //info( htmlresponse ); |
| | | |
| | | info( "Init StockingPoint For Api" ) |
| | | existparameter := select( owner, GlobalParameters, param, param.AttributeName() = "StockingPoint" ); |
| | | if( not isnull( existparameter ) ){ |
| | | existparameter.Delete(); |
| | | } |
| | | spparameter := owner.GlobalParameters( relnew ); |
| | | spparameter.AttributeName( "StockingPoint" ); |
| | | spparameter.AttributeValue( "/otdService/https/GetStockingPointsInfo" ); |
| | | spparameter.Address( "api-uat-sgc.tianma.cn" ); |
| | | spparameter.Port( "443" ); |
| | | bodynumber := "2"; |
| | | postrequestbody := JSON::Object() |
| | | .Add( "serviceInterfaceCode", "ESBOTDH000" + bodynumber ) |
| | |
| | | .Add( "dataType", "JSON" ) |
| | | .Add( "data", JSON::Object() |
| | | .Add( "pageIndex", "1" ) ).Build(); |
| | | |
| | | info( DateTime::Now().Format( "Y-M2-D2 H:m:s" ) ); |
| | | postrequestbodystring := postrequestbody.AsString(); |
| | | info( postrequestbodystring ); |
| | | spparameter.PostRequestBody( postrequestbodystring ); |
| | | |
| | | parameter := select( owner, GlobalParameters, param, param.AttributeName() = "test" ); |
| | | body := parameter.PostRequestBody(); |
| | | address := parameter.Address(); |
| | | url := parameter.AttributeValue(); |
| | | port := [Number]parameter.Port(); |
| | | info( "Init CurrencyInfo For Api" ) |
| | | existparameter := select( owner, GlobalParameters, param, param.AttributeName() = "CurrencyInfo" ); |
| | | if( not isnull( existparameter ) ){ |
| | | existparameter.Delete(); |
| | | } |
| | | ciparameter := owner.GlobalParameters( relnew ); |
| | | ciparameter.AttributeName( "CurrencyInfo" ); |
| | | ciparameter.AttributeValue( "/otdService/https/GetCurrenciesInfo" ); |
| | | ciparameter.Address( "api-uat-sgc.tianma.cn" ); |
| | | ciparameter.Port( "443" ); |
| | | bodynumber := "1"; |
| | | 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(); |
| | | postrequestbodystring := postrequestbody.AsString(); |
| | | ciparameter.PostRequestBody( postrequestbodystring ); |
| | | |
| | | // for HTTPS requests: |
| | | i := HTTPInterface::Create( address, port); |
| | | //i := HTTPInterface::Create( address ,443); |
| | | info( address, url, port, body ); |
| | | info( "Init CurrencyRates For Api" ) |
| | | existparameter := select( owner, GlobalParameters, param, param.AttributeName() = "CurrencyRates" ); |
| | | if( not isnull( existparameter ) ){ |
| | | existparameter.Delete(); |
| | | } |
| | | crparameter := owner.GlobalParameters( relnew ); |
| | | crparameter.AttributeName( "CurrencyRates" ); |
| | | crparameter.AttributeValue( "/otdService/https/GetCurrencyRatesInfo" ); |
| | | crparameter.Address( "api-uat-sgc.tianma.cn" ); |
| | | crparameter.Port( "443" ); |
| | | bodynumber := "5"; |
| | | 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(); |
| | | postrequestbodystring := postrequestbody.AsString(); |
| | | crparameter.PostRequestBody( postrequestbodystring ); |
| | | |
| | | i.URL(url); |
| | | i.SSL(false); |
| | | //i.SSL(true); |
| | | //i.SSLKeystore('MyKeystore'); // created in the Config Utility |
| | | info( "Init Lanes For Api" ) |
| | | existparameter := select( owner, GlobalParameters, param, param.AttributeName() = "Lanes" ); |
| | | if( not isnull( existparameter ) ){ |
| | | existparameter.Delete(); |
| | | } |
| | | lparameter := owner.GlobalParameters( relnew ); |
| | | lparameter.AttributeName( "Lanes" ); |
| | | lparameter.AttributeValue( "/otdService/https/GetLanesInfo" ); |
| | | lparameter.Address( "api-uat-sgc.tianma.cn" ); |
| | | lparameter.Port( "443" ); |
| | | bodynumber := "3"; |
| | | 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(); |
| | | postrequestbodystring := postrequestbody.AsString(); |
| | | lparameter.PostRequestBody( postrequestbodystring ); |
| | | |
| | | i.PostMethod(true); //it's a POST method |
| | | |
| | | i.Call(body); // Call's argument is for POST method's content. |
| | | htmlresult := i.Result(); |
| | | info( htmlresult ); |
| | | |
| | | htmlresponse := JSON::Parse( htmlresult ); |
| | | info( htmlresponse ); |
| | | info( "Init LaneLegs For Api" ) |
| | | existparameter := select( owner, GlobalParameters, param, param.AttributeName() = "LaneLegs" ); |
| | | if( not isnull( existparameter ) ){ |
| | | existparameter.Delete(); |
| | | } |
| | | llparameter := owner.GlobalParameters( relnew ); |
| | | llparameter.AttributeName( "LaneLegs" ); |
| | | llparameter.AttributeValue( "/otdService/https/GetLaneLegsInfo" ); |
| | | llparameter.Address( "api-uat-sgc.tianma.cn" ); |
| | | llparameter.Port( "443" ); |
| | | bodynumber := "4"; |
| | | 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(); |
| | | postrequestbodystring := postrequestbody.AsString(); |
| | | llparameter.PostRequestBody( postrequestbodystring ); |
| | | *] |
| | | } |