From edd96ce40ca21ab2b3a183d862b1bd8ae78b0484 Mon Sep 17 00:00:00 2001 From: Gavin Halliday Date: Thu, 28 Sep 2023 09:22:50 +0100 Subject: [PATCH] HPCC-30349 Add open telemetry support to esp Signed-off-by: Gavin Halliday --- common/workunit/workunit.cpp | 9 +++ esp/bindings/http/platform/httpservice.cpp | 2 +- esp/bindings/http/platform/httptransport.cpp | 16 ++--- esp/bindings/http/platform/httptransport.ipp | 2 - esp/platform/esp.hpp | 11 ++-- esp/platform/espcontext.cpp | 42 ++++++++------ esp/services/esdl_svc_engine/esdl_binding.cpp | 9 ++- esp/services/ws_ecl/ws_ecl_service.cpp | 41 ++++--------- esp/services/ws_ecl/ws_ecl_service.hpp | 13 ----- system/jlib/jprop.cpp | 44 ++++++++++++++ system/jlib/jprop.hpp | 3 + system/jlib/jtrace.cpp | 58 ++++--------------- testing/regress/ecl/httpcall_multiheader.ecl | 10 +++- .../regress/ecl/key/httpcall_multiheader.xml | 4 +- .../ecl/key/soapcall_multihttpheader.xml | 4 +- .../regress/ecl/soapcall_multihttpheader.ecl | 8 ++- 16 files changed, 138 insertions(+), 138 deletions(-) diff --git a/common/workunit/workunit.cpp b/common/workunit/workunit.cpp index 30e36b76e82..64f569e5284 100644 --- a/common/workunit/workunit.cpp +++ b/common/workunit/workunit.cpp @@ -14644,6 +14644,9 @@ static_assert(_elements_in(traceDebugOptions) == _elements_in(traceHeaderNames), IProperties * extractTraceDebugOptions(IConstWorkUnit * source) { + if (!source) + return nullptr; + Owned target = createProperties(true); SCMStringBuffer temp; for (unsigned i=0; i < _elements_in(traceDebugOptions); i++) @@ -14662,6 +14665,9 @@ IProperties * extractTraceDebugOptions(IConstWorkUnit * source) IProperties * deserializeTraceDebugOptions(const IPropertyTree * debugOptions) { + if (!debugOptions) + return nullptr; + Owned target = createProperties(true); if (debugOptions) { @@ -14681,6 +14687,9 @@ IProperties * deserializeTraceDebugOptions(const IPropertyTree * debugOptions) void recordTraceDebugOptions(IWorkUnit * target, const IProperties * source) { + if (!source) + return; + for (unsigned i=0; i < _elements_in(traceDebugOptions); i++) { const char * headerName = traceHeaderNames[i]; diff --git a/esp/bindings/http/platform/httpservice.cpp b/esp/bindings/http/platform/httpservice.cpp index ea3cbb1f3e2..73ad82d2b5b 100644 --- a/esp/bindings/http/platform/httpservice.cpp +++ b/esp/bindings/http/platform/httpservice.cpp @@ -257,7 +257,7 @@ int CEspHttpServer::processRequest() } ctx->addTraceSummaryValue(LogMin, "custom_fields.URL", url.str(), TXSUMMARY_GRP_ENTERPRISE); - m_response->setHeader(HTTP_HEADER_HPCC_GLOBAL_ID, ctx->getGlobalId()); + m_response->setHeader(kGlobalIdHttpHeaderName, ctx->getGlobalId()); if(strieq(method.str(), OPTIONS_METHOD)) return onOptions(); diff --git a/esp/bindings/http/platform/httptransport.cpp b/esp/bindings/http/platform/httptransport.cpp index 7491e6f2703..258c853fcdd 100644 --- a/esp/bindings/http/platform/httptransport.cpp +++ b/esp/bindings/http/platform/httptransport.cpp @@ -1940,17 +1940,11 @@ void CHttpRequest::updateContext() m_context->setUseragent(useragent.str()); getHeader("Accept-Language", acceptLanguage); m_context->setAcceptLanguage(acceptLanguage.str()); - StringBuffer callerId, globalId; - getHeader(HTTP_HEADER_HPCC_GLOBAL_ID, globalId); - if (globalId.isEmpty()) - getHeader("hpcc-global-id", globalId); - if(globalId.length()) - m_context->setGlobalId(globalId); - getHeader(HTTP_HEADER_HPCC_CALLER_ID, callerId); - if (callerId.isEmpty()) - getHeader("hpcc-caller-id", callerId); - if(callerId.length()) - m_context->setCallerId(callerId); + + //MORE: The previous code would be better off querying httpHeaders... + Owned httpHeaders = getHeadersAsProperties(m_headers); + Owned requestSpan = queryTraceManager().createServerSpan("request", httpHeaders, SpanFlags::EnsureGlobalId); + m_context->setActiveSpan(requestSpan); } } diff --git a/esp/bindings/http/platform/httptransport.ipp b/esp/bindings/http/platform/httptransport.ipp index 5bb5964f903..33aa7e64691 100644 --- a/esp/bindings/http/platform/httptransport.ipp +++ b/esp/bindings/http/platform/httptransport.ipp @@ -53,8 +53,6 @@ enum MessageLogFlag #define HTTP_HEADER_CONTENT_ENCODING "Content-Encoding" #define HTTP_HEADER_TRANSFER_ENCODING "Transfer-Encoding" #define HTTP_HEADER_ACCEPT_ENCODING "Accept-Encoding" -#define HTTP_HEADER_HPCC_GLOBAL_ID "Global-Id" -#define HTTP_HEADER_HPCC_CALLER_ID "Caller-Id" class esp_http_decl CHttpMessage : implements IHttpMessage, public CInterface { diff --git a/esp/platform/esp.hpp b/esp/platform/esp.hpp index 272f024865e..54173681888 100644 --- a/esp/platform/esp.hpp +++ b/esp/platform/esp.hpp @@ -235,11 +235,12 @@ interface IEspContext : extends IInterface virtual void setRequest(IHttpMessage* req) = 0; virtual IHttpMessage* queryRequest() = 0; - virtual void setGlobalId(const char* id)=0; - virtual const char* getGlobalId()=0; - virtual void setCallerId(const char* id)=0; - virtual const char* getCallerId()=0; - virtual const char* getLocalId()=0; + virtual void setActiveSpan(ISpan * span)=0; + virtual ISpan * queryActiveSpan() const = 0; + virtual IProperties * getClientSpanHeaders() const = 0; + virtual const char* getGlobalId() const = 0; + virtual const char* getCallerId() const = 0; + virtual const char* getLocalId() const = 0; }; diff --git a/esp/platform/espcontext.cpp b/esp/platform/espcontext.cpp index 7d53cc740b6..f860f96bde8 100755 --- a/esp/platform/espcontext.cpp +++ b/esp/platform/espcontext.cpp @@ -89,9 +89,7 @@ class CEspContext : public CInterface, implements IEspContext Owned m_secureContext; StringAttr m_transactionID; - StringBuffer m_globalId; - StringBuffer m_localId; - StringBuffer m_callerId; + Owned m_activeSpan; IHttpMessage* m_request; public: @@ -116,9 +114,6 @@ class CEspContext : public CInterface, implements IEspContext updateTraceSummaryHeader(); m_secureContext.setown(secureContext); m_SecurityHandler.setSecureContext(secureContext); - appendGloballyUniqueId(m_localId); - // use localId as globalId unless we receive another - m_globalId.set(m_localId); } ~CEspContext() @@ -630,27 +625,38 @@ class CEspContext : public CInterface, implements IEspContext { return m_request; } - - virtual void setGlobalId(const char* id) + virtual void setActiveSpan(ISpan * span) override + { + m_activeSpan.set(span); + } + virtual ISpan * queryActiveSpan() const override { - m_globalId.set(id); + return m_activeSpan; } - virtual const char* getGlobalId() + //GH Can these be deleted? + virtual const char* getGlobalId() const override { - return m_globalId.str(); + if (!m_activeSpan) + return nullptr; + return m_activeSpan->queryGlobalId(); } - virtual void setCallerId(const char* id) + virtual const char* getCallerId() const override { - m_callerId.set(id); + if (!m_activeSpan) + return nullptr; + return m_activeSpan->queryCallerId(); } - virtual const char* getCallerId() + virtual const char* getLocalId() const override { - return m_callerId.str(); + if (!m_activeSpan) + return nullptr; + return m_activeSpan->queryLocalId(); } - // No setLocalId() - it should be set once only when constructed - virtual const char* getLocalId() + virtual IProperties * getClientSpanHeaders() const override { - return m_localId.str(); + if (!m_activeSpan) + return nullptr; + return ::getClientHeaders(m_activeSpan); } }; diff --git a/esp/services/esdl_svc_engine/esdl_binding.cpp b/esp/services/esdl_svc_engine/esdl_binding.cpp index fbb9b32153c..8dfc6cfede3 100755 --- a/esp/services/esdl_svc_engine/esdl_binding.cpp +++ b/esp/services/esdl_svc_engine/esdl_binding.cpp @@ -1571,9 +1571,12 @@ void EsdlServiceImpl::sendTargetSOAP(IEspContext & context, httpclient->setPassword(password.str()); } - Owned headers = createProperties(); - headers->setProp(HTTP_HEADER_HPCC_GLOBAL_ID, context.getGlobalId()); - headers->setProp(HTTP_HEADER_HPCC_CALLER_ID, context.getLocalId()); + Owned clientSpan; + ISpan * activeSpan = context.queryActiveSpan(); + if (activeSpan) + clientSpan.setown(activeSpan->createClientSpan("soapcall")); + + Owned headers = ::getClientHeaders(clientSpan); StringBuffer status; StringBuffer clreq(req); diff --git a/esp/services/ws_ecl/ws_ecl_service.cpp b/esp/services/ws_ecl/ws_ecl_service.cpp index 10535990734..7969b4ccf61 100644 --- a/esp/services/ws_ecl/ws_ecl_service.cpp +++ b/esp/services/ws_ecl/ws_ecl_service.cpp @@ -1993,20 +1993,18 @@ int CWsEclBinding::submitWsEclWorkunit(IEspContext & context, WsEclWuInfo &wsinf StringAttr wuid(workunit->queryWuid()); // NB queryWuid() not valid after workunit,clear() bool noTimeout = false; - if (httpreq) + + Owned clientSpan; + ISpan * activeSpan = context.queryActiveSpan(); + if (activeSpan) { - StringBuffer globalId, callerId; - wsecl->getHttpGlobalIdHeader(httpreq, globalId); - wsecl->getHttpCallerIdHeader(httpreq, callerId); - if (globalId.length()) - { - workunit->setDebugValue("GlobalId", globalId.str(), true); + clientSpan.setown(activeSpan->createClientSpan("wsecl/SubmitWorkunit")); + Owned httpHeaders = ::getClientHeaders(clientSpan); + recordTraceDebugOptions(workunit, httpHeaders); + } - StringBuffer localId; - appendGloballyUniqueId(localId); - workunit->setDebugValue("CallerId", localId.str(), true); //our localId becomes caller id for the next hop - DBGLOG("GlobalId: %s, CallerId: %s, LocalId: %s, Wuid: %s", globalId.str(), callerId.str(), localId.str(), wuid.str()); - } + if (httpreq) + { IProperties *params = httpreq->queryParameters(); if (params) noTimeout = params->getPropBool(".noTimeout", false); @@ -2087,27 +2085,12 @@ void CWsEclBinding::sendRoxieRequest(const char *target, StringBuffer &req, Stri if (!trim) url.append("?.trim=0"); - Owned headers; + IEspContext * ctx = httpreq->queryContext(); + Owned headers = ctx->getClientSpanHeaders(); Owned httpclient = httpctx->createHttpClient(NULL, url); bool noTimeout = false; if (httpreq) { - StringBuffer globalId, callerId; - wsecl->getHttpGlobalIdHeader(httpreq, globalId); - wsecl->getHttpCallerIdHeader(httpreq, callerId); - - if (globalId.length()) - { - headers.setown(createProperties()); - headers->setProp(kGlobalIdHttpHeaderName, globalId); - - StringBuffer localId; - appendGloballyUniqueId(localId); - if (localId.length()) - headers->setProp(kCallerIdHttpHeaderName, localId); - DBGLOG("GlobalId: %s, CallerId: %s, LocalId: %s", globalId.str(), callerId.str(), localId.str()); - } - IProperties *params = httpreq->queryParameters(); if (params) noTimeout = params->getPropBool(".noTimeout", false); diff --git a/esp/services/ws_ecl/ws_ecl_service.hpp b/esp/services/ws_ecl/ws_ecl_service.hpp index e6e354b92e0..8d3ce45e1ab 100644 --- a/esp/services/ws_ecl/ws_ecl_service.hpp +++ b/esp/services/ws_ecl/ws_ecl_service.hpp @@ -120,19 +120,6 @@ class CWsEclService : public CInterface, return false; } - StringBuffer &getHttpGlobalIdHeader(CHttpRequest *request, StringBuffer &value) - { - if (!getHttpIdHeader(request, kGlobalIdHttpHeaderName, value)) - getHttpIdHeader(request, kLegacyGlobalIdHttpHeaderName, value); - return value; - } - StringBuffer &getHttpCallerIdHeader(CHttpRequest *request, StringBuffer &value) - { - if (!getHttpIdHeader(request, kCallerIdHttpHeaderName, value)) - getHttpIdHeader(request, kLegacyCallerIdHttpHeaderName, value); - return value; - } - bool unsubscribeServiceFromDali() override {return true;} bool subscribeServiceToDali() override {return false;} bool detachServiceFromDali() override diff --git a/system/jlib/jprop.cpp b/system/jlib/jprop.cpp index 62d37d0056d..2ff7b961b75 100644 --- a/system/jlib/jprop.cpp +++ b/system/jlib/jprop.cpp @@ -280,6 +280,16 @@ class CPropertiesBase : implements IPROP, public CInterface properties.remove(propname); } } + virtual void setNonEmptyProp(PTYPE propname, const char *val) + { + if (propname) + { + if (!isEmptyString(val)) + properties.setValue(propname, val); + else + properties.remove(propname); + } + } virtual void appendProp(PTYPE propname, const char *val) { if (propname && val) @@ -402,6 +412,40 @@ IProperties *cloneProperties(const IProperties * source, bool nocase) return clone.getClear(); } +//This works on arrays of string of the form x=y and x: y +void extractHeaders(IProperties * target, const StringArray & httpHeaders, char separator) +{ + StringBuffer key; + ForEachItemIn(currentHeaderIndex, httpHeaders) + { + const char* httpHeader = httpHeaders.item(currentHeaderIndex); + if(isEmptyString(httpHeader)) + continue; + + const char* delineator = strchr(httpHeader, separator); + if ((delineator == nullptr) || (delineator == httpHeader)) + continue; + + const char * value = delineator + 1; + while (isspace(*value)) + value++; + + if (*value) + { + key.clear().append(delineator - httpHeader, httpHeader); + target->setProp(key, value); + } + } +} + +IProperties * getHeadersAsProperties(const StringArray & httpHeaders, char separator) +{ + Owned properties = createProperties(true); + extractHeaders(properties, httpHeaders, separator); + return properties.getClear(); +} + + static CProperties *sysProps = NULL; extern jlib_decl IProperties *querySystemProperties() diff --git a/system/jlib/jprop.hpp b/system/jlib/jprop.hpp index e2c85a02fd4..fdbb24e9ee3 100644 --- a/system/jlib/jprop.hpp +++ b/system/jlib/jprop.hpp @@ -43,6 +43,7 @@ interface jlib_decl IPropertiesOf : extends serializable virtual const char *queryProp(PTYPE propname) const = 0; virtual void setProp(PTYPE propname, int val) = 0; virtual void setProp(PTYPE propname, const char *val) = 0; + virtual void setNonEmptyProp(PTYPE propname, const char *val) = 0; virtual void appendProp(PTYPE propname, const char *val) = 0; virtual bool hasProp(PTYPE propname) const = 0; virtual PITER *getIterator() const = 0; @@ -75,6 +76,8 @@ extern jlib_decl IProperties *createProperties(const char *filename, bool nocase extern jlib_decl IProperties *cloneProperties(const IProperties * properties, bool nocase = false); extern jlib_decl IProperties *querySystemProperties(); extern jlib_decl IProperties *getSystemProperties(); +extern jlib_decl void extractHeaders(IProperties * target, const StringArray & httpHeaders, char separator = ':'); +extern jlib_decl IProperties * getHeadersAsProperties(const StringArray & httpHeaders, char separator = ':'); #endif diff --git a/system/jlib/jtrace.cpp b/system/jlib/jtrace.cpp index 46f01033c30..b45b67aed8e 100644 --- a/system/jlib/jtrace.cpp +++ b/system/jlib/jtrace.cpp @@ -235,19 +235,16 @@ class CSpan : public CInterfaceOf if (ctxProps == nullptr) return false; - if (!isEmptyString(hpccGlobalId.get())) - ctxProps->setProp(kGlobalIdHttpHeaderName, hpccGlobalId.get()); + ctxProps->setNonEmptyProp(kGlobalIdHttpHeaderName, queryGlobalId()); if (otelFormatted) { //The localid is passed as the callerid for the client request.... - if (!isEmptyString(hpccLocalId.get())) - ctxProps->setProp(kCallerIdHttpHeaderName, hpccLocalId.get()); + ctxProps->setNonEmptyProp(kCallerIdHttpHeaderName, queryLocalId()); } else { - if (!isEmptyString(hpccCallerId.get())) - ctxProps->setProp(kCallerIdHttpHeaderName, hpccCallerId.get()); + ctxProps->setNonEmptyProp(kCallerIdHttpHeaderName, queryCallerId()); } if (span == nullptr) @@ -275,16 +272,13 @@ class CSpan : public CInterfaceOf //StringBuffer traceStateHTTPHeader; //traceStateHTTPHeader.append("hpcc=").append(spanID.get()); - ctxProps->setProp(opentelemetry::trace::propagation::kTraceState.data(), span->GetContext().trace_state()->ToHeader().c_str()); + ctxProps->setNonEmptyProp(opentelemetry::trace::propagation::kTraceState.data(), span->GetContext().trace_state()->ToHeader().c_str()); } else { - if (!isEmptyString(traceID.get())) - ctxProps->setProp("traceID", traceID.get()); - if (!isEmptyString(spanID.get())) - ctxProps->setProp("spanID", spanID.get()); - if (!isEmptyString(traceFlags.get())) - ctxProps->setProp("traceFlags", traceFlags.get()); + ctxProps->setNonEmptyProp("traceID", traceID.get()); + ctxProps->setNonEmptyProp("spanID", spanID.get()); + ctxProps->setNonEmptyProp("traceFlags", traceFlags.get()); if (localParentSpan != nullptr) { @@ -292,8 +286,7 @@ class CSpan : public CInterfaceOf localParentSpan->getSpanContext(localParentSpanCtxProps, false); if (localParentSpanCtxProps) { - if (localParentSpanCtxProps->hasProp("spanID")) - ctxProps->setProp("localParentSpanID", localParentSpanCtxProps->queryProp("spanID")); + ctxProps->setNonEmptyProp("localParentSpanID", localParentSpanCtxProps->queryProp("spanID")); } } } @@ -547,28 +540,6 @@ class CServerSpan : public CSpan //Remote parent is declared via http headers from client call opentelemetry::v1::trace::SpanContext remoteParentSpanCtx = opentelemetry::trace::SpanContext::GetInvalid(); - void setSpanContext(StringArray & httpHeaders, const char kvDelineator, SpanFlags flags) - { - Owned contextProps = createProperties(true); - ForEachItemIn(currentHeaderIndex, httpHeaders) - { - const char* httpHeader = httpHeaders.item(currentHeaderIndex); - if(!httpHeader) - continue; - - const char* delineator = strchr(httpHeader, kvDelineator); - if(delineator == nullptr) - continue; - - StringBuffer key; - key.append(delineator - httpHeader, httpHeader); - - contextProps->setProp(key, delineator + 1); - } - - setSpanContext(contextProps, flags); - } - void setSpanContext(const IProperties * httpHeaders, SpanFlags flags) { if (httpHeaders) @@ -608,8 +579,6 @@ class CServerSpan : public CSpan opts.parent = remoteParentSpanCtx; } } - - //Generate new HPCCGlobalID if not provided } bool getSpanContext(IProperties * ctxProps, bool otelFormatted) const override @@ -629,14 +598,6 @@ class CServerSpan : public CSpan } public: - CServerSpan(const char * spanName, const char * tracerName_, StringArray & httpHeaders, SpanFlags flags) - : CSpan(spanName, tracerName_) - { - opts.kind = opentelemetry::trace::SpanKind::kServer; - setSpanContext(httpHeaders, ':', flags); - init(); - } - CServerSpan(const char * spanName, const char * tracerName_, const IProperties * httpHeaders, SpanFlags flags) : CSpan(spanName, tracerName_) { @@ -898,7 +859,8 @@ class CTraceManager : implements ITraceManager, public CInterface ISpan * createServerSpan(const char * name, StringArray & httpHeaders, SpanFlags flags) override { - return new CServerSpan(name, moduleName.get(), httpHeaders, flags); + Owned headerProperties = getHeadersAsProperties(httpHeaders); + return new CServerSpan(name, moduleName.get(), headerProperties, flags); } ISpan * createServerSpan(const char * name, const IProperties * httpHeaders, SpanFlags flags) override diff --git a/testing/regress/ecl/httpcall_multiheader.ecl b/testing/regress/ecl/httpcall_multiheader.ecl index e0594e8d3ea..0ccf89a54f1 100644 --- a/testing/regress/ecl/httpcall_multiheader.ecl +++ b/testing/regress/ecl/httpcall_multiheader.ecl @@ -32,13 +32,19 @@ string TargetURL := 'http://' + TargetIP + ':8010/WsSmc/HttpEcho?name=doe,joe&nu string constHeader := 'constHeaderValue'; -httpcallResult := HTTPCALL(TargetURL,'GET', 'text/xml', httpEchoServiceResponseRecord, xpath('Envelope/Body/HttpEchoResponse'),httpheader('literalHeader','literalValue'), httpheader('constHeader','constHeaderValue'), httpheader('storedHeader', storedHeader), httpheader('HPCC-Global-Id','9876543210'), httpheader('HPCC-Caller-Id','http111')); +httpcallResult := HTTPCALL(TargetURL,'GET', 'text/xml', httpEchoServiceResponseRecord, xpath('Envelope/Body/HttpEchoResponse'), + httpheader('literalHeader','literalValue'), httpheader('constHeader','constHeaderValue'), + httpheader('storedHeader', storedHeader), httpheader('HPCC-Global-Id','9876543210'), + httpheader('HPCC-Caller-Id','http111'), httpheader('traceparent', '00-0123456789abcdef0123456789abcdef-0123456789abcdef-01')); output(httpcallResult, named('httpcallResult')); //test proxyaddress functionality by using an invalid targetUrl, but a valid proxyaddress. HTTP Host header will be wrong, but should still work fine as it's ignored by ESP. string hostURL := 'http://1.1.1.1:9999/WsSmc/HttpEcho?name=doe,joe&number=1'; string targetProxy := 'http://' + TargetIP + ':8010'; -proxyResult := HTTPCALL(hostURL,'GET', 'text/xml', httpEchoServiceResponseRecord, xpath('Envelope/Body/HttpEchoResponse'), proxyaddress(targetProxy), httpheader('literalHeader','literalValue'), httpheader('constHeader','constHeaderValue'), httpheader('storedHeader', storedHeader), httpheader('HPCC-Global-Id','9876543210'), httpheader('HPCC-Caller-Id','http222')); +proxyResult := HTTPCALL(hostURL,'GET', 'text/xml', httpEchoServiceResponseRecord, xpath('Envelope/Body/HttpEchoResponse'), proxyaddress(targetProxy), + httpheader('literalHeader','literalValue'), httpheader('constHeader','constHeaderValue'), + httpheader('storedHeader', storedHeader), httpheader('HPCC-Global-Id','9876543210'), + httpheader('HPCC-Caller-Id','http222'), httpheader('traceparent', '00-0123456789abcdef0123456789abcdef-f123456789abcdef-01')); output(proxyResult, named('proxyResult')); diff --git a/testing/regress/ecl/key/httpcall_multiheader.xml b/testing/regress/ecl/key/httpcall_multiheader.xml index 4f77e613321..1eb9ce5c01b 100644 --- a/testing/regress/ecl/key/httpcall_multiheader.xml +++ b/testing/regress/ecl/key/httpcall_multiheader.xml @@ -1,6 +1,6 @@ - GET/WsSmc/HttpEchoname=doe,joe&number=1
Accept-Encoding: gzip, deflate
Accept: text/xml
HPCC-Caller-Id: http111
HPCC-Global-Id: 9876543210
constHeader: constHeaderValue
literalHeader: literalValue
storedHeader: StoredHeaderDefault
+ GET/WsSmc/HttpEchoname=doe,joe&number=1
Accept-Encoding: gzip, deflate
Accept: text/xml
HPCC-Caller-Id: http111
HPCC-Global-Id: 9876543210
constHeader: constHeaderValue
literalHeader: literalValue
storedHeader: StoredHeaderDefault
traceparent: 00-0123456789abcdef0123456789abcdef-0123456789abcdef-01
- GET/WsSmc/HttpEchoname=doe,joe&number=1
Accept-Encoding: gzip, deflate
Accept: text/xml
HPCC-Caller-Id: http222
HPCC-Global-Id: 9876543210
constHeader: constHeaderValue
literalHeader: literalValue
storedHeader: StoredHeaderDefault
+ GET/WsSmc/HttpEchoname=doe,joe&number=1
Accept-Encoding: gzip, deflate
Accept: text/xml
HPCC-Caller-Id: http222
HPCC-Global-Id: 9876543210
constHeader: constHeaderValue
literalHeader: literalValue
storedHeader: StoredHeaderDefault
traceparent: 00-0123456789abcdef0123456789abcdef-f123456789abcdef-01
diff --git a/testing/regress/ecl/key/soapcall_multihttpheader.xml b/testing/regress/ecl/key/soapcall_multihttpheader.xml index 6a5623c8134..c42022df19e 100644 --- a/testing/regress/ecl/key/soapcall_multihttpheader.xml +++ b/testing/regress/ecl/key/soapcall_multihttpheader.xml @@ -1,5 +1,5 @@ - POST/WsSmc/HttpEchoname=doe,joe&number=1
Accept-Encoding: gzip, deflate
StoredHeader: StoredHeaderDefault
constHeader: constHeaderValue
literalHeader: literalHeaderValue
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + POST/WsSmc/HttpEchoname=doe,joe&number=1
Accept-Encoding: gzip, deflate
StoredHeader: StoredHeaderDefault
constHeader: constHeaderValue
literalHeader: literalHeaderValue
traceparent: 00-0123456789abcdef0123456789abcdef-0123456789abcdef-01
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <HttpEcho> <Name>Doe, Joe</Name> @@ -10,7 +10,7 @@ </soap:Envelope>
- POST/WsSmc/HttpEchoname=doe,joe&number=1
Accept-Encoding: gzip, deflate
StoredHeader: StoredHeaderDefault
constHeader: constHeaderValue
literalHeader: literalHeaderValue
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> + POST/WsSmc/HttpEchoname=doe,joe&number=1
Accept-Encoding: gzip, deflate
StoredHeader: StoredHeaderDefault
constHeader: constHeaderValue
literalHeader: literalHeaderValue
traceparent: 00-0123456789abcdef0123456789abcdef-f123456789abcdef-01
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <HttpEcho> <Name>Doe, Joe</Name> diff --git a/testing/regress/ecl/soapcall_multihttpheader.ecl b/testing/regress/ecl/soapcall_multihttpheader.ecl index db81cab2d34..fc5e4ba1ce6 100644 --- a/testing/regress/ecl/soapcall_multihttpheader.ecl +++ b/testing/regress/ecl/soapcall_multihttpheader.ecl @@ -39,7 +39,9 @@ httpEchoServiceRequestRecord := string constHeader := 'constHeaderValue'; -soapcallResult := SOAPCALL(TargetURL, 'HttpEcho', httpEchoServiceRequestRecord, DATASET(httpEchoServiceResponseRecord), LITERAL, xpath('HttpEchoResponse'), httpheader('StoredHeader', storedHeader), httpheader('literalHeader', 'literalHeaderValue'), httpheader('constHeader', constHeader)); +soapcallResult := SOAPCALL(TargetURL, 'HttpEcho', httpEchoServiceRequestRecord, DATASET(httpEchoServiceResponseRecord), LITERAL, xpath('HttpEchoResponse'), + httpheader('StoredHeader', storedHeader), httpheader('literalHeader', 'literalHeaderValue'), httpheader('constHeader', constHeader), + httpheader('traceparent', '00-0123456789abcdef0123456789abcdef-0123456789abcdef-01')); output(soapcallResult, named('soapcallResult')); @@ -48,6 +50,8 @@ output(soapcallResult, named('soapcallResult')); string HostURL := 'http://1.1.1.1:9999/WsSmc/HttpEcho?name=doe,joe&number=1'; string TargetProxy := 'http://' + TargetIP + ':8010'; -proxyResult := SOAPCALL(HostURL, 'HttpEcho', httpEchoServiceRequestRecord, DATASET(httpEchoServiceResponseRecord), LITERAL, xpath('HttpEchoResponse'), proxyAddress(TargetProxy), httpheader('StoredHeader', storedHeader), httpheader('literalHeader', 'literalHeaderValue'), httpheader('constHeader', constHeader)); +proxyResult := SOAPCALL(HostURL, 'HttpEcho', httpEchoServiceRequestRecord, DATASET(httpEchoServiceResponseRecord), LITERAL, xpath('HttpEchoResponse'), proxyAddress(TargetProxy), + httpheader('StoredHeader', storedHeader), httpheader('literalHeader', 'literalHeaderValue'), httpheader('constHeader', constHeader), + httpheader('traceparent', '00-0123456789abcdef0123456789abcdef-f123456789abcdef-01')); output(proxyResult, named('proxyResult'));