Skip to content

Commit

Permalink
Merge pull request #18538 from shamser/issue31618
Browse files Browse the repository at this point in the history
HPCC-31618 Internal clients use latest version of ESP services unless generated_client_version specified

Reviewed-By: Anthony Fishbeck <[email protected]>
Reviewed-by: Jake Smith <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Apr 26, 2024
2 parents 7cb3acb + 7950dbc commit 083f445
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion esp/scm/ws_access.ecm
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ ESPresponse [nil_remove] UserAccountExportResponse
[http_content("application/octet-stream")] binary Result;
};

ESPservice [version("1.17"), auth_feature("NONE"), exceptions_inline("./smc_xslt/exceptions.xslt")] ws_access
ESPservice [version("1.17"), generated_client_version("0.0"), auth_feature("NONE"), exceptions_inline("./smc_xslt/exceptions.xslt")] ws_access
{
ESPmethod [client_xslt("/esp/xslt/access_users.xslt")] Users(UserRequest, UserResponse);
ESPmethod [client_xslt("/esp/xslt/access_useredit.xslt")] UserEdit(UserEditRequest, UserEditResponse);
Expand Down
2 changes: 1 addition & 1 deletion esp/scm/ws_cloud.ecm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ESPresponse [encode(0)] GetServicesResponse
[json_inline(1)] string Result;
};

ESPservice [auth_feature("CloudAccess:ACCESS"), version("1.01"), exceptions_inline("./smc_xslt/exceptions.xslt")] WsCloud
ESPservice [auth_feature("CloudAccess:ACCESS"), version("1.01"), generated_client_version("0.0"), exceptions_inline("./smc_xslt/exceptions.xslt")] WsCloud
{
ESPmethod [auth_feature("CloudAccess:READ")] GetPODs(GetPODsRequest, GetPODsResponse);
ESPmethod [auth_feature("CloudAccess:READ"), min_ver("1.01")] GetServices(GetServicesRequest, GetServicesResponse);
Expand Down
2 changes: 1 addition & 1 deletion esp/scm/ws_configmgr.ecm
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ ESPrequest WizardTestRequest



ESPservice [auth_feature("DEFERRED"),version("2.0"), default_client_version("2.0"), exceptions_inline("xslt/exceptions.xslt"), disable_profile_execution] ws_configmgr
ESPservice [auth_feature("DEFERRED"), version("2.0"), default_client_version("2.0"), exceptions_inline("xslt/exceptions.xslt"), disable_profile_execution] ws_configmgr
{
ESPMethod
[
Expand Down
2 changes: 1 addition & 1 deletion esp/scm/ws_esdlconfig.ecm
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ ESPresponse [exceptions_inline] ListESDLBindingsResponse
};

#define VERSION_FOR_ESDLCMD "1.5"
ESPservice [auth_feature("ESDLConfigAccess:ACCESS"), version("1.5"), exceptions_inline("./smc_xslt/exceptions.xslt")] WsESDLConfig
ESPservice [auth_feature("ESDLConfigAccess:ACCESS"), version("1.5"), generated_client_version("0.0"), exceptions_inline("./smc_xslt/exceptions.xslt")] WsESDLConfig
{
ESPmethod Echo(EchoRequest, EchoResponse);
ESPmethod [auth_feature("ESDLConfigAccess:WRITE")] PublishESDLDefinition(PublishESDLDefinitionRequest, PublishESDLDefinitionResponse);
Expand Down
2 changes: 1 addition & 1 deletion esp/scm/ws_loggingservice.ecm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ESPresponse [exceptions_inline] UpdateLogResponse
string StatusMessage;
};

ESPService [auth_feature("DEFERRED"), version("1.0"), noforms, use_method_name] WsLoggingService
ESPService [auth_feature("DEFERRED"), version("1.0"), generated_client_version("0.0"), noforms, use_method_name] WsLoggingService
{
ESPmethod GetTransactionSeed(GetTransactionSeedRequest, GetTransactionSeedResponse);
ESPmethod UpdateLog(UpdateLogRequest, UpdateLogResponse);
Expand Down
2 changes: 1 addition & 1 deletion esp/scm/ws_machine.ecm
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ ESPresponse [encode(0), nil_remove, exceptions_inline] GetNodeGroupUsageResponse
};

//-------- service ---------
ESPservice [auth_feature("DEFERRED"), version("1.18")] ws_machine
ESPservice [auth_feature("DEFERRED"), version("1.18"), generated_client_version("0.0")] ws_machine
{
ESPmethod [resp_xsl_default("./smc_xslt/clusterprocesses.xslt"), exceptions_inline("./smc_xslt/exceptions.xslt")]
GetTargetClusterInfo(GetTargetClusterInfoRequest, GetTargetClusterInfoResponse);
Expand Down
2 changes: 1 addition & 1 deletion esp/scm/ws_resources.ecm
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ ESPresponse [nil_remove, exceptions_inline] TargetQueryResponse
ESParray<string> Roxies;
};

ESPservice [auth_feature("ResourceQueryAccess:ACCESS"), version("1.03"), exceptions_inline("./smc_xslt/exceptions.xslt"), disable_profile_execution] WsResources
ESPservice [auth_feature("ResourceQueryAccess:ACCESS"), version("1.03"), generated_client_version("0.0"), exceptions_inline("./smc_xslt/exceptions.xslt"), disable_profile_execution] WsResources
{
ESPmethod [auth_feature("ResourceQueryAccess:READ"), min_ver("1.03")] TargetQuery(TargetQueryRequest, TargetQueryResponse);
ESPmethod [auth_feature("ResourceQueryAccess:READ")] ServiceQuery(ServiceQueryRequest, ServiceQueryResponse);
Expand Down
2 changes: 1 addition & 1 deletion esp/scm/ws_topology.ecm
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ ESPresponse [exceptions_inline] TpListLogFilesResponse
ESParray<ESPStruct LogFileStruct> Files;
};

ESPservice [auth_feature("DEFERRED"), noforms, version("1.32"), cache_group("ESPWsTP"), exceptions_inline("./smc_xslt/exceptions.xslt")] WsTopology
ESPservice [auth_feature("DEFERRED"), noforms, version("1.32"), generated_client_version("0.0"), cache_group("ESPWsTP"), exceptions_inline("./smc_xslt/exceptions.xslt")] WsTopology
{
ESPmethod [cache_seconds(180), cache_global(1), resp_xsl_default("/esp/xslt/targetclusters.xslt")] TpTargetClusterQuery(TpTargetClusterQueryRequest, TpTargetClusterQueryResponse);
ESPmethod [cache_seconds(180), cache_global(1), resp_xsl_default("/esp/xslt/topology.xslt")] TpClusterQuery(TpClusterQueryRequest, TpClusterQueryResponse);
Expand Down
2 changes: 1 addition & 1 deletion testing/esp/esdlcmd/inputs/ws_usemethodname.ecm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ESPresponse OrangeResponse
bool Peels;
};

ESPservice[version("1"), use_method_name] WsUseMethodName
ESPservice[version("1"), generated_client_version("0.0"), use_method_name] WsUseMethodName
{
ESPmethod Unique(FooRequest, FooResponse);
ESPmethod Apple(FruitRequest, FruitResponse);
Expand Down
2 changes: 1 addition & 1 deletion testing/esp/esdlcmd/inputs/ws_userequestname.ecm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ESPresponse OrangeResponse
bool Peels;
};

ESPservice[version("1")] WsUseRequestName
ESPservice[version("1"), generated_client_version("0.0")] WsUseRequestName
{
ESPmethod Unique(FooRequest, FooResponse);
ESPmethod Apple(FruitRequest, FruitResponse);
Expand Down
13 changes: 8 additions & 5 deletions tools/hidl/hidlcomp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4914,12 +4914,15 @@ void EspServInfo::write_esp_client_ipp()
outs("\tIMPLEMENT_IINTERFACE;\n\n");

outf("\tCClient%s()\n\t{\n", name_);
outs("\t\tsoap_reqid=0;\n\t");
outf("\t\tsoap_action.append(\"%s\");\n\t", name_);
const char *ver = getMetaString("default_client_version", NULL);
outs("\t\tsoap_reqid=0;\n");
outf("\t\tsoap_action.append(\"%s\");\n", name_);
// use latest 'version' unless 'generated_client_version' provided
const char *ver = getMetaString("generated_client_version", nullptr);
if (!ver || !*ver)
ver = getMetaString("version", nullptr);
if (ver && *ver)
outf("\t\tsoap_action.append(\"?ver_=\").append(%s);\n\t", ver);
outf("}\n\tvirtual ~CClient%s(){}\n", name_);
outf("\t\tsoap_action.append(\"?ver_=\").append(%s);\n", ver);
outf("\t}\n\tvirtual ~CClient%s(){}\n", name_);

outs("\tvirtual void setProxyAddress(const char *address)\n\t{\n\t\tsoap_proxy.set(address);\n\t}\n");
outs("\tvirtual void addServiceUrl(const char *url)\n\t{\n\t\tsoap_url.set(url);\n\t}\n");
Expand Down

0 comments on commit 083f445

Please sign in to comment.